* Commit for 2.1.0.
[BackupPC.git] / conf / config.pl
index ff5090e..55e1f3c 100644 (file)
@@ -108,6 +108,13 @@ $Conf{UmaskMode} = 027;
 #
 # The default value is every hour except midnight.
 #
+# The first entry of $Conf{WakeupSchedule} is when BackupPC_nightly
+# is run.  No other backups can run while BackupPC_nightly is
+# running.  You might want to re-arrange the entries in
+# $Conf{WakeupSchedule} (they don't have to be ascending) so that
+# the first entry is when you want BackupPC_nightly to run
+# (eg: when you don't expect a lot of regular backups to run).
+#
 $Conf{WakeupSchedule} = [1..23];
 
 #
@@ -133,6 +140,50 @@ $Conf{MaxUserBackups} = 4;
 #
 $Conf{MaxPendingCmds} = 10;
 
+#
+# How many BackupPC_nightly processes to run in parallel.
+#
+# Each night, at the first wakeup listed in $Conf{WakeupSchedule},
+# BackupPC_nightly is run.  Its job is to remove unneeded files
+# in the pool, ie: files that only have one link.  To avoid race
+# conditions, BackupPC_nightly runs only when there are no backups
+# running, and no backups will start while it runs.
+#
+# So to reduce the elapsed time, you might want to increase this
+# setting to run several BackupPC_nightly processes in parallel
+# (eg: 4, or even 8).
+#
+$Conf{MaxBackupPCNightlyJobs} = 2;
+
+#
+# How many days (runs) it takes BackupPC_nightly to traverse the
+# entire pool.  Normally this is 1, which means every night it runs,
+# it does traverse the entire pool removing unused pool files.
+#
+# Other valid values are 2, 4, 8, 16.  This causes BackupPC_nightly to
+# traverse 1/2, 1/4, 1/8 or 1/16th of the pool each night, meaning it
+# takes 2, 4, 8 or 16 days to completely traverse the pool.  The
+# advantage is that each night the running time of BackupPC_nightly
+# is reduced roughly in proportion, since the total job is split
+# over multiple days.  The disadvantage is that unused pool files
+# take longer to get deleted, which will slightly increase disk
+# usage.
+#
+# Note that even when $Conf{BackupPCNightlyPeriod} > 1, BackupPC_nightly
+# still runs every night.  It just does less work each time it runs.
+#
+# Examples:
+#
+#    $Conf{BackupPCNightlyPeriod} = 1;   # entire pool is checked every night
+#
+#    $Conf{BackupPCNightlyPeriod} = 2;   # two days to complete pool check
+#                                        # (different half each night)
+#
+#    $Conf{BackupPCNightlyPeriod} = 4;   # four days to complete pool check
+#                                        # (different quarter each night)
+#
+$Conf{BackupPCNightlyPeriod} = 1;
+
 #
 # Maximum number of log files we keep around in log directory.
 # These files are aged nightly.  A setting of 14 means the log
@@ -165,7 +216,7 @@ $Conf{DfCmd} = '$dfPath $topDir';
 #
 
 $Conf{SplitPath} = '/usr/bin/split';
-$Conf{ParPath}   = '/usr/bin/par';
+$Conf{ParPath}   = '/usr/bin/par2';
 $Conf{CatPath}   = '/bin/cat';
 $Conf{GzipPath}  = '/bin/gzip';
 $Conf{Bzip2Path} = '/usr/bin/bzip2';
@@ -337,10 +388,6 @@ $Conf{TarShareName} = '/';
 # being backed up (eg: a retired machine), but you wish to keep the
 # last backups available for browsing or restoring to other machines.
 #
-# Also, you might create a virtual client (by setting $Conf{ClientNameAlias})
-# for restoring to a DVD or permanent media and you would set
-# $Conf{FullPeriod} to -2 so that it is never backed up.
-#
 $Conf{FullPeriod} = 6.97;
 
 #
@@ -420,11 +467,7 @@ $Conf{IncrPeriod} = 0.97;
 # apart), and then 2 at an interval of 32 * $Conf{FullPeriod} (approx
 # 7-8 months apart).
 #
-# Note that you will have to increase $Conf{FullAgeMax} if you want
-# very old full backups to be kept.  Full backups are removed according
-# to both $Conf{FullKeepCnt} and $Conf{FullAgeMax}.
-#
-# Note also that these two settings are equivalent and both keep just
+# Example: these two settings are equivalent and both keep just
 # the four most recent full dumps:
 #
 #    $Conf{FullKeepCnt} = 4;
@@ -437,6 +480,10 @@ $Conf{FullKeepCnt} = 1;
 # we keep at least $Conf{FullKeepCntMin} full backups no matter how old
 # they are.
 #
+# Note that $Conf{FullAgeMax} will be increased to $Conf{FullAgeMax}
+# times $Conf{FullPeriod} if $Conf{FullAgeMax} specifies enough
+# full backups to exceed $Conf{FullAgeMax}.
+#
 $Conf{FullKeepCntMin} = 1;
 $Conf{FullAgeMax}     = 90;
 
@@ -457,6 +504,21 @@ $Conf{IncrKeepCnt} = 6;
 $Conf{IncrKeepCntMin} = 1;
 $Conf{IncrAgeMax}     = 30;
 
+#
+# A failed full backup is saved as a partial backup.  The rsync
+# XferMethod can take advantage of the partial full when the next
+# backup is run. This parameter sets the age of the partial full
+# in days: if the partial backup is older than this number of
+# days, then rsync will ignore (not use) the partial full when
+# the next backup is run.  If you set this to a negative value
+# then no partials will be saved.  If you set this to 0, partials
+# will be saved, but will not be used by the next backup.
+#
+# The default setting of 3 days means that a partial older than
+# 3 days is ignored when the next full backup is done.
+#
+$Conf{PartialAgeMax} = 3;
+
 #
 # Whether incremental backups are filled.  "Filling" means that the
 # most recent full (or filled) dump is merged into the new incremental
@@ -519,7 +581,7 @@ $Conf{ArchiveInfoKeepCnt} = 10;
 # to give a list of directories or files to backup for each share
 # (the share name is the key).  If this is set to just a string or
 # array, and $Conf{SmbShareName} contains multiple share names, then
-# the setting is assumed to apply to only the first share name.
+# the setting is assumed to apply all shares.
 #
 # Examples:
 #    $Conf{BackupFilesOnly} = '/myFiles';
@@ -544,7 +606,7 @@ $Conf{BackupFilesOnly} = undef;
 # to give a list of directories or files to exclude for each share
 # (the share name is the key).  If this is set to just a string or
 # array, and $Conf{SmbShareName} contains multiple share names, then
-# the setting is assumed to apply to only the first share name.
+# the setting is assumed to apply to all shares.
 #
 # The exact behavior is determined by the underlying transport program,
 # smbclient or tar.  For smbclient the exlclude file list is passed into
@@ -673,19 +735,24 @@ $Conf{BackupZeroFilesIsFatal} = 1;
 #
 # The valid values are:
 #
-#   - 'smb':    backup and restore via smbclient and the SMB protocol.
-#               Best choice for WinXX.
+#   - 'smb':     backup and restore via smbclient and the SMB protocol.
+#                Easiest choice for WinXX.
 #
-#   - 'rsync':  backup and restore via rsync (via rsh or ssh).
-#               Best choice for linux/unix.  Can also work on WinXX.
+#   - 'rsync':   backup and restore via rsync (via rsh or ssh).
+#                Best choice for linux/unix.  Good choice also for WinXX.
 #
-#   - 'rsyncd': backup and restre via rsync daemon on the client.
-#               Best choice for linux/unix if you have rsyncd running on
-#               the client.  Can also work on WinXX.
+#   - 'rsyncd':  backup and restre via rsync daemon on the client.
+#                Best choice for linux/unix if you have rsyncd running on
+#                the client.  Good choice also for WinXX.
 #
 #   - 'tar':    backup and restore via tar, tar over ssh, rsh or nfs.
 #               Good choice for linux/unix.
 #
+#   - 'archive': host is a special archive host.  Backups are not done.
+#                An archive host is used to archive other host's backups
+#                to permanent media, such as tape, CDR or DVD.
+#               
+#
 $Conf{XferMethod} = 'smb';
 
 #
@@ -708,7 +775,7 @@ $Conf{XferLogLevel} = 1;
 $Conf{SmbClientPath} = '/usr/bin/smbclient';
 
 #
-# Commands to run smbclient for a full dump, incremental dump or a restore.
+# Command to run smbclient for a full dump.
 # This setting only matters if $Conf{XferMethod} = 'smb'.
 #
 # The following variables are substituted at run-time:
@@ -723,18 +790,30 @@ $Conf{SmbClientPath} = '/usr/bin/smbclient';
 #    $X_option        exclude option (if $fileList is an exclude list)
 #    $timeStampFile   start time for incremental dump
 #
-# If your smb share is read-only then direct restores will fail.
-# You should set $Conf{SmbClientRestoreCmd} to undef and the
-# corresponding CGI restore option will be removed.
-#
 $Conf{SmbClientFullCmd} = '$smbClientPath \\\\$host\\$shareName'
            . ' $I_option -U $userName -E -N -d 1'
             . ' -c tarmode\\ full -Tc$X_option - $fileList';
 
+#
+# Command to run smbclient for an incremental dump.
+# This setting only matters if $Conf{XferMethod} = 'smb'.
+#
+# Same variable substitutions are applied as $Conf{SmbClientFullCmd}.
+#
 $Conf{SmbClientIncrCmd} = '$smbClientPath \\\\$host\\$shareName'
            . ' $I_option -U $userName -E -N -d 1'
            . ' -c tarmode\\ full -TcN$X_option $timeStampFile - $fileList';
 
+#
+# Command to run smbclient for a restore.
+# This setting only matters if $Conf{XferMethod} = 'smb'.
+#
+# Same variable substitutions are applied as $Conf{SmbClientFullCmd}.
+#
+# If your smb share is read-only then direct restores will fail.
+# You should set $Conf{SmbClientRestoreCmd} to undef and the
+# corresponding CGI restore option will be removed.
+#
 $Conf{SmbClientRestoreCmd} = '$smbClientPath \\\\$host\\$shareName'
             . ' $I_option -U $userName -E -N -d 1'
             . ' -c tarmode\\ full -Tx -';
@@ -928,6 +1007,29 @@ $Conf{RsyncdPasswd} = '';
 #
 $Conf{RsyncdAuthRequired} = 1;
 
+#
+# When rsync checksum caching is enabled (by adding the
+# --checksum-seed=32761 option to $Conf{RsyncArgs}), the cached
+# checksums can be occaisonally verified to make sure the file
+# contents matches the cached checksums.  This is to avoid the
+# risk that disk problems might cause the pool file contents to
+# get corrupted, but the cached checksums would make BackupPC
+# think that the file still matches the client.
+#
+# This setting is the probability (0 means never and 1 means always)
+# that a file will be rechecked.  Setting it to 0 means the checksums
+# will not be rechecked (unless there is a phase 0 failure).  Setting
+# it to 1 (ie: 100%) means all files will be checked, but that is
+# not a desirable setting since you are better off simply turning
+# caching off (ie: remove the --checksum-seed option).
+#   
+# The default of 0.01 means 1% (on average) of the files during a full
+# backup will have their cached checksum re-checked.
+#   
+# This setting has no effect unless checksum caching is turned on.
+#   
+$Conf{RsyncCsumCacheVerifyProb} = 0.01;
+
 #
 # Arguments to rsync for backup.  Do not edit the first set unless you
 # have a thorough understanding of how File::RsyncP works.
@@ -955,6 +1057,14 @@ $Conf{RsyncArgs} = [
             '--times',
             '--block-size=2048',
             '--recursive',
+
+           #
+           # If you are using a patched client rsync that supports the
+           # --checksum-seed option (see http://backuppc.sourceforge.net),
+           # then uncomment this to enabled rsync checksum cachcing
+           #
+           #'--checksum-seed=32761',
+
            #
            # Add additional arguments here
            #
@@ -972,17 +1082,25 @@ $Conf{RsyncRestoreArgs} = [
            #
            # Do not edit these!
            #
-           "--numeric-ids",
-           "--perms",
-           "--owner",
-           "--group",
-           "--devices",
-           "--links",
-           "--times",
-           "--block-size=2048",
-           "--relative",
-           "--ignore-times",
-           "--recursive",
+           '--numeric-ids',
+           '--perms',
+           '--owner',
+           '--group',
+           '--devices',
+           '--links',
+           '--times',
+           '--block-size=2048',
+           '--relative',
+           '--ignore-times',
+           '--recursive',
+
+           #
+           # If you are using a patched client rsync that supports the
+           # --checksum-seed option (see http://backuppc.sourceforge.net),
+           # then uncomment this to enabled rsync checksum cachcing
+           #
+           #'--checksum-seed=32761',
+
            #
            # Add additional arguments here
            #
@@ -1012,8 +1130,9 @@ $Conf{ArchiveComp} = 'gzip';
 #
 # Archive Parity Files
 #
-# The number of Parity Files to generate.
-# Uses the commandline par available from
+# The amount of Parity data to generate, as a percentage
+# of the archive size.
+# Uses the commandline par2 (par2cmdline) available from
 # http://parchive.sourceforge.net
 #
 # Only useful for file dumps.
@@ -1028,8 +1147,11 @@ $Conf{ArchivePar} = 0;
 # Only for file archives. Splits the output into 
 # the specified size * 1,000,000.
 # e.g. to split into 650,000,000 bytes, specify 650 below.
+# 
+# If the value is 0, or if $Conf{ArchiveDest} is an existing file or
+# device (e.g. a streaming tape drive), this feature is disabled.
 #
-$Conf{ArchiveSplit} = 650;
+$Conf{ArchiveSplit} = 0;
 
 #
 # Archive Command
@@ -1040,14 +1162,14 @@ $Conf{ArchiveSplit} = 650;
 #   $Installdir    The installation directory of BackupPC
 #   $tarCreatePath The path to BackupPC_tarCreate
 #   $splitpath     The path to the split program
-#   $parpath       The path to the par program
+#   $parpath       The path to the par2 program
 #   $host          The host to archive
 #   $backupnumber  The backup number of the host to archive
 #   $compression   The path to the compression program
 #   $compext       The extension assigned to the compression type
 #   $splitsize     The number of bytes to split archives into
 #   $archiveloc    The location to put the archive
-#   $parfile       The number of par files to create
+#   $parfile       The amount of parity data to create (percentage)
 #
 $Conf{ArchiveClientCmd} = '$Installdir/bin/BackupPC_archiveHost'
        . ' $tarCreatePath $splitpath $parpath $host $backupnumber'
@@ -1254,6 +1376,7 @@ $Conf{MaxOldPerPCLogFiles} = 12;
 #        $shares       list of all the share names
 #        $XferMethod   value of $Conf{XferMethod} (eg: tar, rsync, smb)
 #        $sshPath      value of $Conf{SshPath},
+#        $cmdType      set to DumpPreUserCmd or DumpPostUserCmd
 #
 # The following variable substitutions are made at run time for
 # $Conf{RestorePreUserCmd} and $Conf{RestorePostUserCmd}:
@@ -1275,6 +1398,7 @@ $Conf{MaxOldPerPCLogFiles} = 12;
 #        $pathHdrSrc   common starting path of restore source
 #        $pathHdrDest  common starting path of destination
 #        $fileList     list of files being restored
+#        $cmdType      set to RestorePreUserCmd or RestorePostUserCmd
 #
 # The following variable substitutions are made at run time for
 # $Conf{ArchivePreUserCmd} and $Conf{ArchivePostUserCmd}:
@@ -1288,12 +1412,13 @@ $Conf{MaxOldPerPCLogFiles} = 12;
 #        $HostList     list of hosts being archived
 #        $BackupList   list of backup numbers for the hosts being archived
 #        $archiveloc   location where the archive is sent to
-#        $parfile      number of par files being generated
+#        $parfile      amount of parity data being generated (percentage)
 #        $compression  compression program being used (eg: cat, gzip, bzip2)
 #        $compext      extension used for compression type (eg: raw, gz, bz2)
 #        $splitsize    size of the files that the archive creates
 #        $sshPath      value of $Conf{SshPath},
 #        $type         set to "archive"
+#        $cmdType      set to ArchivePreUserCmd or ArchivePostUserCmd
 #
 $Conf{DumpPreUserCmd}     = undef;
 $Conf{DumpPostUserCmd}    = undef;
@@ -1491,7 +1616,7 @@ $Conf{CgiURL} = undef;
 #   
 # Language to use.  See lib/BackupPC/Lang for the list of supported
 # languages, which include English (en), French (fr), Spanish (es),
-# German (de), and Italian (it).
+# German (de), Italian (it) and Dutch (nl).
 #
 # Currently the Language setting applies to the CGI interface and email
 # messages sent to users.  Log files and other text are still in English.
@@ -1530,11 +1655,38 @@ $Conf{CgiDateFormatMMDD} = 1;
 
 #
 # If set, the complete list of hosts appears in the left navigation
-# bar for administrators.  Otherwise, just the hosts for which the
-# user is listed in the host file (as either the user or in moreUsers)
+# bar pull-down for administrators.  Otherwise, just the hosts for which
+# the user is listed in the host file (as either the user or in moreUsers)
 # are displayed.
 #
-$Conf{CgiNavBarAdminAllHosts} = 0;
+$Conf{CgiNavBarAdminAllHosts} = 1;
+
+#
+# Enable/disable the search box in the navigation bar.
+#
+$Conf{CgiSearchBoxEnable} = 1;
+
+#
+# Additional navigation bar links.  These appear for both regular users
+# and administrators.  This is a list of hashes giving the link (URL)
+# and the text (name) for the link.  Specifying lname instead of name
+# uses the language specific string (ie: $Lang->{lname}) instead of
+# just literally displaying name.
+#
+$Conf{CgiNavBarLinks} = [
+    {
+        link  => "?action=view&type=docs",
+        lname => "Documentation",    # actually displays $Lang->{Documentation}
+    },
+    {
+        link  => "http://backuppc.sourceforge.net/faq",
+        name  => "FAQ",              # displays literal "FAQ"
+    },
+    {
+        link  => "http://backuppc.sourceforge.net",
+        name  => "SourceForge",      # displays literal "SourceForge"
+    },
+];
 
 #
 # Hilight colors based on status that are used in the PC summary page.
@@ -1584,171 +1736,8 @@ $Conf{CgiExt2ContentType} = { };
 $Conf{CgiImageDirURL} = '';
 
 #
-# CSS stylesheet for the CGI interface.
-#
-$Conf{CSSstylesheet} = <<'EOF';
-<style type="text/css">
-body {
-    font-family:arial,sans-serif;
-    font-size:1em;
-    background-color:#ffffff;
-    margin:2px 5px 0px 2px;
-    height:100%
-}
-
-h1 {
-    font-family:arial,sans-serif;
-    font-size:1.5em;
-    color:#000000
-}
-
-h2 {
-    font-family:arial,sans-serif;
-    font-size:1em;
-    color:#000000
-}
-
-p {
-    font-family:arial,sans-serif;
-    font-size:.9em
-}
-
-a {
-    font-family:arial,sans-serif;
-    color:#3333ff
-}
-
-li {
-    font-size:.9em;
-}
-
-a:hover {
-    color:#cc0000;
-    text-decoration:none
-}
-
-a.NavCurrent {
-    font-weight:bold;
-}
-
-a.navbar {
-    padding-left:5px;
-    padding-right:5px;
-}
-
-.h1 {
-    font-family:arial,sans-serif;
-    font-size:1.5em;
-    color:#000000;
-    font-weight:bold;
-    background-color:#99cc33;
-    padding:3px;
-    padding-left:6px;
-    margin-bottom:5px;
-}
-
-.h2 {
-    font-family:arial,sans-serif;
-    font-size:1em;
-    color:#000000;
-    font-weight:bold;
-    background-color:#ddeeee;
-    padding:3px;
-    padding-left:6px;
-    margin-top:3px;
-    margin-bottom:1px;
-}
-
-.tableStnd {
-}
-
-.tableheader {
-    font-size:.8em;
-    font-weight:bold;
-    background-color:#cccccc;
-}
-
-.border {
-    font-size:.9em;
-}
-
-.fviewheader {
-    font-weight:bold;
-    font-size:.8em;
-    color:#ffffff;
-    background-color:#999999;
-}
-
-.fviewborder {
-    border-bottom:1px solid #000000;
-    border-left:1px dotted #666666;
-    background-color:#dddddd;
-    font-size:.9em;
-}
-
-.fviewon {
-    background-color:#cccccc;
-}
-
-.fviewoff {
-    background-color:#ffffff;
-}
-
-.fview {
-    font-size:.8em;
-    font-family:arial,sans-serif;
-    text-decoration:none;
-    line-height:15px;
-}
-
-.fviewbold {
-    font-size:.9em;
-    font-family:arial,sans-serif;
-    text-decoration:none;
-    line-height:15px;
-    font-weight:bold;
-}
-
-.histView {
-    border-bottom:1px solid #000000;
-    border-left:2px solid #ffffff;
-    background-color:#dddddd;
-    font-size:.9em;
-}
-
-.histViewMis {
-    border-bottom:1px solid #000000;
-    background-color:#ffdddd;
-}
-
-div.NavMenu {
-    width:18%;
-    margin:0px;
-    background-color:#ddeeee;
-}
-
-div.NavMenu a {
-    font-size:.8em;
-    display:block;
-    margin-left:8px;
-    padding:2px;
-}
-
-div.NavTitle {
-    padding-left:10px;
-    background-color:#99cc33;
-    font-family:arial,sans-serif;
-    color:#000000;
-    font-weight:bold;
-    margin-bottom:2px;
-}
-
-#Content {
-    float:right;
-    width:80%;
-    left:20%;
-    top:10px;
-    position:absolute;
-}
-</style>
-EOF
+# CSS stylesheet for the CGI interface.  It is stored in the
+# $Conf{CgiImageDir} directory and accessed via the
+# $Conf{CgiImageDirURL} URL.
+#
+$Conf{CgiCSSFile} = 'BackupPC_stnd.css';