- Fixed rsync is case of shareName = '/'
[BackupPC.git] / conf / config.pl
1 #============================================================= -*-perl-*-
2 #
3 # Configuration file for BackupPC.
4 #
5 # DESCRIPTION
6 #
7 #   This is the main configuration file for BackupPC.
8 #
9 #   This file must be valid perl source, so make sure the punctuation,
10 #   quotes, and other syntax are valid.
11 #
12 #   This file is read by BackupPC at startup, when a HUP (-1) signal
13 #   is sent to BackupPC and also at each wakeup time whenever the
14 #   modification time of this file changes.
15 #
16 #   The configuration parameters are divided into four general groups.
17 #   The first group (general server configuration) provides general
18 #   configuration for BackupPC.  The next two groups describe what
19 #   to backup, when to do it, and how long to keep it.  The fourth
20 #   group are settings for the CGI http interface.
21 #
22 #   Configuration settings can also be specified on a per-PC basis.
23 #   Simply put the relevant settings in a config.pl file in the
24 #   PC's backup directory (ie: in __TOPDIR__/pc/hostName).
25 #   All configuration settings in the second, third and fourth
26 #   groups can be overridden by the per-PC config.pl file.
27 #
28 # AUTHOR
29 #   Craig Barratt  <cbarratt@users.sourceforge.net>
30 #
31 # COPYRIGHT
32 #   Copyright (C) 2001-2003  Craig Barratt
33 #
34 #   See http://backuppc.sourceforge.net.
35 #
36 #========================================================================
37
38 ###########################################################################
39 # General server configuration
40 ###########################################################################
41 #
42 # Host name on which the BackupPC server is running.
43 #
44 $Conf{ServerHost} = '';
45
46 #
47 # TCP port number on which the BackupPC server listens for and accepts
48 # connections.  Normally this should be disabled (set to -1).  The TCP
49 # port is only needed if apache runs on a different machine from BackupPC.
50 # In that case, set this to any spare port number over 1024 (eg: 2359).
51 # If you enable the TCP port, make sure you set $Conf{ServerMesgSecret}
52 # too!
53 #
54 $Conf{ServerPort} = -1;
55
56 #
57 # Shared secret to make the TCP port secure.  Set this to a hard to guess
58 # string if you enable the TCP port (ie: $Conf{ServerPort} > 0).
59 #
60 # To avoid possible attacks via the TCP socket interface, every client
61 # message is protected by an MD5 digest. The MD5 digest includes four
62 # items:
63 #   - a seed that is sent to the client when the connection opens
64 #   - a sequence number that increments for each message
65 #   - a shared secret that is stored in $Conf{ServerMesgSecret}
66 #   - the message itself.
67 #
68 # The message is sent in plain text preceded by the MD5 digest.  A
69 # snooper can see the plain-text seed sent by BackupPC and plain-text
70 # message from the client, but cannot construct a valid MD5 digest since
71 # the secret $Conf{ServerMesgSecret} is unknown.  A replay attack is
72 # not possible since the seed changes on a per-connection and
73 # per-message basis.
74 #
75 $Conf{ServerMesgSecret} = '';
76
77 #
78 # PATH setting for BackupPC.  An explicit value is necessary
79 # for taint mode.  Value shouldn't matter too much since
80 # all execs use explicit paths.  However, taint mode in perl
81 # will complain if this directory is world writable.
82 #
83 $Conf{MyPath} = '/bin';
84
85 #
86 # Permission mask for directories and files created by BackupPC.
87 # Default value prevents any access from group other, and prevents
88 # group write.
89 #
90 $Conf{UmaskMode} = 027;
91
92 #
93 # Times at which we wake up, check all the PCs, and schedule necessary
94 # backups.  Times are measured in hours since midnight.  Can be
95 # fractional if necessary (eg: 4.25 means 4:15am).
96 #
97 # If the hosts you are backing up are always connected to the network
98 # you might have only one or two wakeups each night.  This will keep
99 # the backup activity after hours.  On the other hand, if you are backing
100 # up laptops that are only intermittently connected to the network you
101 # will want to have frequent wakeups (eg: hourly) to maximized the chance
102 # that each laptop is backed up.
103 #
104 # Examples:
105 #     $Conf{WakeupSchedule} = [22.5];         # once per day at 10:30 pm.
106 #     $Conf{WakeupSchedule} = [1..23];        # every hour except midnight
107 #     $Conf{WakeupSchedule} = [2,4,6,8,10,12,14,16,18,20,22];  # every 2 hours
108 #
109 # The default value is every hour except midnight.
110 #
111 $Conf{WakeupSchedule} = [1..23];
112
113 #
114 # Maximum number of simultaneous backups to run.  If there
115 # are no user backup requests then this is the maximum number
116 # of simultaneous backups.
117 #
118 $Conf{MaxBackups} = 4;
119
120 #
121 # Additional number of simultaneous backups that users can run.
122 # As many as $Conf{MaxBackups} + $Conf{MaxUserBackups} requests can
123 # run at the same time.
124 #
125 $Conf{MaxUserBackups} = 4;
126
127 #
128 # Maximum number of pending link commands. New backups will only be
129 # started if there are no more than $Conf{MaxPendingCmds} plus
130 # $Conf{MaxBackups} number of pending link commands, plus running jobs.
131 # This limit is to make sure BackupPC doesn't fall too far behind in
132 # running BackupPC_link commands.
133 #
134 $Conf{MaxPendingCmds} = 10;
135
136 #
137 # Maximum number of log files we keep around in log directory.
138 # These files are aged nightly.  A setting of 14 means the log
139 # directory will contain about 2 weeks of old log files, in
140 # particular at most the files LOG, LOG.0, LOG.1, ... LOG.13
141 # (except today's LOG, these files will have a .z extension if
142 # compression is on).
143 #
144 # If you decrease this number after BackupPC has been running for a
145 # while you will have to manually remove the older log files.
146 #
147 $Conf{MaxOldLogFiles} = 14;
148
149 #
150 # Full path to the df command.  Security caution: normal users
151 # should not allowed to write to this file or directory.
152 #
153 $Conf{DfPath} = '/bin/df';
154
155 #
156 # Command to run df.  Several variables are substituted at run-time:
157 #
158 #   $dfPath      path to df ($Conf{DfPath})
159 #   $topDir      top-level BackupPC data directory
160 #
161 $Conf{DfCmd} = '$dfPath $topDir';
162
163 #
164 # Maximum threshold for disk utilization on the __TOPDIR__ filesystem.
165 # If the output from $Conf{DfPath} reports a percentage larger than
166 # this number then no new regularly scheduled backups will be run.
167 # However, user requested backups (which are usually incremental and
168 # tend to be small) are still performed, independent of disk usage.
169 # Also, currently running backups will not be terminated when the disk
170 # usage exceeds this number.
171 #
172 $Conf{DfMaxUsagePct} = 95;
173
174 #
175 # How long BackupPC_trashClean sleeps in seconds between each check
176 # of the trash directory.  Once every 5 minutes should be reasonable.
177 #
178 $Conf{TrashCleanSleepSec} = 300;
179
180 #
181 # List of DHCP address ranges we search looking for PCs to backup.
182 # This is an array of hashes for each class C address range.
183 #
184 # Examples:
185 #    # to specify 192.10.10.20 to 192.10.10.250 as the DHCP address pool
186 #    $Conf{DHCPAddressRanges} = [
187 #        {
188 #            ipAddrBase => '192.10.10',
189 #            first => 20,
190 #            last  => 250,
191 #        },
192 #    ];
193 #    # to specify two pools (192.10.10.20-250 and 192.10.11.10-50)
194 #    $Conf{DHCPAddressRanges} = [
195 #        {
196 #            ipAddrBase => '192.10.10',
197 #            first => 20,
198 #            last  => 250,
199 #        },
200 #        {
201 #            ipAddrBase => '192.10.11',
202 #            first => 10,
203 #            last  => 50,
204 #        },
205 #    ];
206 #
207 $Conf{DHCPAddressRanges} = [];
208
209 #
210 # These configuration settings aren't used by BackupPC, but simply
211 # remember a few settings used by configure.pl during installation.
212 # These are used by configure.pl when upgrading to new versions of
213 # BackupPC.
214 #
215 $Conf{BackupPCUser} = '';
216 $Conf{CgiDir}       = '';
217 $Conf{InstallDir}   = '';
218
219 #
220 # Whether BackupPC and the CGI script BackupPC_Admin verify that they
221 # are really running as user $Conf{BackupPCUser}.  If this flag is set
222 # and the effective user id (euid) differs from $Conf{BackupPCUser}
223 # then both scripts exit with an error.  This catches cases where
224 # BackupPC might be accidently started as root or the wrong user,
225 # or if the CGI script is not installed correctly.
226 #
227 $Conf{BackupPCUserVerify} = 1;
228
229 ###########################################################################
230 # What to backup and when to do it
231 # (can be overridden in the per-PC config.pl)
232 ###########################################################################
233 #
234 # Name of the host share that is backed up when using SMB.  This can be a
235 # string or an array of strings if there are multiple shares per host.
236 # Examples:
237 #
238 #   $Conf{SmbShareName} = 'c';          # backup 'c' share
239 #   $Conf{SmbShareName} = ['c', 'd'];   # backup 'c' and 'd' shares
240 #
241 # This setting only matters if $Conf{XferMethod} = 'smb'.
242 #
243 $Conf{SmbShareName} = 'C$';
244
245 #
246 # Smbclient share user name.  This is passed to smbclient's -U argument.
247 #
248 # This setting only matters if $Conf{XferMethod} = 'smb'.
249 #
250 $Conf{SmbShareUserName} = '';
251
252 #
253 # Smbclient share password.  This is passed to smbclient via the PASSWD
254 # environment variable.  There are several ways you can tell BackupPC
255 # the smb share password.  In each case you should be very careful about
256 # security.  If you put the password here, make sure that this file is
257 # not readable by regular users!  See the "Setting up config.pl" section
258 # in the documentation for more information.
259 #
260 # This setting only matters if $Conf{XferMethod} = 'smb'.
261 #
262 $Conf{SmbSharePasswd} = '';
263
264 #
265 # Which host directories to backup when using tar transport.  This can be a
266 # string or an array of strings if there are multiple directories to
267 # backup per host.  Examples:
268 #
269 #   $Conf{TarShareName} = '/';                  # backup everything
270 #   $Conf{TarShareName} = '/home';              # only backup /home
271 #   $Conf{TarShareName} = ['/home', '/src'];    # backup /home and /src
272 #
273 # The fact this parameter is called 'TarShareName' is for historical
274 # consistency with the Smb transport options.  You can use any valid
275 # directory on the client: there is no need for it to correspond to
276 # any Smb share or device mount point.
277 #
278 # Note also that you can also use $Conf{BackupFilesOnly} to specify
279 # a specific list of directories to backup.  It's more efficient to
280 # use this option instead of $Conf{TarShareName} since a new tar is
281 # run for each entry in $Conf{TarShareName}.
282 #
283 # This setting only matters if $Conf{XferMethod} = 'tar'.
284 #
285 $Conf{TarShareName} = '/';
286
287 #
288 # Minimum period in days between full backups. A full dump will only be
289 # done if at least this much time has elapsed since the last full dump,
290 # and at least $Conf{IncrPeriod} days has elapsed since the last
291 # successful dump.
292 #
293 # Typically this is set slightly less than an integer number of days. The
294 # time taken for the backup, plus the granularity of $Conf{WakeupSchedule}
295 # will make the actual backup interval a bit longer.
296 #
297 $Conf{FullPeriod} = 6.97;
298
299 #
300 # Minimum period in days between incremental backups (a user requested
301 # incremental backup will be done anytime on demand).
302 #
303 # Typically this is set slightly less than an integer number of days. The
304 # time taken for the backup, plus the granularity of $Conf{WakeupSchedule}
305 # will make the actual backup interval a bit longer.
306 #
307 $Conf{IncrPeriod} = 0.97;
308
309 #
310 # Number of full backups to keep.  Must be >= 1.
311 #
312 # In the steady state, each time a full backup completes successfully
313 # the oldest one is removed.  If this number is decreased, the
314 # extra old backups will be removed.
315 #
316 # If filling of incremental dumps is off the oldest backup always
317 # has to be a full (ie: filled) dump.  This might mean an extra full
318 # dump is kept until the second oldest (incremental) dump expires.
319 #
320 $Conf{FullKeepCnt} = 1;
321
322 #
323 # Very old full backups are removed after $Conf{FullAgeMax} days.  However,
324 # we keep at least $Conf{FullKeepCntMin} full backups no matter how old
325 # they are.
326 #
327 $Conf{FullKeepCntMin} = 1;
328 $Conf{FullAgeMax}     = 60;
329
330 #
331 # Number of incremental backups to keep.  Must be >= 1.
332 #
333 # In the steady state, each time an incr backup completes successfully
334 # the oldest one is removed.  If this number is decreased, the
335 # extra old backups will be removed.
336 #
337 $Conf{IncrKeepCnt} = 6;
338
339 #
340 # Very old incremental backups are removed after $Conf{IncrAgeMax} days.
341 # However, we keep at least $Conf{IncrKeepCntMin} incremental backups no
342 # matter how old they are.
343 #
344 $Conf{IncrKeepCntMin} = 1;
345 $Conf{IncrAgeMax}     = 30;
346
347 #
348 # Whether incremental backups are filled.  "Filling" means that the
349 # most recent full (or filled) dump is merged into the new incremental
350 # dump using hardlinks.  This makes an incremental dump look like a
351 # full dump.  Prior to v1.03 all incremental backups were filled.
352 # In v1.4.0 and later the default is off.
353 #
354 # BackupPC, and the cgi interface in particular, do the right thing on
355 # un-filled incremental backups.  It will correctly display the merged
356 # incremental backup with the most recent filled backup, giving the
357 # un-filled incremental backups a filled appearance.  That means it
358 # invisible to the user whether incremental dumps are filled or not.
359 #
360 # Filling backups takes a little extra disk space, and it does cost
361 # some extra disk activity for filling, and later removal.  Filling
362 # is no longer useful, since file mangling and compression doesn't
363 # make a filled backup very useful. It's likely the filling option
364 # will be removed from future versions: filling will be delegated to
365 # the display and extraction of backup data.
366 #
367 # If filling is off, BackupPC makes sure that the oldest backup is
368 # a full, otherwise the following incremental backups will be
369 # incomplete.  This might mean an extra full backup has to be
370 # kept until the following incremental backups expire.
371 #
372 # The default is off.  You can turn this on or off at any
373 # time without affecting existing backups.
374 #
375 $Conf{IncrFill} = 0;
376
377 #
378 # Number of restore logs to keep.  BackupPC remembers information about
379 # each restore request.  This number per client will be kept around before
380 # the oldest ones are pruned.
381 #
382 # Note: files/dirs delivered via Zip or Tar downloads don't count as
383 # restores.  Only the first restore option (where the files and dirs
384 # are written to the host) count as restores that are logged.
385 #
386 $Conf{RestoreInfoKeepCnt} = 10;
387
388 #
389 # List of directories or files to backup.  If this is defined, only these
390 # directories or files will be backed up.
391 #
392 # For Smb, only one of $Conf{BackupFilesExclude} and $Conf{BackupFilesOnly}
393 # can be specified per share. If both are set for a particular share, then
394 # $Conf{BackupFilesOnly} takes precedence and $Conf{BackupFilesExclude}
395 # is ignored.
396 #
397 # This can be set to a string, an array of strings, or, in the case
398 # of multiple shares, a hash of strings or arrays.  A hash is used
399 # to give a list of directories or files to backup for each share
400 # (the share name is the key).  If this is set to just a string or
401 # array, and $Conf{SmbShareName} contains multiple share names, then
402 # the setting is assumed to apply to only the first share name.
403 #
404 # Examples:
405 #    $Conf{BackupFilesOnly} = '/myFiles';
406 #    $Conf{BackupFilesOnly} = ['/myFiles'];     # same as first example
407 #    $Conf{BackupFilesOnly} = ['/myFiles', '/important'];
408 #    $Conf{BackupFilesOnly} = {
409 #       'c' => ['/myFiles', '/important'],      # these are for 'c' share
410 #       'd' => ['/moreFiles', '/archive'],      # these are for 'd' share
411 #    }
412 #
413 $Conf{BackupFilesOnly} = undef;
414
415 #
416 # List of directories or files to exclude from the backup.  For Smb,
417 # only one of $Conf{BackupFilesExclude} and $Conf{BackupFilesOnly}
418 # can be specified per share.  If both are set for a particular share,
419 # then $Conf{BackupFilesOnly} takes precedence and
420 # $Conf{BackupFilesExclude} is ignored.
421 #
422 # This can be set to a string, an array of strings, or, in the case
423 # of multiple shares, a hash of strings or arrays.  A hash is used
424 # to give a list of directories or files to exclude for each share
425 # (the share name is the key).  If this is set to just a string or
426 # array, and $Conf{SmbShareName} contains multiple share names, then
427 # the setting is assumed to apply to only the first share name.
428 #
429 # The exact behavior is determined by the underlying transport program,
430 # smbclient or tar.  For smbclient the exlclude file list is passed into
431 # the X option.  Simple shell wild-cards using "*" or "?" are allowed.
432 #
433 # For tar, if the exclude file contains a "/" it is assumed to be anchored
434 # at the start of the string.  Since all the tar paths start with "./",
435 # BackupPC prepends a "." if the exclude file starts with a "/".  Note
436 # that GNU tar version >= 1.3.7 is required for the exclude option to
437 # work correctly.  For linux or unix machines it is recommended to add
438 # "/proc" to $Conf{BackupFilesExclude}.
439 #
440 # Examples:
441 #    $Conf{BackupFilesExclude} = '/temp';
442 #    $Conf{BackupFilesExclude} = ['/temp'];     # same as first example
443 #    $Conf{BackupFilesExclude} = ['/temp', '/winnt/tmp'];
444 #    $Conf{BackupFilesExclude} = {
445 #       'c' => ['/temp', '/winnt/tmp'],         # these are for 'c' share
446 #       'd' => ['/junk', '/dont_back_this_up'], # these are for 'd' share
447 #    }
448 #
449 $Conf{BackupFilesExclude} = undef;
450
451 #
452 # PCs that are always or often on the network can be backed up after
453 # hours, to reduce PC, network and server load during working hours. For
454 # each PC a count of consecutive good pings is maintained. Once a PC has
455 # at least $Conf{BlackoutGoodCnt} consecutive good pings it is subject
456 # to "blackout" and not backed up during hours and days specified by
457 # $Conf{BlackoutWeekDays}, $Conf{BlackoutHourBegin} and
458 # $Conf{BlackoutHourEnd}.
459 #
460 # To allow for periodic rebooting of a PC or other brief periods when a
461 # PC is not on the network, a number of consecutive bad pings is allowed
462 # before the good ping count is reset. This parameter is
463 # $Conf{BlackoutBadPingLimit}.
464 #
465 # Note that bad and good pings don't occur with the same interval. If a
466 # machine is always on the network, it will only be pinged roughly once
467 # every $Conf{IncrPeriod} (eg: once per day). So a setting for
468 # $Conf{BlackoutGoodCnt} of 7 means it will take around 7 days for a
469 # machine to be subject to blackout. On the other hand, if a ping is
470 # failed, it will be retried roughly every time BackupPC wakes up, eg,
471 # every one or two hours. So a setting for $Conf{BlackoutBadPingLimit} of
472 # 3 means that the PC will lose its blackout status after 3-6 hours of
473 # unavailability.
474 #
475 # To disable the blackout feature set $Conf{BlackoutGoodCnt} to a negative
476 # value.  A value of 0 will make all machines subject to blackout.  But
477 # if you don't want to do any backups during the day it would be easier
478 # to just set $Conf{WakeupSchedule} to a restricted schedule.
479 #
480 $Conf{BlackoutBadPingLimit} = 3;
481 $Conf{BlackoutGoodCnt}      = 7;
482
483 #
484 # The default settings specify the blackout period from 7:00am to
485 # 7:30pm local time on Mon-Fri.  For $Conf{BlackoutWeekDays},
486 # 0 is Sunday, 1 is Monday etc.
487 #
488 $Conf{BlackoutHourBegin}    = 7.0;
489 $Conf{BlackoutHourEnd}      = 19.5;
490 $Conf{BlackoutWeekDays}     = [1, 2, 3, 4, 5];
491
492 ###########################################################################
493 # General per-PC configuration settings
494 # (can be overridden in the per-PC config.pl)
495 ###########################################################################
496 #
497 # What transport method to use to backup each host.  If you have
498 # a mixed set of WinXX and linux/unix hosts you will need to override
499 # this in the per-PC config.pl.
500 #
501 # The valid values are:
502 #
503 #   - 'smb':    backup and restore via smbclient and the SMB protocol.
504 #               Best choice for WinXX.
505 #
506 #   - 'rsync':  backup and restore via rsync (via rsh or ssh).
507 #               Best choice for linux/unix.  Can also work on WinXX.
508 #
509 #   - 'rsyncd': backup and restre via rsync daemon on the client.
510 #               Best choice for linux/unix if you have rsyncd running on
511 #               the client.  Can also work on WinXX.
512 #
513 #   - 'tar':    backup and restore via tar, tar over ssh, rsh or nfs.
514 #               Good choice for linux/unix.
515 #
516 # A future version should support 'rsync' as a transport method for
517 # more efficient backup of linux/unix machines (and perhaps WinXX??).
518 #
519 $Conf{XferMethod} = 'smb';
520
521 #
522 # Full path for smbclient. Security caution: normal users should not
523 # allowed to write to this file or directory.
524 #
525 # smbclient is from the Samba distribution. smbclient is used to
526 # actually extract the incremental or full dump of the share filesystem
527 # from the PC.
528 #
529 # This setting only matters if $Conf{XferMethod} = 'smb'.
530 #
531 $Conf{SmbClientPath} = '/usr/bin/smbclient';
532
533 #
534 # Commands to run smbclient for a full dump, incremental dump or a restore.
535 # This setting only matters if $Conf{XferMethod} = 'smb'.
536 #
537 # Several variables are substituted at run-time:
538 #
539 #    $smbClientPath   same as $Conf{SmbClientPath}
540 #    $host            host to backup/restore
541 #    $hostIP          host IP address
542 #    $shareName       share name
543 #    $userName        user name
544 #    $fileList        list of files to backup (based on exclude/include)
545 #    $I_option        optional -I option to smbclient
546 #    $X_option        exclude option (if $fileList is an exclude list)
547 #    $timeStampFile   start time for incremental dump
548 #
549 $Conf{SmbClientFullCmd} = '$smbClientPath \\\\$host\\$shareName'
550             . ' $I_option -U $userName -E -N -d 1'
551             . ' -c tarmode\\ full -Tc$X_option - $fileList';
552
553 $Conf{SmbClientIncrCmd} = '$smbClientPath \\\\$host\\$shareName'
554             . ' $I_option -U $userName -E -N -d 1'
555             . ' -c tarmode\\ full -TcN$X_option $timeStampFile - $fileList';
556
557 $Conf{SmbClientRestoreCmd} = '$smbClientPath \\\\$host\\$shareName'
558             . ' $I_option -U $userName -E -N -d 1'
559             . ' -c tarmode\\ full -Tx -';
560
561 #
562 # Full command to run tar on the client.  GNU tar is required.  You will
563 # need to fill in the correct paths for ssh2 on the local host (server)
564 # and GNU tar on the client.  Security caution: normal users should not
565 # allowed to write to these executable files or directories.
566 #
567 # See the documentation for more information about setting up ssh2 keys.
568 #
569 # If you plan to use NFS then tar just runs locally and ssh2 is not needed.
570 # For example, assuming the client filesystem is mounted below /mnt/hostName,
571 # you could use something like:
572 #
573 #    $Conf{TarClientCmd} = '$tarPath -c -v -f - -C /mnt/$host/$shareName'
574 #                        . ' --totals';
575 #
576 # In the case of NFS or rsh you need to make sure BackupPC's privileges
577 # are sufficient to read all the files you want to backup.  Also, you
578 # will probably want to add "/proc" to $Conf{BackupFilesExclude}.
579 #
580 # Several variables are substituted at run-time.  The following variables
581 # are substituted at run-time:
582 #
583 #   $host        host name
584 #   $hostIP      host's IP address
585 #   $incrDate    newer-than date for incremental backups
586 #   $shareName   share name to backup (ie: top-level directory path)
587 #   $fileList    specific files to backup or exclude
588 #   $tarPath     same as $Conf{TarClientPath}
589 #   $sshPath     same as $Conf{SshPath}
590 #
591 # If a variable is followed by a "+" it is shell escaped.  This is
592 # necessary for the command part of ssh or rsh, since it ends up
593 # getting passed through the shell.
594 #
595 # This setting only matters if $Conf{XferMethod} = 'tar'.
596 #
597 $Conf{TarClientCmd} = '$sshPath -q -n -l root $host'
598                     . ' $tarPath -c -v -f - -C $shareName+'
599                     . ' --totals';
600
601 #
602 # Extra tar arguments for full backups.  Several variables are substituted at
603 # run-time.  See $Conf{TarClientCmd} for the list of variable substitutions.
604 #
605 # This setting only matters if $Conf{XferMethod} = 'tar'.
606 #
607 $Conf{TarFullArgs} = '$fileList+';
608
609 #
610 # Extra tar arguments for incr backups.  Several variables are substituted at
611 # run-time.  See $Conf{TarClientCmd} for the list of variable substitutions.
612 #
613 # Note that GNU tar has several methods for specifying incremental backups,
614 # including:
615 #
616 #   --newer-mtime $incrDate+
617 #          This causes a file to be included if the modification time is
618 #          later than $incrDate (meaning its contents might have changed).
619 #          But changes in the ownership or modes will not qualify the
620 #          file to be included in an incremental.
621 #
622 #   --newer=$incrDate+
623 #          This causes the file to be included if any attribute of the
624 #          file is later than $incrDate, meaning either attributes or
625 #          the modification time.  This is the default method.  Do
626 #          not use --atime-preserve in $Conf{TarClientCmd} above,
627 #          otherwise resetting the atime (access time) counts as an
628 #          attribute change, meaning the file will always be included
629 #          in each new incremental dump.
630 #
631 # This setting only matters if $Conf{XferMethod} = 'tar'.
632 #
633 $Conf{TarIncrArgs} = '--newer=$incrDate+ $fileList+';
634
635 #
636 # Full command to run tar for restore on the client.  GNU tar is required.
637 # This can be the same as $Conf{TarClientCmd}, with tar's -c replaced by -x
638 # and ssh's -n removed.
639 #
640 # See $Conf{TarClientCmd} for full details.
641 #
642 # This setting only matters if $Conf{XferMethod} = "tar".
643 #
644 $Conf{TarClientRestoreCmd} = '$sshPath -q -l root $host'
645                    . ' $tarPath -x -p --numeric-owner --same-owner'
646                    . ' -v -f - -C $shareName+';
647
648 #
649 # Full path for tar on the client. Security caution: normal users should not
650 # allowed to write to this file or directory.
651 #
652 # This setting only matters if $Conf{XferMethod} = 'tar'.
653 #
654 $Conf{TarClientPath} = '/bin/tar';
655
656 #
657 # Path to rsync executable on the client
658 #
659 $Conf{RsyncClientPath} = '/bin/rsync';
660
661 #
662 # Full command to run rsync on the client machine.  The following variables
663 # are substituted at run-time:
664 #
665 #        $host           host name being backed up
666 #        $hostIP         host's IP address
667 #        $shareName      share name to backup (ie: top-level directory path)
668 #        $rsyncPath      same as $Conf{RsyncClientPath}
669 #        $sshPath        same as $Conf{SshPath}
670 #        $argList        argument list, built from $Conf{RsyncArgs},
671 #                        $shareName, $Conf{BackupFilesExclude} and
672 #                        $Conf{BackupFilesOnly}
673 #
674 # This setting only matters if $Conf{XferMethod} = 'rsync'.
675 #
676 $Conf{RsyncClientCmd} = '$sshPath -l root $host $rsyncPath $argList';
677
678 #
679 # Full command to run rsync for restore on the client.  The following
680 # variables are substituted at run-time:
681 #
682 #        $host           host name being backed up
683 #        $hostIP         host's IP address
684 #        $shareName      share name to backup (ie: top-level directory path)
685 #        $rsyncPath      same as $Conf{RsyncClientPath}
686 #        $sshPath        same as $Conf{SshPath}
687 #        $argList        argument list, built from $Conf{RsyncArgs},
688 #                        $shareName, $Conf{BackupFilesExclude} and
689 #                        $Conf{BackupFilesOnly}
690 #
691 # This setting only matters if $Conf{XferMethod} = 'rsync'.
692 #
693 $Conf{RsyncClientRestoreCmd} = '$sshPath -l root $host $rsyncPath $argList';
694
695 #
696 # Share name to backup.  For $Conf{XferMethod} = "rsync" this should
697 # be a directory name, eg '/' or '/home'.  For $Conf{XferMethod} = "rsyncd"
698 # this should be the name of the module to backup (ie: the name from
699 # /etc/rsynd.conf).
700 #
701 $Conf{RsyncShareName} = '/';
702
703 #
704 # Rsync daemon port on the client, for $Conf{XferMethod} = "rsyncd".
705 #
706 $Conf{RsyncdClientPort} = 873;
707
708 #
709 # Rsync daemon user name on client, for $Conf{XferMethod} = "rsyncd".
710 # The user name and password are stored on the client in whatever file
711 # the "secrets file" parameter in rsyncd.conf points to
712 # (eg: /etc/rsyncd.secrets).
713 #
714 $Conf{RsyncdUserName} = '';
715
716 #
717 # Rsync daemon user name on client, for $Conf{XferMethod} = "rsyncd".
718 # The user name and password are stored on the client in whatever file
719 # the "secrets file" parameter in rsyncd.conf points to
720 # (eg: /etc/rsyncd.secrets).
721 #
722 $Conf{RsyncdPasswd} = '';
723
724 #
725 # Whether authentication is mandatory when connecting to the client's
726 # rsyncd.  By default this is on, ensuring that BackupPC will refuse to
727 # connect to an rsyncd on the client that is not password protected.
728 # Turn off at your own risk.
729 #
730 $Conf{RsyncdAuthRequired} = 1;
731
732 #
733 # Arguments to rsync for backup.  Do not edit the first set unless you
734 # have a thorough understanding of how File::RsyncP works.
735 #
736 # Examples of additional arguments that should work are --exclude/--include,
737 # eg:
738 #
739 #     $Conf{RsyncArgs} = [
740 #           # original arguments here
741 #           '-v',
742 #           '--exclude', '/proc',
743 #           '--exclude', '*.tmp',
744 #     ];
745 #
746 $Conf{RsyncArgs} = [
747             #
748             # Do not edit these!
749             #
750             '--numeric-ids',
751             '--perms',
752             '--owner',
753             '--group',
754             '--devices',
755             '--links',
756             '--times',
757             '--block-size=2048',
758             '--recursive',
759             #
760             # Add additional arguments here
761             #
762 ];
763
764 #
765 # Arguments to rsync for restore.  Do not edit the first set unless you
766 # have a thorough understanding of how File::RsyncP works.
767 #
768 #
769 $Conf{RsyncRestoreArgs} = [
770             #
771             # Do not edit these!
772             #
773             "--numeric-ids",
774             "--perms",
775             "--owner",
776             "--group",
777             "--devices",
778             "--links",
779             "--times",
780             "--block-size=2048",
781             "--relative",
782             "--ignore-times",
783             "--recursive",
784             #
785             # Add additional arguments here
786             #
787 ];
788
789 #
790 # Amount of verbosity in Rsync Xfer log files.  0 means be quiet,
791 # 1 will give will give one line per file, 2 will also show skipped
792 # files on incrementals, higher values give more output.  10 will
793 # include byte dumps of all data read/written, which will make the
794 # log files huge.
795 #
796 $Conf{RsyncLogLevel} = 1;
797
798 #
799 # Full path for ssh. Security caution: normal users should not
800 # allowed to write to this file or directory.
801 #
802 $Conf{SshPath} = '/usr/bin/ssh';
803
804 #
805 # Full path for nmblookup. Security caution: normal users should not
806 # allowed to write to this file or directory.
807 #
808 # nmblookup is from the Samba distribution. nmblookup is used to get the
809 # netbios name, necessary for DHCP hosts.
810 #
811 $Conf{NmbLookupPath} = '/usr/bin/nmblookup';
812
813 #
814 # NmbLookup command.  Given an IP address, does an nmblookup on that
815 # IP address.  Several variables are substituted at run-time:
816 #
817 #   $nmbLookupPath      path to nmblookup ($Conf{NmbLookupPath})
818 #   $host               host name
819 #
820 $Conf{NmbLookupCmd} = '$nmbLookupPath -A $host';
821
822 #
823 # NmbLookup command.  Given a netbios name, finds that host by doing
824 # a NetBios multicast.  Several variables are substituted at run-time:
825 #
826 #   $nmbLookupPath      path to nmblookup ($Conf{NmbLookupPath})
827 #   $host               NetBios name
828 #
829 # In some cases you might need to change the broadcast address, for
830 # example if nmblookup uses 192.168.255.255 by default and you find
831 # that doesn't work, try 192.168.1.255 (or your equivalent class C
832 # address) using the -B option:
833 #
834 #    $Conf{NmbLookupFindHostCmd} = '$nmbLookupPath -B 192.168.1.255 $host';
835 #
836 $Conf{NmbLookupFindHostCmd} = '$nmbLookupPath $host';
837
838 #
839 # For fixed IP address hosts, BackupPC_dump can also verify the netbios
840 # name to ensure it matches the host name.  An error is generated if
841 # they do not match.  Typically this flag is off.  But if you are going
842 # to transition a bunch of machines from fixed host addresses to DHCP,
843 # setting this flag is a great way to verify that the machines have
844 # their netbios name set correctly before turning on DCHP.
845 #
846 $Conf{FixedIPNetBiosNameCheck} = 0;
847
848 #
849 # Full path to the ping command.  Security caution: normal users
850 # should not be allowed to write to this file or directory.
851 #
852 # If you want to disable ping checking, set this to some program
853 # that exits with 0 status, eg:
854 #
855 #     $Conf{PingPath} = '/bin/echo';
856 #
857 $Conf{PingPath} = '/bin/ping';
858
859 #
860 # Ping command.  Several variables are substituted at run-time:
861 #
862 #   $pingPath      path to ping ($Conf{PingPath})
863 #   $host          host name
864 #
865 $Conf{PingCmd} = '$pingPath -c 1 $host';
866
867 #
868 # Compression level to use on files.  0 means no compression.  Compression
869 # levels can be from 1 (least cpu time, slightly worse compression) to
870 # 9 (most cpu time, slightly better compression).  The recommended value
871 # is 3.  Changing to 5, for example, will take maybe 20% more cpu time
872 # and will get another 2-3% additional compression. See the zlib
873 # documentation for more information about compression levels.
874 #
875 # Changing compression on or off after backups have already been done
876 # will require both compressed and uncompressed pool files to be stored.
877 # This will increase the pool storage requirements, at least until all
878 # the old backups expire and are deleted.
879 #
880 # It is ok to change the compression value (from one non-zero value to
881 # another non-zero value) after dumps are already done.  Since BackupPC
882 # matches pool files by comparing the uncompressed versions, it will still
883 # correctly match new incoming files against existing pool files.  The
884 # new compression level will take effect only for new files that are
885 # newly compressed and added to the pool.
886 #
887 # If compression was off and you are enabling compression for the first
888 # time you can use the BackupPC_compressPool utility to compress the
889 # pool.  This avoids having the pool grow to accommodate both compressed
890 # and uncompressed backups.  See the documentation for more information.
891 #
892 # Note: compression needs the Compress::Zlib perl library.  If the
893 # Compress::Zlib library can't be found then $Conf{CompressLevel} is
894 # forced to 0 (compression off).
895 #
896 $Conf{CompressLevel} = 0;
897
898 #
899 # Maximum round-trip ping time in milliseconds.  This threshold is set
900 # to avoid backing up PCs that are remotely connected through WAN or
901 # dialup connections.  The output from ping -s (assuming it is supported
902 # on your system) is used to check the round-trip packet time.  On your
903 # local LAN round-trip times should be much less than 20msec.  On most
904 # WAN or dialup connections the round-trip time will be typically more
905 # than 20msec.  Tune if necessary.
906 #
907 $Conf{PingMaxMsec} = 20;
908
909 #
910 # Timeout in seconds when listening for the transport program's
911 # (smbclient, tar etc) stdout. If no output is received during this
912 # time, then it is assumed that something has wedged during a backup,
913 # and the backup is terminated.
914 #
915 # Note that stdout buffering combined with huge files being backed up
916 # could cause longish delays in the output from smbclient that
917 # BackupPC_dump sees, so in rare cases you might want to increase
918 # this value.
919 #
920 # Despite the name, this parameter sets the timeout for all transport
921 # methods (tar, smb etc).
922 #
923 $Conf{ClientTimeout} = 7200;
924
925 #
926 # Maximum number of log files we keep around in each PC's directory
927 # (ie: pc/$host).  These files are aged monthly.  A setting of 12
928 # means there will be at most the files LOG, LOG.0, LOG.1, ... LOG.11
929 # in the pc/$host directory (ie: about a years worth).  (Except this
930 # month's LOG, these files will have a .z extension if compression
931 # is on).
932 #
933 # If you decrease this number after BackupPC has been running for a
934 # while you will have to manually remove the older log files.
935 #
936 $Conf{MaxOldPerPCLogFiles} = 12;
937
938 #
939 # Optional commands to run before and after dumps and restores.
940 # Stdout from these commands will be written to the Xfer (or Restore)
941 # log file.  One example of using these commands would be to
942 # shut down and restart a database server, or to dump a database
943 # to files for backup.  Example:
944 #
945 #    $Conf{DumpPreUserCmd} = '$sshPath -l root $host /usr/bin/dumpMysql';
946 #
947 # Various variable substitutions are available; see BackupPC_dump
948 # or BackupPC_restore for the details.
949 #
950 $Conf{DumpPreUserCmd}     = undef;
951 $Conf{DumpPostUserCmd}    = undef;
952 $Conf{RestorePreUserCmd}  = undef;
953 $Conf{RestorePostUserCmd} = undef;
954
955 #
956 # Override the client's host name.  This allows multiple clients
957 # to all refer to the same physical hosts.  This should only be
958 # set in the per-PC config file.
959 #
960 # Note: this setting doesn't work for DHCP hosts.
961 #
962 $Conf{ClientNameAlias} = undef;
963
964 #
965 # Advanced option for asking BackupPC to load additional perl modules.
966 # Can be a list (array ref) of module names to load at startup.
967 #
968 $Conf{PerlModuleLoad}     = undef;
969
970 ###########################################################################
971 # Email reminders, status and messages
972 # (can be overridden in the per-PC config.pl)
973 ###########################################################################
974 #
975 # Full path to the sendmail command.  Security caution: normal users
976 # should not allowed to write to this file or directory.
977 #
978 $Conf{SendmailPath} = '/usr/sbin/sendmail';
979
980 #
981 # Minimum period between consecutive emails to a single user.
982 # This tries to keep annoying email to users to a reasonable
983 # level.  Email checks are done nightly, so this number is effectively
984 # rounded up (ie: 2.5 means a user will never receive email more
985 # than once every 3 days).
986 #
987 $Conf{EMailNotifyMinDays} = 2.5;
988
989 #
990 # Name to use as the "from" name for email.  Depending upon your mail
991 # handler this is either a plain name (eg: "admin") or a fully-qualified
992 # name (eg: "admin@mydomain.com").
993 #
994 $Conf{EMailFromUserName} = '';
995
996 #
997 # Destination address to an administrative user who will receive a
998 # nightly email with warnings and errors.  If there are no warnings
999 # or errors then no email will be sent.  Depending upon your mail
1000 # handler this is either a plain name (eg: "admin") or a fully-qualified
1001 # name (eg: "admin@mydomain.com").
1002 #
1003 $Conf{EMailAdminUserName} = '';
1004
1005 #
1006 # Destination domain name for email sent to users.  By default
1007 # this is empty, meaning email is sent to plain, unqualified
1008 # addresses.  Otherwise, set it to the destintation domain, eg:
1009 #
1010 #    $Cong{EMailUserDestDomain} = '@mydomain.com';
1011 #
1012 # With this setting user email will be set to 'user@mydomain.com'.
1013 #
1014 $Conf{EMailUserDestDomain} = '';
1015
1016 #
1017 # This subject and message is sent to a user if their PC has never been
1018 # backed up.
1019 #
1020 # These values are language-dependent.  The default versions can be
1021 # found in the language file (eg: lib/BackupPC/Lang/en.pm).  If you
1022 # need to change the message, copy it here and edit it, eg:
1023 #
1024 #   $Conf{EMailNoBackupEverMesg} = <<'EOF';
1025 #   To: $user$domain
1026 #   cc:
1027 #   Subject: $subj
1028 #   
1029 #   Dear $userName,
1030 #   
1031 #   This is a site-specific email message.
1032 #   EOF
1033 #
1034 $Conf{EMailNoBackupEverSubj} = undef;
1035 $Conf{EMailNoBackupEverMesg} = undef;
1036
1037 #
1038 # How old the most recent backup has to be before notifying user.
1039 # When there have been no backups in this number of days the user
1040 # is sent an email.
1041 #
1042 $Conf{EMailNotifyOldBackupDays} = 7.0;
1043
1044 #
1045 # This subject and message is sent to a user if their PC has not recently
1046 # been backed up (ie: more than $Conf{EMailNotifyOldBackupDays} days ago).
1047 #
1048 # These values are language-dependent.  The default versions can be
1049 # found in the language file (eg: lib/BackupPC/Lang/en.pm).  If you
1050 # need to change the message, copy it here and edit it, eg:
1051 #
1052 #   $Conf{EMailNoBackupRecentMesg} = <<'EOF';
1053 #   To: $user$domain
1054 #   cc:
1055 #   Subject: $subj
1056 #   
1057 #   Dear $userName,
1058 #   
1059 #   This is a site-specific email message.
1060 #   EOF
1061 #
1062 $Conf{EMailNoBackupRecentSubj} = undef;
1063 $Conf{EMailNoBackupRecentMesg} = undef;
1064
1065 #
1066 # How old the most recent backup of Outlook files has to be before
1067 # notifying user.
1068 #
1069 $Conf{EMailNotifyOldOutlookDays} = 5.0;
1070
1071 #
1072 # This subject and message is sent to a user if their Outlook files have
1073 # not recently been backed up (ie: more than $Conf{EMailNotifyOldOutlookDays}
1074 # days ago).
1075 #
1076 # These values are language-dependent.  The default versions can be
1077 # found in the language file (eg: lib/BackupPC/Lang/en.pm).  If you
1078 # need to change the message, copy it here and edit it, eg:
1079 #
1080 #   $Conf{EMailOutlookBackupMesg} = <<'EOF';
1081 #   To: $user$domain
1082 #   cc:
1083 #   Subject: $subj
1084 #   
1085 #   Dear $userName,
1086 #   
1087 #   This is a site-specific email message.
1088 #   EOF
1089 #
1090 $Conf{EMailOutlookBackupSubj} = undef;
1091 $Conf{EMailOutlookBackupMesg} = undef;
1092
1093 ###########################################################################
1094 # CGI user interface configuration settings
1095 # (can be overridden in the per-PC config.pl)
1096 ###########################################################################
1097 #
1098 # Normal users can only access information specific to their host.
1099 # They can start/stop/browse/restore backups.
1100 #
1101 # Administrative users have full access to all hosts, plus overall
1102 # status and log information.
1103 #
1104 # The administrative users are the union of the unix/linux group
1105 # $Conf{CgiAdminUserGroup} and the manual list of users, separated
1106 # by spaces, in $Conf{CgiAdminUsers}. If you don't want a group or
1107 # manual list of users set the corresponding configuration setting
1108 # to undef or an empty string.
1109 #
1110 # If you want every user to have admin privileges (careful!), set
1111 # $Conf{CgiAdminUsers} = '*'.
1112 #
1113 # Examples:
1114 #    $Conf{CgiAdminUserGroup} = 'admin';
1115 #    $Conf{CgiAdminUsers}     = 'craig celia';
1116 #    --> administrative users are the union of group admin, plus
1117 #      craig and celia.
1118 #
1119 #    $Conf{CgiAdminUserGroup} = '';
1120 #    $Conf{CgiAdminUsers}     = 'craig celia';
1121 #    --> administrative users are only craig and celia'.
1122 #
1123 $Conf{CgiAdminUserGroup} = '';
1124 $Conf{CgiAdminUsers}     = '';
1125
1126 #
1127 # URL of the BackupPC_Admin CGI script.  Used for email messages.
1128 #
1129 $Conf{CgiURL} = undef;
1130
1131 #   
1132 # Language to use.  See lib/BackupPC/Lang for the list of supported
1133 # languages, which includes English (en) and French (fr).  Currently
1134 # this applies mainly to the CGI interface, but over time it might
1135 # also include log files and other text output.
1136 #
1137 $Conf{Language} = 'en';
1138
1139 #
1140 # User names that are rendered by the CGI interface can be turned
1141 # into links into their home page or other information about the
1142 # user.  To set this up you need to create two sprintf() strings,
1143 # that each contain a single '%s' that will be replaced by the user
1144 # name.  The default is a mailto: link.
1145 #
1146 # $Conf{CgiUserHomePageCheck} should be an absolute file path that
1147 # is used to check (via "-f") that the user has a valid home page.
1148 # Set this to undef or an empty string to turn off this check.
1149 #
1150 # $Conf{CgiUserUrlCreate} should be a full URL that points to the
1151 # user's home page.  Set this to undef or an empty string to turn
1152 # off generation of URLs for user names.
1153 #
1154 # Example:
1155 #    $Conf{CgiUserHomePageCheck} = '/var/www/html/users/%s.html';
1156 #    $Conf{CgiUserUrlCreate}     = 'http://myhost/users/%s.html';
1157 #    --> if /var/www/html/users/craig.html exists, then 'craig' will
1158 #      be rendered as a link to http://myhost/users/craig.html.
1159 #
1160 $Conf{CgiUserHomePageCheck} = '';
1161 $Conf{CgiUserUrlCreate}     = 'mailto:%s';
1162
1163 #
1164 # Date display format for CGI interface.  True for US-style dates (MM/DD)
1165 # and zero for international dates (DD/MM).
1166 #
1167 $Conf{CgiDateFormatMMDD} = 1;
1168
1169 #
1170 # If set, the complete list of hosts appears in the left navigation
1171 # bar for administrators.  Otherwise, just the hosts for which the
1172 # user is listed in the host file (as either the user or in moreUsers)
1173 # are displayed.
1174 #
1175 $Conf{CgiNavBarAdminAllHosts} = 0;
1176
1177 #
1178 # Header font and size for CGI interface
1179 #
1180 $Conf{CgiHeaderFontType} = 'arial';
1181 $Conf{CgiHeaderFontSize} = '3';
1182
1183 #
1184 # Color scheme for CGI interface.  Default values give a very light blue
1185 # for the background navigation color, green for the header background,
1186 # and white for the body background.  (You call tell I should stick to
1187 # programming and not graphical design.)
1188 #
1189 $Conf{CgiNavBarBgColor} = '#ddeeee';
1190 $Conf{CgiHeaderBgColor} = '#99cc33';
1191 $Conf{CgiBodyBgColor}   = '#ffffff';
1192
1193 #
1194 # Additional CGI header text.  For example, if you wanted each CGI page
1195 # to auto refresh every 900 seconds, you could add this text:
1196 #
1197 #       <meta http-equiv="refresh" content="900">
1198 #
1199 $Conf{CgiHeaders} = '<meta http-equiv="pragma" content="no-cache">';
1200
1201 #
1202 # Directory where images are stored.  This directory should be below
1203 # Apache's DocumentRoot.  This value isn't used by BackupPC but is
1204 # used by configure.pl when you upgrade BackupPC.
1205 #
1206 # Example:
1207 #     $Conf{CgiImageDir} = '/usr/local/apache/htdocs/BackupPC';
1208 #
1209 $Conf{CgiImageDir} = '';
1210
1211 #
1212 # Additional mappings of file name extenions to Content-Type for
1213 # individual file restore.  See $Ext2ContentType in BackupPC_Admin
1214 # for the default setting.  You can add additional settings here,
1215 # or override any default settings.  Example:
1216 #
1217 #     $Conf{CgiExt2ContentType} = {
1218 #                 'pl'  => 'text/plain',
1219 #          };
1220 #
1221 $Conf{CgiExt2ContentType} = { };
1222
1223 #
1224 # URL (without the leading http://host) for BackupPC's image directory.
1225 # The CGI script uses this value to serve up image files.
1226 #
1227 # Example:
1228 #     $Conf{CgiImageDirURL} = '/BackupPC';
1229 #
1230 $Conf{CgiImageDirURL} = '';