* Support for rsync and rsyncd. Changes to BackupPC_dump and new
[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  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 # Maximum threshold for disk utilization on the __TOPDIR__ filesystem.
157 # If the output from $Conf{DfPath} reports a percentage larger than
158 # this number then no new regularly scheduled backups will be run.
159 # However, user requested backups (which are usually incremental and
160 # tend to be small) are still performed, independent of disk usage.
161 # Also, currently running backups will not be terminated when the disk
162 # usage exceeds this number.
163 #
164 $Conf{DfMaxUsagePct} = 95;
165
166 #
167 # How long BackupPC_trashClean sleeps in seconds between each check
168 # of the trash directory.  Once every 5 minutes should be reasonable.
169 #
170 $Conf{TrashCleanSleepSec} = 300;
171
172 #
173 # List of DHCP address ranges we search looking for PCs to backup.
174 # This is an array of hashes for each class C address range.
175 #
176 # Examples:
177 #    # to specify 192.10.10.20 to 192.10.10.250 as the DHCP address pool
178 #    $Conf{DHCPAddressRanges} = [
179 #        {
180 #            ipAddrBase => '192.10.10',
181 #            first => 20,
182 #            last  => 250,
183 #        },
184 #    ];
185 #    # to specify two pools (192.10.10.20-250 and 192.10.11.10-50)
186 #    $Conf{DHCPAddressRanges} = [
187 #        {
188 #            ipAddrBase => '192.10.10',
189 #            first => 20,
190 #            last  => 250,
191 #        },
192 #        {
193 #            ipAddrBase => '192.10.11',
194 #            first => 10,
195 #            last  => 50,
196 #        },
197 #    ];
198 #
199 $Conf{DHCPAddressRanges} = [];
200
201 #
202 # These configuration settings aren't used by BackupPC, but simply
203 # remember a few settings used by configure.pl during installation.
204 # These are used by configure.pl when upgrading to new versions of
205 # BackupPC.
206 #
207 $Conf{BackupPCUser} = '';
208 $Conf{CgiDir}       = '';
209 $Conf{InstallDir}   = '';
210
211 #
212 # Whether BackupPC and the CGI script BackupPC_Admin verify that they
213 # are really running as user $Conf{BackupPCUser}.  If this flag is set
214 # and the effective user id (euid) differs from $Conf{BackupPCUser}
215 # then both scripts exit with an error.  This catches cases where
216 # BackupPC might be accidently started as root or the wrong user,
217 # or if the CGI script is not installed correctly.
218 #
219 $Conf{BackupPCUserVerify} = 1;
220
221 ###########################################################################
222 # What to backup and when to do it
223 # (can be overridden in the per-PC config.pl)
224 ###########################################################################
225 #
226 # Name of the host share that is backed up when using SMB.  This can be a
227 # string or an array of strings if there are multiple shares per host.
228 # Examples:
229 #
230 #   $Conf{SmbShareName} = 'c';          # backup 'c' share
231 #   $Conf{SmbShareName} = ['c', 'd'];   # backup 'c' and 'd' shares
232 #
233 # This setting only matters if $Conf{XferMethod} = 'smb'.
234 #
235 $Conf{SmbShareName} = 'C$';
236
237 #
238 # Smbclient share user name.  This is passed to smbclient's -U argument.
239 #
240 # This setting only matters if $Conf{XferMethod} = 'smb'.
241 #
242 $Conf{SmbShareUserName} = '';
243
244 #
245 # Smbclient share password.  This is passed to smbclient via the PASSWD
246 # environment variable.  There are several ways you can tell BackupPC
247 # the smb share password.  In each case you should be very careful about
248 # security.  If you put the password here, make sure that this file is
249 # not readable by regular users!  See the "Setting up config.pl" section
250 # in the documentation for more information.
251 #
252 # This setting only matters if $Conf{XferMethod} = 'smb'.
253 #
254 $Conf{SmbSharePasswd} = '';
255
256 #
257 # Which host directories to backup when using tar transport.  This can be a
258 # string or an array of strings if there are multiple directories to
259 # backup per host.  Examples:
260 #
261 #   $Conf{TarShareName} = '/';                  # backup everything
262 #   $Conf{TarShareName} = '/home';              # only backup /home
263 #   $Conf{TarShareName} = ['/home', '/src'];    # backup /home and /src
264 #
265 # The fact this parameter is called 'TarShareName' is for historical
266 # consistency with the Smb transport options.  You can use any valid
267 # directory on the client: there is no need for it to correspond to
268 # any Smb share or device mount point.
269 #
270 # Note also that you can also use $Conf{BackupFilesOnly} to specify
271 # a specific list of directories to backup.  It's more efficient to
272 # use this option instead of $Conf{TarShareName} since a new tar is
273 # run for each entry in $Conf{TarShareName}.
274 #
275 # This setting only matters if $Conf{XferMethod} = 'tar'.
276 #
277 $Conf{TarShareName} = '/';
278
279 #
280 # Minimum period in days between full backups. A full dump will only be
281 # done if at least this much time has elapsed since the last full dump,
282 # and at least $Conf{IncrPeriod} days has elapsed since the last
283 # successful dump.
284 #
285 # Typically this is set slightly less than an integer number of days. The
286 # time taken for the backup, plus the granularity of $Conf{WakeupSchedule}
287 # will make the actual backup interval a bit longer.
288 #
289 $Conf{FullPeriod} = 6.97;
290
291 #
292 # Minimum period in days between incremental backups (a user requested
293 # incremental backup will be done anytime on demand).
294 #
295 # Typically this is set slightly less than an integer number of days. The
296 # time taken for the backup, plus the granularity of $Conf{WakeupSchedule}
297 # will make the actual backup interval a bit longer.
298 #
299 $Conf{IncrPeriod} = 0.97;
300
301 #
302 # Number of full backups to keep.  Must be >= 1.
303 #
304 # In the steady state, each time a full backup completes successfully
305 # the oldest one is removed.  If this number is decreased, the
306 # extra old backups will be removed.
307 #
308 # If filling of incremental dumps is off the oldest backup always
309 # has to be a full (ie: filled) dump.  This might mean an extra full
310 # dump is kept until the second oldest (incremental) dump expires.
311 #
312 $Conf{FullKeepCnt} = 1;
313
314 #
315 # Very old full backups are removed after $Conf{FullAgeMax} days.  However,
316 # we keep at least $Conf{FullKeepCntMin} full backups no matter how old
317 # they are.
318 #
319 $Conf{FullKeepCntMin} = 1;
320 $Conf{FullAgeMax}     = 60;
321
322 #
323 # Number of incremental backups to keep.  Must be >= 1.
324 #
325 # In the steady state, each time an incr backup completes successfully
326 # the oldest one is removed.  If this number is decreased, the
327 # extra old backups will be removed.
328 #
329 $Conf{IncrKeepCnt} = 6;
330
331 #
332 # Very old incremental backups are removed after $Conf{IncrAgeMax} days.
333 # However, we keep at least $Conf{IncrKeepCntMin} incremental backups no
334 # matter how old they are.
335 #
336 $Conf{IncrKeepCntMin} = 1;
337 $Conf{IncrAgeMax}     = 30;
338
339 #
340 # Whether incremental backups are filled.  "Filling" means that the
341 # most recent full (or filled) dump is merged into the new incremental
342 # dump using hardlinks.  This makes an incremental dump look like a
343 # full dump.  Prior to v1.03 all incremental backups were filled.
344 # In v1.4.0 and later the default is off.
345 #
346 # BackupPC, and the cgi interface in particular, do the right thing on
347 # un-filled incremental backups.  It will correctly display the merged
348 # incremental backup with the most recent filled backup, giving the
349 # un-filled incremental backups a filled appearance.  That means it
350 # invisible to the user whether incremental dumps are filled or not.
351 #
352 # Filling backups takes a little extra disk space, and it does cost
353 # some extra disk activity for filling, and later removal.  Filling
354 # is no longer useful, since file mangling and compression doesn't
355 # make a filled backup very useful. It's likely the filling option
356 # will be removed from future versions: filling will be delegated to
357 # the display and extraction of backup data.
358 #
359 # If filling is off, BackupPC makes sure that the oldest backup is
360 # a full, otherwise the following incremental backups will be
361 # incomplete.  This might mean an extra full backup has to be
362 # kept until the following incremental backups expire.
363 #
364 # The default is off.  You can turn this on or off at any
365 # time without affecting existing backups.
366 #
367 $Conf{IncrFill} = 0;
368
369 #
370 # Number of restore logs to keep.  BackupPC remembers information about
371 # each restore request.  This number per client will be kept around before
372 # the oldest ones are pruned.
373 #
374 # Note: files/dirs delivered via Zip or Tar downloads don't count as
375 # restores.  Only the first restore option (where the files and dirs
376 # are written to the host) count as restores that are logged.
377 #
378 $Conf{RestoreInfoKeepCnt} = 10;
379
380 #
381 # List of directories or files to backup.  If this is defined, only these
382 # directories or files will be backed up.
383 #
384 # For Smb, only one of $Conf{BackupFilesExclude} and $Conf{BackupFilesOnly}
385 # can be specified per share. If both are set for a particular share, then
386 # $Conf{BackupFilesOnly} takes precedence and $Conf{BackupFilesExclude}
387 # is ignored.
388 #
389 # This can be set to a string, an array of strings, or, in the case
390 # of multiple shares, a hash of strings or arrays.  A hash is used
391 # to give a list of directories or files to backup for each share
392 # (the share name is the key).  If this is set to just a string or
393 # array, and $Conf{SmbShareName} contains multiple share names, then
394 # the setting is assumed to apply to only the first share name.
395 #
396 # Examples:
397 #    $Conf{BackupFilesOnly} = '/myFiles';
398 #    $Conf{BackupFilesOnly} = ['/myFiles'];     # same as first example
399 #    $Conf{BackupFilesOnly} = ['/myFiles', '/important'];
400 #    $Conf{BackupFilesOnly} = {
401 #       'c' => ['/myFiles', '/important'],      # these are for 'c' share
402 #       'd' => ['/moreFiles', '/archive'],      # these are for 'd' share
403 #    }
404 #
405 $Conf{BackupFilesOnly} = undef;
406
407 #
408 # List of directories or files to exclude from the backup.  For Smb,
409 # only one of $Conf{BackupFilesExclude} and $Conf{BackupFilesOnly}
410 # can be specified per share.  If both are set for a particular share,
411 # then $Conf{BackupFilesOnly} takes precedence and
412 # $Conf{BackupFilesExclude} is ignored.
413 #
414 # This can be set to a string, an array of strings, or, in the case
415 # of multiple shares, a hash of strings or arrays.  A hash is used
416 # to give a list of directories or files to exclude for each share
417 # (the share name is the key).  If this is set to just a string or
418 # array, and $Conf{SmbShareName} contains multiple share names, then
419 # the setting is assumed to apply to only the first share name.
420 #
421 # The exact behavior is determined by the underlying transport program,
422 # smbclient or tar.  For smbclient the exlclude file list is passed into
423 # the X option.  Simple shell wild-cards using "*" or "?" are allowed.
424 #
425 # For tar, if the exclude file contains a "/" it is assumed to be anchored
426 # at the start of the string.  Since all the tar paths start with "./",
427 # BackupPC prepends a "." if the exclude file starts with a "/".  Note
428 # that GNU tar version >= 1.3.7 is required for the exclude option to
429 # work correctly.  For linux or unix machines it is recommended to add
430 # "/proc" to $Conf{BackupFilesExclude}.
431 #
432 # Examples:
433 #    $Conf{BackupFilesExclude} = '/temp';
434 #    $Conf{BackupFilesExclude} = ['/temp'];     # same as first example
435 #    $Conf{BackupFilesExclude} = ['/temp', '/winnt/tmp'];
436 #    $Conf{BackupFilesExclude} = {
437 #       'c' => ['/temp', '/winnt/tmp'],         # these are for 'c' share
438 #       'd' => ['/junk', '/dont_back_this_up'], # these are for 'd' share
439 #    }
440 #
441 $Conf{BackupFilesExclude} = undef;
442
443 #
444 # PCs that are always or often on the network can be backed up after
445 # hours, to reduce PC, network and server load during working hours. For
446 # each PC a count of consecutive good pings is maintained. Once a PC has
447 # at least $Conf{BlackoutGoodCnt} consecutive good pings it is subject
448 # to "blackout" and not backed up during hours and days specified by
449 # $Conf{BlackoutWeekDays}, $Conf{BlackoutHourBegin} and
450 # $Conf{BlackoutHourEnd}.
451 #
452 # To allow for periodic rebooting of a PC or other brief periods when a
453 # PC is not on the network, a number of consecutive bad pings is allowed
454 # before the good ping count is reset. This parameter is
455 # $Conf{BlackoutBadPingLimit}.
456 #
457 # Note that bad and good pings don't occur with the same interval. If a
458 # machine is always on the network, it will only be pinged roughly once
459 # every $Conf{IncrPeriod} (eg: once per day). So a setting for
460 # $Conf{BlackoutGoodCnt} of 7 means it will take around 7 days for a
461 # machine to be subject to blackout. On the other hand, if a ping is
462 # failed, it will be retried roughly every time BackupPC wakes up, eg,
463 # every one or two hours. So a setting for $Conf{BlackoutBadPingLimit} of
464 # 3 means that the PC will lose its blackout status after 3-6 hours of
465 # unavailability.
466 #
467 # To disable the blackout feature set $Conf{BlackoutGoodCnt} to a negative
468 # value.  A value of 0 will make all machines subject to blackout.  But
469 # if you don't want to do any backups during the day it would be easier
470 # to just set $Conf{WakeupSchedule} to a restricted schedule.
471 #
472 $Conf{BlackoutBadPingLimit} = 3;
473 $Conf{BlackoutGoodCnt}      = 7;
474
475 #
476 # The default settings specify the blackout period from 7:00am to
477 # 7:30pm local time on Mon-Fri.  For $Conf{BlackoutWeekDays},
478 # 0 is Sunday, 1 is Monday etc.
479 #
480 $Conf{BlackoutHourBegin}    = 7.0;
481 $Conf{BlackoutHourEnd}      = 19.5;
482 $Conf{BlackoutWeekDays}     = [1, 2, 3, 4, 5];
483
484 ###########################################################################
485 # General per-PC configuration settings
486 # (can be overridden in the per-PC config.pl)
487 ###########################################################################
488 #
489 # What transport method to use to backup each host.  If you have
490 # a mixed set of WinXX and linux/unix hosts you will need to override
491 # this in the per-PC config.pl.
492 #
493 # The valid values are:
494 #
495 #   - 'smb': use smbclient and the SMB protocol.  Only choice for WinXX.
496 #
497 #   - 'tar': use tar, tar over ssh, rsh or nfs.  Best choice for
498 #            linux/unix.
499 #
500 # A future version should support 'rsync' as a transport method for
501 # more efficient backup of linux/unix machines (and perhaps WinXX??).
502 #
503 $Conf{XferMethod} = 'smb';
504
505 #
506 # Full path for smbclient. Security caution: normal users should not
507 # allowed to write to this file or directory.
508 #
509 # smbclient is from the Samba distribution. smbclient is used to
510 # actually extract the incremental or full dump of the share filesystem
511 # from the PC.
512 #
513 # This setting only matters if $Conf{XferMethod} = 'smb'.
514 #
515 $Conf{SmbClientPath} = '/usr/bin/smbclient';
516
517 #
518 # Additional optional arguments to smbclient.
519 #
520 # Some users have reported that the -b option can be used to improve
521 # performance of smbclient.  The default value is 4096, and if you
522 # find smbclient has low throughput you might try a value of 2048, eg:
523 #
524 #     $Conf{SmbClientArgs} = '-b 2048';
525 #
526 # This setting only matters if $Conf{XferMethod} = 'smb'.
527 #
528 $Conf{SmbClientArgs} = '';
529
530 #
531 # Full command to run tar on the client.  GNU tar is required.  You will
532 # need to fill in the correct paths for ssh2 on the local host (server)
533 # and GNU tar on the client.  Security caution: normal users should not
534 # allowed to write to these executable files or directories.
535 #
536 # See the documentation for more information about setting up ssh2 keys.
537 #
538 # If you plan to use NFS then tar just runs locally and ssh2 is not needed.
539 # For example, assuming the client filesystem is mounted below /mnt/hostName,
540 # you could use something like:
541 #
542 #    $Conf{TarClientCmd} = '$tarPath -c -v -f - -C /mnt/$host/$shareName'
543 #                        . ' --totals';
544 #
545 # In the case of NFS or rsh you need to make sure BackupPC's privileges
546 # are sufficient to read all the files you want to backup.  Also, you
547 # will probably want to add "/proc" to $Conf{BackupFilesExclude}.
548 #
549 # Several variables are substituted at run-time.  The following variables
550 # are substituted at run-time:
551 #
552 #   $host        host name
553 #   $hostIP      host's IP address
554 #   $incrDate    newer-than date for incremental backups
555 #   $shareName   share name to backup (ie: top-level directory path)
556 #   $fileList    specific files to backup or exclude
557 #   $tarPath     same as $Conf{TarClientPath}
558 #   $sshPath     same as $Conf{SshPath}
559 #
560 # If a variable is followed by a "+" it is shell escaped.  This is
561 # necessary for the command part of ssh or rsh, since it ends up
562 # getting passed through the shell.
563 #
564 # This setting only matters if $Conf{XferMethod} = 'tar'.
565 #
566 $Conf{TarClientCmd} = '$sshPath -q -n -l root $host'
567                     . ' $tarPath -c -v -f - -C $shareName+'
568                     . ' --totals';
569
570 #
571 # Extra tar arguments for full backups.  Several variables are substituted at
572 # run-time.  See $Conf{TarClientCmd} for the list of variable substitutions.
573 #
574 # This setting only matters if $Conf{XferMethod} = 'tar'.
575 #
576 $Conf{TarFullArgs} = '$fileList+';
577
578 #
579 # Extra tar arguments for incr backups.  Several variables are substituted at
580 # run-time.  See $Conf{TarClientCmd} for the list of variable substitutions.
581 #
582 # Note that GNU tar has several methods for specifying incremental backups,
583 # including:
584 #
585 #   --newer-mtime $incrDate+
586 #          This causes a file to be included if the modification time is
587 #          later than $incrDate (meaning its contents might have changed).
588 #          But changes in the ownership or modes will not qualify the
589 #          file to be included in an incremental.
590 #
591 #   --newer=$incrDate+
592 #          This causes the file to be included if any attribute of the
593 #          file is later than $incrDate, meaning either attributes or
594 #          the modification time.  This is the default method.  Do
595 #          not use --atime-preserve in $Conf{TarClientCmd} above,
596 #          otherwise resetting the atime (access time) counts as an
597 #          attribute change, meaning the file will always be included
598 #          in each new incremental dump.
599 #
600 # This setting only matters if $Conf{XferMethod} = 'tar'.
601 #
602 $Conf{TarIncrArgs} = '--newer=$incrDate+ $fileList+';
603
604 #
605 # Full command to run tar for restore on the client.  GNU tar is required.
606 # This can be the same as $Conf{TarClientCmd}, with tar's -c replaced by -x
607 # and ssh's -n removed.
608 #
609 # See $Conf{TarClientCmd} for full details.
610 #
611 # This setting only matters if $Conf{XferMethod} = "tar".
612 #
613 $Conf{TarClientRestoreCmd} = '$sshPath -q -l root $host'
614                    . ' $tarPath -x -p --numeric-owner --same-owner'
615                    . ' -v -f - -C $shareName+';
616
617 #
618 # Full path for tar on the client. Security caution: normal users should not
619 # allowed to write to this file or directory.
620 #
621 # This setting only matters if $Conf{XferMethod} = 'tar'.
622 #
623 $Conf{TarClientPath} = '/bin/tar';
624
625 #
626 # Path to rsync executable on the client
627 #
628 $Conf{RsyncClientPath} = '/bin/rsync';
629
630 #
631 # Full command to run rsync on the client machine
632 #
633 $Conf{RsyncClientCmd} = '$sshPath -q -l root $host $rsyncPath $argList';
634
635 #
636 # Full command to run rsync for restore on the client.
637 #
638 ## $Conf{RsyncClientRestoreCmd} = '';
639
640 #
641 # Share name to backup.  For $Conf{XferMethod} = "rsync" this should
642 # be a directory name, eg '/' or '/home'.  For $Conf{XferMethod} = "rsyncd"
643 # this should be the name of the module to backup (ie: the name from
644 # /etc/rsynd.conf).
645 #
646 $Conf{RsyncShareName} = '/';
647
648 #
649 # Rsync daemon port on the client, for $Conf{XferMethod} = "rsyncd".
650 #
651 $Conf{RsyncdClientPort} = 873;
652
653 #
654 # Key arguments to rsync server.  Do not edit these unless you
655 # have a very thorough understanding of how File::RsyncP works.
656 # Really, do not edit these.  See $Conf{RsyncClientArgs} instead.
657 #
658 $Conf{RsyncArgs} = [
659             #
660             # Do not edit these!
661             #
662             '--numeric-ids',
663             '--perms',
664             '--owner',
665             '--group',
666             '--devices',
667             '--links',
668             '--block-size=2048',
669             '--relative',
670             '--recursive',
671 ];
672
673 #
674 # Additional Rsync arguments that are given to the remote (client)
675 # rsync.  Unfortunately you need a pretty good understanding of
676 # File::RsyncP to know which arguments will work; not all will.
677 # Examples that should work are --exclude/--include, eg:
678 #
679 #   $Conf{RsyncClientArgs} = [
680 #           '--exclude', '*.tmp',
681 #   ];
682 #
683 $Conf{RsyncClientArgs} = [
684 ];
685
686 #
687 # Amount of verbosity in Rsync Xfer log files.  0 means be quiet,
688 # 1 will give some general information, 2 will give one line per file,
689 # 3 will include skipped files, higher values give more output.
690 # 10 will include byte dumps of all data read/written, which will
691 # make the log files huge.
692 #
693 $Conf{RsyncLogLevel} = 2;
694 #
695 # Full path for ssh. Security caution: normal users should not
696 # allowed to write to this file or directory.
697 #
698 $Conf{SshPath} = '/usr/bin/ssh';
699
700 #
701 # Full path for nmblookup. Security caution: normal users should not
702 # allowed to write to this file or directory.
703 #
704 # nmblookup is from the Samba distribution. nmblookup is used to get the
705 # netbios name, necessary for DHCP hosts.
706 #
707 $Conf{NmbLookupPath} = '/usr/bin/nmblookup';
708
709 #
710 # For fixed IP address hosts, BackupPC_dump can also verify the netbios
711 # name to ensure it matches the host name.  An error is generated if
712 # they do not match.  Typically this flag is off.  But if you are going
713 # to transition a bunch of machines from fixed host addresses to DHCP,
714 # setting this flag is a great way to verify that the machines have
715 # their netbios name set correctly before turning on DCHP.
716 #
717 $Conf{FixedIPNetBiosNameCheck} = 0;
718
719 #
720 # Full path to the ping command.  Security caution: normal users
721 # should not be allowed to write to this file or directory.
722 #
723 # If you want to disable ping checking, set this to some program
724 # that exits with 0 status, eg:
725 #
726 #     $Conf{PingPath} = '/bin/echo';
727 #
728 $Conf{PingPath} = '/bin/ping';
729
730 #
731 # Options for the ping command.
732 #
733 $Conf{PingArgs} = '-c 1 $host';
734
735 #
736 # Compression level to use on files.  0 means no compression.  Compression
737 # levels can be from 1 (least cpu time, slightly worse compression) to
738 # 9 (most cpu time, slightly better compression).  The recommended value
739 # is 3.  Changing to 5, for example, will take maybe 20% more cpu time
740 # and will get another 2-3% additional compression. See the zlib
741 # documentation for more information about compression levels.
742 #
743 # Changing compression on or off after backups have already been done
744 # will require both compressed and uncompressed pool files to be stored.
745 # This will increase the pool storage requirements, at least until all
746 # the old backups expire and are deleted.
747 #
748 # It is ok to change the compression value (from one non-zero value to
749 # another non-zero value) after dumps are already done.  Since BackupPC
750 # matches pool files by comparing the uncompressed versions, it will still
751 # correctly match new incoming files against existing pool files.  The
752 # new compression level will take effect only for new files that are
753 # newly compressed and added to the pool.
754 #
755 # If compression was off and you are enabling compression for the first
756 # time you can use the BackupPC_compressPool utility to compress the
757 # pool.  This avoids having the pool grow to accommodate both compressed
758 # and uncompressed backups.  See the documentation for more information.
759 #
760 # Note: compression needs the Compress::Zlib perl library.  If the
761 # Compress::Zlib library can't be found then $Conf{CompressLevel} is
762 # forced to 0 (compression off).
763 #
764 $Conf{CompressLevel} = 0;
765
766 #
767 # Maximum round-trip ping time in milliseconds.  This threshold is set
768 # to avoid backing up PCs that are remotely connected through WAN or
769 # dialup connections.  The output from ping -s (assuming it is supported
770 # on your system) is used to check the round-trip packet time.  On your
771 # local LAN round-trip times should be much less than 20msec.  On most
772 # WAN or dialup connections the round-trip time will be typically more
773 # than 20msec.  Tune if necessary.
774 #
775 $Conf{PingMaxMsec} = 20;
776
777 #
778 # Timeout in seconds when listening for the transport program's
779 # (smbclient, tar etc) stdout. If no output is received during this
780 # time, then it is assumed that something has wedged during a backup,
781 # and the backup is terminated.
782 #
783 # Note that stdout buffering combined with huge files being backed up
784 # could cause longish delays in the output from smbclient that
785 # BackupPC_dump sees, so in rare cases you might want to increase
786 # this value.
787 #
788 # Despite the name, this parameter sets the timeout for all transport
789 # methods (tar, smb etc).
790 #
791 $Conf{SmbClientTimeout} = 7200;
792
793 #
794 # Maximum number of log files we keep around in each PC's directory
795 # (ie: pc/$host).  These files are aged monthly.  A setting of 12
796 # means there will be at most the files LOG, LOG.0, LOG.1, ... LOG.11
797 # in the pc/$host directory (ie: about a years worth).  (Except this
798 # month's LOG, these files will have a .z extension if compression
799 # is on).
800 #
801 # If you decrease this number after BackupPC has been running for a
802 # while you will have to manually remove the older log files.
803 #
804 $Conf{MaxOldPerPCLogFiles} = 12;
805
806 ###########################################################################
807 # Email reminders, status and messages
808 # (can be overridden in the per-PC config.pl)
809 ###########################################################################
810 #
811 # Full path to the sendmail command.  Security caution: normal users
812 # should not allowed to write to this file or directory.
813 #
814 $Conf{SendmailPath} = '/usr/sbin/sendmail';
815
816 #
817 # Minimum period between consecutive emails to a single user.
818 # This tries to keep annoying email to users to a reasonable
819 # level.  Email checks are done nightly, so this number is effectively
820 # rounded up (ie: 2.5 means a user will never receive email more
821 # than once every 3 days).
822 #
823 $Conf{EMailNotifyMinDays} = 2.5;
824
825 #
826 # Name to use as the "from" name for email.  Depending upon your mail
827 # handler this is either a plain name (eg: "admin") or a fully-qualified
828 # name (eg: "admin@mydomain.com").
829 #
830 $Conf{EMailFromUserName} = '';
831
832 #
833 # Destination address to an administrative user who will receive a
834 # nightly email with warnings and errors.  If there are no warnings
835 # or errors then no email will be sent.  Depending upon your mail
836 # handler this is either a plain name (eg: "admin") or a fully-qualified
837 # name (eg: "admin@mydomain.com").
838 #
839 $Conf{EMailAdminUserName} = '';
840
841 #
842 # This message is sent to a user if their PC has never been backed up.
843 # If your mailer needs a fully-qualified To name, then change "$user"
844 # to "$user@mydomain.com" in the template, eg:
845 #
846 #       To: $user@mydomain.com
847 #
848 $Conf{EMailNoBackupEverMesg} = <<'EOF';
849 To: $user
850 cc:
851 Subject: $subj
852
853 Dear $userName,
854
855 Your PC ($host) has never been successfully backed up by our
856 PC backup software.  PC backups should occur automatically
857 when your PC is connected to the network.  You should contact
858 computer support if:
859
860   - Your PC has been regularly connected to the network, meaning
861     there is some configuration or setup problem preventing
862     backups from occurring.
863
864   - You don't want your PC backed up and you want these email
865     messages to stop.
866
867 Otherwise, please make sure your PC is connected to the network
868 next time you are in the office.
869
870 Regards,
871 BackupPC Genie
872 http://backuppc.sourceforge.net
873 EOF
874
875 #
876 # How old the most recent backup has to be before notifying user.
877 # When there have been no backups in this number of days the user
878 # is sent an email.
879 #
880 $Conf{EMailNotifyOldBackupDays} = 7.0;
881
882 #
883 # This message is sent to a user if their PC has not recently been
884 # backed up (ie: more than $Conf{EMailNotifyOldBackupDays} days ago).
885 #
886 # If your mailer needs a fully-qualified To name, then change "$user"
887 # to "$user@mydomain.com" in the template, eg:
888 #
889 #       To: $user@mydomain.com
890 #
891 $Conf{EMailNoBackupRecentMesg} = <<'EOF';
892 To: $user
893 cc:
894 Subject: $subj
895
896 Dear $userName,
897
898 Your PC ($host) has not been successfully backed up for $days days.
899 Your PC has been correctly backed up $numBackups times from $firstTime to $days days
900 ago.  PC backups should occur automatically when your PC is connected
901 to the network.
902
903 If your PC has been connected for more than a few hours to the
904 network during the last $days days you should contact IS to find
905 out why backups are not working.
906
907 Otherwise, if you are out of the office, there's not much you can
908 do, other than manually copying especially critical files to other
909 media.  You should be aware that any files you have created or
910 changed in the last $days days (including all new email and
911 attachments) cannot be restored if your PC disk crashes.
912
913 Regards,
914 BackupPC Genie
915 http://backuppc.sourceforge.net
916 EOF
917
918 #
919 # How old the most recent backup of Outlook files has to be before
920 # notifying user.
921 #
922 $Conf{EMailNotifyOldOutlookDays} = 5.0;
923
924 #
925 # This message is sent to a user if their Outlook files have not
926 # recently been backed up (ie: more than $Conf{EMailNotifyOldOutlookDays}
927 # days ago).
928 #
929 # If your mailer needs a fully-qualified To name, then change "$user"
930 # to "$user@mydomain.com" in the template, eg:
931 #
932 #       To: $user@mydomain.com
933 #
934 $Conf{EMailOutlookBackupMesg} = <<'EOF';
935 To: $user
936 cc:
937 Subject: $subj
938
939 Dear $userName,
940
941 The Outlook files on your PC have $howLong.
942 These files contain all your email, attachments, contact and calendar
943 information.  Your PC has been correctly backed up $numBackups times from
944 $firstTime to $lastTime days ago.  However, Outlook locks all its files when
945 it is running, preventing these files from being backed up.
946
947 It is recommended you backup the Outlook files when you are connected
948 to the network by exiting Outlook and all other applications, and,
949 using just your browser, go to this link:
950
951     http://myHost/cgi-bin/BackupPC_Admin?host=$host
952
953 Select "Start Incr Backup" twice to start a new incremental backup.
954 You can select "Return to $host page" and then hit "reload" to check
955 the status of the backup.  It should take just a few minutes to
956 complete.
957
958 Regards,
959 BackupPC Genie
960 http://backuppc.sourceforge.net
961 EOF
962
963 ###########################################################################
964 # CGI user interface configuration settings
965 # (can be overridden in the per-PC config.pl)
966 ###########################################################################
967 #
968 # Normal users can only access information specific to their host.
969 # They can start/stop/browse/restore backups.
970 #
971 # Administrative users have full access to all hosts, plus overall
972 # status and log information.
973 #
974 # The administrative users are the union of the unix/linux group
975 # $Conf{CgiAdminUserGroup} and the manual list of users, separated
976 # by spaces, in $Conf{CgiAdminUsers}. If you don't want a group or
977 # manual list of users set the corresponding configuration setting
978 # to undef or an empty string.
979 #
980 # If you want every user to have admin privileges (careful!), set
981 # $Conf{CgiAdminUsers} = '*'.
982 #
983 # Examples:
984 #    $Conf{CgiAdminUserGroup} = 'admin';
985 #    $Conf{CgiAdminUsers}     = 'craig celia';
986 #    --> administrative users are the union of group admin, plus
987 #      craig and celia.
988 #
989 #    $Conf{CgiAdminUserGroup} = '';
990 #    $Conf{CgiAdminUsers}     = 'craig celia';
991 #    --> administrative users are only craig and celia'.
992 #
993 $Conf{CgiAdminUserGroup} = '';
994 $Conf{CgiAdminUsers}     = '';
995
996 #   
997 # Language to use.  See lib/BackupPC/Lang for the list of supported
998 # languages, which includes English (en) and French (fr).  Currently
999 # this applies mainly to the CGI interface, but over time it might
1000 # also include log files and other text output.
1001 #
1002 $Conf{Language} = 'en';
1003
1004 #
1005 # User names that are rendered by the CGI interface can be turned
1006 # into links into their home page or other information about the
1007 # user.  To set this up you need to create two sprintf() strings,
1008 # that each contain a single '%s' that will be replaced by the user
1009 # name.  The default is a mailto: link.
1010 #
1011 # $Conf{CgiUserHomePageCheck} should be an absolute file path that
1012 # is used to check (via "-f") that the user has a valid home page.
1013 # Set this to undef or an empty string to turn off this check.
1014 #
1015 # $Conf{CgiUserUrlCreate} should be a full URL that points to the
1016 # user's home page.  Set this to undef or an empty string to turn
1017 # off generation of URLs for user names.
1018 #
1019 # Example:
1020 #    $Conf{CgiUserHomePageCheck} = '/var/www/html/users/%s.html';
1021 #    $Conf{CgiUserUrlCreate}     = 'http://myhost/users/%s.html';
1022 #    --> if /var/www/html/users/craig.html exists, then 'craig' will
1023 #      be rendered as a link to http://myhost/users/craig.html.
1024 #
1025 $Conf{CgiUserHomePageCheck} = '';
1026 $Conf{CgiUserUrlCreate}     = 'mailto:%s';
1027
1028 #
1029 # Date display format for CGI interface.  True for US-style dates (MM/DD)
1030 # and zero for international dates (DD/MM).
1031 #
1032 $Conf{CgiDateFormatMMDD} = 1;
1033
1034 #
1035 # If set, the complete list of hosts appears in the left navigation
1036 # bar for administrators.  Otherwise, just the hosts for which the
1037 # user is listed in the host file (as either the user or in moreUsers)
1038 # are displayed.
1039 #
1040 $Conf{CgiNavBarAdminAllHosts} = 0;
1041
1042 #
1043 # Header font and size for CGI interface
1044 #
1045 $Conf{CgiHeaderFontType} = 'arial';
1046 $Conf{CgiHeaderFontSize} = '3';
1047
1048 #
1049 # Color scheme for CGI interface.  Default values give a very light blue
1050 # for the background navigation color, green for the header background,
1051 # and white for the body background.  (You call tell I should stick to
1052 # programming and not graphical design.)
1053 #
1054 $Conf{CgiNavBarBgColor} = '#ddeeee';
1055 $Conf{CgiHeaderBgColor} = '#99cc33';
1056 $Conf{CgiBodyBgColor}   = '#ffffff';
1057
1058 #
1059 # Additional CGI header text.  For example, if you wanted each CGI page
1060 # to auto refresh every 900 seconds, you could add this text:
1061 #
1062 #       <meta http-equiv="refresh" content="900">
1063 #
1064 $Conf{CgiHeaders} = '<meta http-equiv="pragma" content="no-cache">';
1065
1066 #
1067 # Directory where images are stored.  This directory should be below
1068 # Apache's DocumentRoot.  This value isn't used by BackupPC but is
1069 # used by configure.pl when you upgrade BackupPC.
1070 #
1071 # Example:
1072 #     $Conf{CgiImageDir} = '/usr/local/apache/htdocs/BackupPC';
1073 #
1074 $Conf{CgiImageDir} = '';
1075
1076 #
1077 # Additional mappings of file name extenions to Content-Type for
1078 # individual file restore.  See $Ext2ContentType in BackupPC_Admin
1079 # for the default setting.  You can add additional settings here,
1080 # or override any default settings.  Example:
1081 #
1082 #     $Conf{CgiExt2ContentType} = {
1083 #                 'pl'  => 'text/plain',
1084 #          };
1085 #
1086 $Conf{CgiExt2ContentType} = { };
1087
1088 #
1089 # URL (without the leading http://host) for BackupPC's image directory.
1090 # The CGI script uses this value to serve up image files.
1091 #
1092 # Example:
1093 #     $Conf{CgiImageDirURL} = '/BackupPC';
1094 #
1095 $Conf{CgiImageDirURL} = '';