git mv BackupPC_burnArchiveCLI BackupPC_ASA_BurnArchiveMedia
[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-2009  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 maximize 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} = [2,4,6,8,10,12,14,16,18,20,22];  # every 2 hours
107 #
108 # The default value is every hour except midnight.
109 #
110 # The first entry of $Conf{WakeupSchedule} is when BackupPC_nightly is run.
111 # You might want to re-arrange the entries in $Conf{WakeupSchedule}
112 # (they don't have to be ascending) so that the first entry is when
113 # you want BackupPC_nightly to run (eg: when you don't expect a lot
114 # of regular backups to run).
115 #
116 $Conf{WakeupSchedule} = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23];
117
118 #
119 # Maximum number of simultaneous backups to run.  If there
120 # are no user backup requests then this is the maximum number
121 # of simultaneous backups.
122 #
123 $Conf{MaxBackups} = 4;
124
125 #
126 # Additional number of simultaneous backups that users can run.
127 # As many as $Conf{MaxBackups} + $Conf{MaxUserBackups} requests can
128 # run at the same time.
129 #
130 $Conf{MaxUserBackups} = 4;
131
132 #
133 # Maximum number of pending link commands. New backups will only be
134 # started if there are no more than $Conf{MaxPendingCmds} plus
135 # $Conf{MaxBackups} number of pending link commands, plus running jobs.
136 # This limit is to make sure BackupPC doesn't fall too far behind in
137 # running BackupPC_link commands.
138 #
139 $Conf{MaxPendingCmds} = 15;
140
141 #
142 # Nice level at which CmdQueue commands (eg: BackupPC_link and
143 # BackupPC_nightly) are run at.
144 #
145 $Conf{CmdQueueNice} = 10;
146
147 #
148 # How many BackupPC_nightly processes to run in parallel.
149 #
150 # Each night, at the first wakeup listed in $Conf{WakeupSchedule},
151 # BackupPC_nightly is run.  Its job is to remove unneeded files
152 # in the pool, ie: files that only have one link.  To avoid race
153 # conditions, BackupPC_nightly and BackupPC_link cannot run at
154 # the same time.  Starting in v3.0.0, BackupPC_nightly can run
155 # concurrently with backups (BackupPC_dump).
156 #
157 # So to reduce the elapsed time, you might want to increase this
158 # setting to run several BackupPC_nightly processes in parallel
159 # (eg: 4, or even 8).
160 #
161 $Conf{MaxBackupPCNightlyJobs} = 2;
162
163 #
164 # How many days (runs) it takes BackupPC_nightly to traverse the
165 # entire pool.  Normally this is 1, which means every night it runs,
166 # it does traverse the entire pool removing unused pool files.
167 #
168 # Other valid values are 2, 4, 8, 16.  This causes BackupPC_nightly to
169 # traverse 1/2, 1/4, 1/8 or 1/16th of the pool each night, meaning it
170 # takes 2, 4, 8 or 16 days to completely traverse the pool.  The
171 # advantage is that each night the running time of BackupPC_nightly
172 # is reduced roughly in proportion, since the total job is split
173 # over multiple days.  The disadvantage is that unused pool files
174 # take longer to get deleted, which will slightly increase disk
175 # usage.
176 #
177 # Note that even when $Conf{BackupPCNightlyPeriod} > 1, BackupPC_nightly
178 # still runs every night.  It just does less work each time it runs.
179 #
180 # Examples:
181 #
182 #    $Conf{BackupPCNightlyPeriod} = 1;   # entire pool is checked every night
183 #
184 #    $Conf{BackupPCNightlyPeriod} = 2;   # two days to complete pool check
185 #                                        # (different half each night)
186 #
187 #    $Conf{BackupPCNightlyPeriod} = 4;   # four days to complete pool check
188 #                                        # (different quarter each night)
189 #
190 $Conf{BackupPCNightlyPeriod} = 1;
191
192 #
193 # Maximum number of log files we keep around in log directory.
194 # These files are aged nightly.  A setting of 14 means the log
195 # directory will contain about 2 weeks of old log files, in
196 # particular at most the files LOG, LOG.0, LOG.1, ... LOG.13
197 # (except today's LOG, these files will have a .z extension if
198 # compression is on).
199 #
200 # If you decrease this number after BackupPC has been running for a
201 # while you will have to manually remove the older log files.
202 #
203 $Conf{MaxOldLogFiles} = 14;
204
205 #
206 # Full path to the df command.  Security caution: normal users
207 # should not allowed to write to this file or directory.
208 #
209 $Conf{DfPath} = '';
210
211 #
212 # Command to run df.  The following variables are substituted at run-time:
213 #
214 #   $dfPath      path to df ($Conf{DfPath})
215 #   $topDir      top-level BackupPC data directory
216 #
217 # Note: all Cmds are executed directly without a shell, so the prog name
218 # needs to be a full path and you can't include shell syntax like
219 # redirection and pipes; put that in a script if you need it.
220 #
221 $Conf{DfCmd} = '$dfPath $topDir';
222
223 #
224 # Full path to various commands for archiving
225 #
226 $Conf{SplitPath} = '';
227 $Conf{ParPath}   = '';
228 $Conf{CatPath}   = '';
229 $Conf{GzipPath}  = '';
230 $Conf{Bzip2Path} = '';
231
232 #
233 # Maximum threshold for disk utilization on the __TOPDIR__ filesystem.
234 # If the output from $Conf{DfPath} reports a percentage larger than
235 # this number then no new regularly scheduled backups will be run.
236 # However, user requested backups (which are usually incremental and
237 # tend to be small) are still performed, independent of disk usage.
238 # Also, currently running backups will not be terminated when the disk
239 # usage exceeds this number.
240 #
241 $Conf{DfMaxUsagePct} = 95;
242
243 #
244 # How long BackupPC_trashClean sleeps in seconds between each check
245 # of the trash directory.  Once every 5 minutes should be reasonable.
246 #
247 $Conf{TrashCleanSleepSec} = 300;
248
249 #
250 # List of DHCP address ranges we search looking for PCs to backup.
251 # This is an array of hashes for each class C address range.
252 # This is only needed if hosts in the conf/hosts file have the
253 # dhcp flag set.
254 #
255 # Examples:
256 #    # to specify 192.10.10.20 to 192.10.10.250 as the DHCP address pool
257 #    $Conf{DHCPAddressRanges} = [
258 #        {
259 #            ipAddrBase => '192.10.10',
260 #            first => 20,
261 #            last  => 250,
262 #        },
263 #    ];
264 #    # to specify two pools (192.10.10.20-250 and 192.10.11.10-50)
265 #    $Conf{DHCPAddressRanges} = [
266 #        {
267 #            ipAddrBase => '192.10.10',
268 #            first => 20,
269 #            last  => 250,
270 #        },
271 #        {
272 #            ipAddrBase => '192.10.11',
273 #            first => 10,
274 #            last  => 50,
275 #        },
276 #    ];
277 #
278 $Conf{DHCPAddressRanges} = [];
279
280 #
281 # The BackupPC user.
282 #
283 $Conf{BackupPCUser} = '';
284
285 #
286 # Important installation directories:
287 #
288 #   TopDir     - where all the backup data is stored
289 #   ConfDir    - where the main config and hosts files resides
290 #   LogDir     - where log files and other transient information
291 #   InstallDir - where the bin, lib and doc installation dirs reside.
292 #                Note: you cannot change this value since all the
293 #                perl scripts include this path.  You must reinstall
294 #                with configure.pl to change InstallDir.
295 #   CgiDir     - Apache CGI directory for BackupPC_Admin
296 #
297 # Note: it is STRONGLY recommended that you don't change the
298 # values here.  These are set at installation time and are here
299 # for reference and are used during upgrades.
300 #
301 # Instead of changing TopDir here it is recommended that you use
302 # a symbolic link to the new location, or mount the new BackupPC
303 # store at the existing $Conf{TopDir} setting.
304 #
305 $Conf{TopDir}      = '';
306 $Conf{ConfDir}     = '';
307 $Conf{LogDir}      = '';
308 $Conf{InstallDir}  = '';
309 $Conf{CgiDir}      = '';
310
311 #
312 # Whether BackupPC and the CGI script BackupPC_Admin verify that they
313 # are really running as user $Conf{BackupPCUser}.  If this flag is set
314 # and the effective user id (euid) differs from $Conf{BackupPCUser}
315 # then both scripts exit with an error.  This catches cases where
316 # BackupPC might be accidently started as root or the wrong user,
317 # or if the CGI script is not installed correctly.
318 #
319 $Conf{BackupPCUserVerify} = 1;
320
321 #
322 # Maximum number of hardlinks supported by the $TopDir file system
323 # that BackupPC uses.  Most linux or unix file systems should support
324 # at least 32000 hardlinks per file, or 64000 in other cases.  If a pool
325 # file already has this number of hardlinks, a new pool file is created
326 # so that new hardlinks can be accommodated.  This limit will only
327 # be hit if an identical file appears at least this number of times
328 # across all the backups.
329 #
330 $Conf{HardLinkMax} = 31999;
331
332 #
333 # Advanced option for asking BackupPC to load additional perl modules.
334 # Can be a list (array ref) of module names to load at startup.
335 #
336 $Conf{PerlModuleLoad}     = undef;
337
338 #
339 # Path to init.d script and command to use that script to start the
340 # server from the CGI interface.  The following variables are substituted
341 # at run-time:
342 #
343 #   $sshPath           path to ssh ($Conf{SshPath})
344 #   $serverHost        same as $Conf{ServerHost}
345 #   $serverInitdPath   path to init.d script ($Conf{ServerInitdPath})
346 #
347 # Example:
348 #
349 # $Conf{ServerInitdPath}     = '/etc/init.d/backuppc';
350 # $Conf{ServerInitdStartCmd} = '$sshPath -q -x -l root $serverHost'
351 #                            . ' $serverInitdPath start'
352 #                            . ' < /dev/null >& /dev/null';
353 #
354 # Note: all Cmds are executed directly without a shell, so the prog name
355 # needs to be a full path and you can't include shell syntax like
356 # redirection and pipes; put that in a script if you need it.
357 #
358 $Conf{ServerInitdPath} = '';
359 $Conf{ServerInitdStartCmd} = '';
360
361
362 ###########################################################################
363 # What to backup and when to do it
364 # (can be overridden in the per-PC config.pl)
365 ###########################################################################
366 #
367 # Minimum period in days between full backups. A full dump will only be
368 # done if at least this much time has elapsed since the last full dump,
369 # and at least $Conf{IncrPeriod} days has elapsed since the last
370 # successful dump.
371 #
372 # Typically this is set slightly less than an integer number of days. The
373 # time taken for the backup, plus the granularity of $Conf{WakeupSchedule}
374 # will make the actual backup interval a bit longer.
375 #
376 $Conf{FullPeriod} = 6.97;
377
378 #
379 # Minimum period in days between incremental backups (a user requested
380 # incremental backup will be done anytime on demand).
381 #
382 # Typically this is set slightly less than an integer number of days. The
383 # time taken for the backup, plus the granularity of $Conf{WakeupSchedule}
384 # will make the actual backup interval a bit longer.
385 #
386 $Conf{IncrPeriod} = 0.97;
387
388 #
389 # Number of full backups to keep.  Must be >= 1.
390 #
391 # In the steady state, each time a full backup completes successfully
392 # the oldest one is removed.  If this number is decreased, the
393 # extra old backups will be removed.
394 #
395 # If filling of incremental dumps is off the oldest backup always
396 # has to be a full (ie: filled) dump.  This might mean one or two
397 # extra full dumps are kept until the oldest incremental backups expire.
398 #
399 # Exponential backup expiry is also supported.  This allows you to specify:
400 #
401 #   - num fulls to keep at intervals of 1 * $Conf{FullPeriod}, followed by
402 #   - num fulls to keep at intervals of 2 * $Conf{FullPeriod},
403 #   - num fulls to keep at intervals of 4 * $Conf{FullPeriod},
404 #   - num fulls to keep at intervals of 8 * $Conf{FullPeriod},
405 #   - num fulls to keep at intervals of 16 * $Conf{FullPeriod},
406 #
407 # and so on.  This works by deleting every other full as each expiry
408 # boundary is crossed.
409 #
410 # Exponential expiry is specified using an array for $Conf{FullKeepCnt}:
411 #
412 #   $Conf{FullKeepCnt} = [4, 2, 3];
413 #
414 # Entry #n specifies how many fulls to keep at an interval of
415 # 2^n * $Conf{FullPeriod} (ie: 1, 2, 4, 8, 16, 32, ...).
416 #
417 # The example above specifies keeping 4 of the most recent full backups
418 # (1 week interval) two full backups at 2 week intervals, and 3 full
419 # backups at 4 week intervals, eg:
420 #
421 #    full 0 19 weeks old   \
422 #    full 1 15 weeks old    >---  3 backups at 4 * $Conf{FullPeriod}
423 #    full 2 11 weeks old   / 
424 #    full 3  7 weeks old   \____  2 backups at 2 * $Conf{FullPeriod}
425 #    full 4  5 weeks old   /
426 #    full 5  3 weeks old   \
427 #    full 6  2 weeks old    \___  4 backups at 1 * $Conf{FullPeriod}
428 #    full 7  1 week old     /
429 #    full 8  current       /
430 #
431 # On a given week the spacing might be less than shown as each backup
432 # ages through each expiry period.  For example, one week later, a
433 # new full is completed and the oldest is deleted, giving:
434 #
435 #    full 0 16 weeks old   \
436 #    full 1 12 weeks old    >---  3 backups at 4 * $Conf{FullPeriod}
437 #    full 2  8 weeks old   / 
438 #    full 3  6 weeks old   \____  2 backups at 2 * $Conf{FullPeriod}
439 #    full 4  4 weeks old   /
440 #    full 5  3 weeks old   \
441 #    full 6  2 weeks old    \___  4 backups at 1 * $Conf{FullPeriod}
442 #    full 7  1 week old     /
443 #    full 8  current       /
444 #
445 # You can specify 0 as a count (except in the first entry), and the
446 # array can be as long as you wish.  For example:
447 #
448 #   $Conf{FullKeepCnt} = [4, 0, 4, 0, 0, 2];
449 #
450 # This will keep 10 full dumps, 4 most recent at 1 * $Conf{FullPeriod},
451 # followed by 4 at an interval of 4 * $Conf{FullPeriod} (approx 1 month
452 # apart), and then 2 at an interval of 32 * $Conf{FullPeriod} (approx
453 # 7-8 months apart).
454 #
455 # Example: these two settings are equivalent and both keep just
456 # the four most recent full dumps:
457 #
458 #    $Conf{FullKeepCnt} = 4;
459 #    $Conf{FullKeepCnt} = [4];
460 #
461 $Conf{FullKeepCnt} = 1;
462
463 #
464 # Very old full backups are removed after $Conf{FullAgeMax} days.  However,
465 # we keep at least $Conf{FullKeepCntMin} full backups no matter how old
466 # they are.
467 #
468 # Note that $Conf{FullAgeMax} will be increased to $Conf{FullKeepCnt}
469 # times $Conf{FullPeriod} if $Conf{FullKeepCnt} specifies enough
470 # full backups to exceed $Conf{FullAgeMax}.
471 #
472 $Conf{FullKeepCntMin} = 1;
473 $Conf{FullAgeMax}     = 90;
474
475 #
476 # Number of incremental backups to keep.  Must be >= 1.
477 #
478 # In the steady state, each time an incr backup completes successfully
479 # the oldest one is removed.  If this number is decreased, the
480 # extra old backups will be removed.
481 #
482 $Conf{IncrKeepCnt} = 6;
483
484 #
485 # Very old incremental backups are removed after $Conf{IncrAgeMax} days.
486 # However, we keep at least $Conf{IncrKeepCntMin} incremental backups no
487 # matter how old they are.
488 #
489 $Conf{IncrKeepCntMin} = 1;
490 $Conf{IncrAgeMax}     = 30;
491
492 #
493 # Level of each incremental.  "Level" follows the terminology
494 # of dump(1).  A full backup has level 0.  A new incremental
495 # of level N will backup all files that have changed since
496 # the most recent backup of a lower level.
497 #
498 # The entries of $Conf{IncrLevels} apply in order to each
499 # incremental after each full backup.  It wraps around until
500 # the next full backup.  For example, these two settings
501 # have the same effect:
502 #
503 #       $Conf{IncrLevels} = [1, 2, 3];
504 #       $Conf{IncrLevels} = [1, 2, 3, 1, 2, 3];
505 #
506 # This means the 1st and 4th incrementals (level 1) go all
507 # the way back to the full.  The 2nd and 3rd (and 5th and
508 # 6th) backups just go back to the immediate preceeding
509 # incremental.
510 #
511 # Specifying a sequence of multi-level incrementals will
512 # usually mean more than $Conf{IncrKeepCnt} incrementals will
513 # need to be kept, since lower level incrementals are needed
514 # to merge a complete view of a backup.  For example, with
515 #
516 #       $Conf{FullPeriod}  = 7;
517 #       $Conf{IncrPeriod}  = 1;
518 #       $Conf{IncrKeepCnt} = 6;
519 #       $Conf{IncrLevels}  = [1, 2, 3, 4, 5, 6];
520 #
521 # there will be up to 11 incrementals in this case: 
522 #
523 #       backup #0  (full, level 0, oldest)
524 #       backup #1  (incr, level 1)
525 #       backup #2  (incr, level 2)
526 #       backup #3  (incr, level 3)
527 #       backup #4  (incr, level 4)
528 #       backup #5  (incr, level 5)
529 #       backup #6  (incr, level 6)
530 #       backup #7  (full, level 0)
531 #       backup #8  (incr, level 1)
532 #       backup #9  (incr, level 2)
533 #       backup #10 (incr, level 3)
534 #       backup #11 (incr, level 4)
535 #       backup #12 (incr, level 5, newest)
536 #
537 # Backup #1 (the oldest level 1 incremental) can't be deleted
538 # since backups 2..6 depend on it.  Those 6 incrementals can't
539 # all be deleted since that would only leave 5 (#8..12).
540 # When the next incremental happens (level 6), the complete
541 # set of 6 older incrementals (#1..6) will be deleted, since
542 # that maintains the required number ($Conf{IncrKeepCnt})
543 # of incrementals.  This situation is reduced if you set
544 # shorter chains of multi-level incrementals, eg:
545 #
546 #       $Conf{IncrLevels}  = [1, 2, 3];
547 #
548 # would only have up to 2 extra incremenals before all 3
549 # are deleted.
550 #
551 # BackupPC as usual merges the full and the sequence
552 # of incrementals together so each incremental can be
553 # browsed and restored as though it is a complete backup.
554 # If you specify a long chain of incrementals then more
555 # backups need to be merged when browsing, restoring,
556 # or getting the starting point for rsync backups.
557 # In the example above (levels 1..6), browing backup
558 # #6 requires 7 different backups (#0..6) to be merged.
559 #
560 # Because of this merging and the additional incrementals
561 # that need to be kept, it is recommended that some
562 # level 1 incrementals be included in $Conf{IncrLevels}.
563 #
564 # Prior to version 3.0 incrementals were always level 1,
565 # meaning each incremental backed up all the files that
566 # changed since the last full.
567 #
568 $Conf{IncrLevels} = [1];
569
570 #
571 # Disable all full and incremental backups.  These settings are
572 # useful for a client that is no longer being backed up
573 # (eg: a retired machine), but you wish to keep the last
574 # backups available for browsing or restoring to other machines.
575 #
576 # There are three values for $Conf{BackupsDisable}:
577 #
578 #   0    Backups are enabled.
579 #
580 #   1    Don't do any regular backups on this client.  Manually
581 #        requested backups (via the CGI interface) will still occur.
582 #
583 #   2    Don't do any backups on this client.  Manually requested
584 #        backups (via the CGI interface) will be ignored.
585 #
586 # In versions prior to 3.0 Backups were disabled by setting
587 # $Conf{FullPeriod} to -1 or -2.
588 #
589 $Conf{BackupsDisable} = 0;
590
591 #
592 # A failed full backup is saved as a partial backup.  The rsync
593 # XferMethod can take advantage of the partial full when the next
594 # backup is run. This parameter sets the age of the partial full
595 # in days: if the partial backup is older than this number of
596 # days, then rsync will ignore (not use) the partial full when
597 # the next backup is run.  If you set this to a negative value
598 # then no partials will be saved.  If you set this to 0, partials
599 # will be saved, but will not be used by the next backup.
600 #
601 # The default setting of 3 days means that a partial older than
602 # 3 days is ignored when the next full backup is done.
603 #
604 $Conf{PartialAgeMax} = 3;
605
606 #
607 # Whether incremental backups are filled.  "Filling" means that the
608 # most recent full (or filled) dump is merged into the new incremental
609 # dump using hardlinks.  This makes an incremental dump look like a
610 # full dump.  Prior to v1.03 all incremental backups were filled.
611 # In v1.4.0 and later the default is off.
612 #
613 # BackupPC, and the cgi interface in particular, do the right thing on
614 # un-filled incremental backups.  It will correctly display the merged
615 # incremental backup with the most recent filled backup, giving the
616 # un-filled incremental backups a filled appearance.  That means it
617 # invisible to the user whether incremental dumps are filled or not.
618 #
619 # Filling backups takes a little extra disk space, and it does cost
620 # some extra disk activity for filling, and later removal.  Filling
621 # is no longer useful, since file mangling and compression doesn't
622 # make a filled backup very useful. It's likely the filling option
623 # will be removed from future versions: filling will be delegated to
624 # the display and extraction of backup data.
625 #
626 # If filling is off, BackupPC makes sure that the oldest backup is
627 # a full, otherwise the following incremental backups will be
628 # incomplete.  This might mean an extra full backup has to be
629 # kept until the following incremental backups expire.
630 #
631 # The default is off.  You can turn this on or off at any
632 # time without affecting existing backups.
633 #
634 $Conf{IncrFill} = 0;
635
636 #
637 # Number of restore logs to keep.  BackupPC remembers information about
638 # each restore request.  This number per client will be kept around before
639 # the oldest ones are pruned.
640 #
641 # Note: files/dirs delivered via Zip or Tar downloads don't count as
642 # restores.  Only the first restore option (where the files and dirs
643 # are written to the host) count as restores that are logged.
644 #
645 $Conf{RestoreInfoKeepCnt} = 10;
646
647 #
648 # Number of archive logs to keep.  BackupPC remembers information
649 # about each archive request.  This number per archive client will
650 # be kept around before the oldest ones are pruned.
651 #
652 $Conf{ArchiveInfoKeepCnt} = 10;
653
654 #
655 # List of directories or files to backup.  If this is defined, only these
656 # directories or files will be backed up.
657 #
658 # For Smb, only one of $Conf{BackupFilesExclude} and $Conf{BackupFilesOnly}
659 # can be specified per share. If both are set for a particular share, then
660 # $Conf{BackupFilesOnly} takes precedence and $Conf{BackupFilesExclude}
661 # is ignored.
662 #
663 # This can be set to a string, an array of strings, or, in the case
664 # of multiple shares, a hash of strings or arrays.  A hash is used
665 # to give a list of directories or files to backup for each share
666 # (the share name is the key).  If this is set to just a string or
667 # array, and $Conf{SmbShareName} contains multiple share names, then
668 # the setting is assumed to apply all shares.
669 #
670 # If a hash is used, a special key "*" means it applies to all
671 # shares that don't have a specific entry.
672 #
673 # Examples:
674 #    $Conf{BackupFilesOnly} = '/myFiles';
675 #    $Conf{BackupFilesOnly} = ['/myFiles'];     # same as first example
676 #    $Conf{BackupFilesOnly} = ['/myFiles', '/important'];
677 #    $Conf{BackupFilesOnly} = {
678 #       'c' => ['/myFiles', '/important'],      # these are for 'c' share
679 #       'd' => ['/moreFiles', '/archive'],      # these are for 'd' share
680 #    };
681 #    $Conf{BackupFilesOnly} = {
682 #       'c' => ['/myFiles', '/important'],      # these are for 'c' share
683 #       '*' => ['/myFiles', '/important'],      # these are other shares
684 #    };
685 #
686 $Conf{BackupFilesOnly} = undef;
687
688 #
689 # List of directories or files to exclude from the backup.  For Smb,
690 # only one of $Conf{BackupFilesExclude} and $Conf{BackupFilesOnly}
691 # can be specified per share.  If both are set for a particular share,
692 # then $Conf{BackupFilesOnly} takes precedence and
693 # $Conf{BackupFilesExclude} is ignored.
694 #
695 # This can be set to a string, an array of strings, or, in the case
696 # of multiple shares, a hash of strings or arrays.  A hash is used
697 # to give a list of directories or files to exclude for each share
698 # (the share name is the key).  If this is set to just a string or
699 # array, and $Conf{SmbShareName} contains multiple share names, then
700 # the setting is assumed to apply to all shares.
701 #
702 # The exact behavior is determined by the underlying transport program,
703 # smbclient or tar.  For smbclient the exlclude file list is passed into
704 # the X option.  Simple shell wild-cards using "*" or "?" are allowed.
705 #
706 # For tar, if the exclude file contains a "/" it is assumed to be anchored
707 # at the start of the string.  Since all the tar paths start with "./",
708 # BackupPC prepends a "." if the exclude file starts with a "/".  Note
709 # that GNU tar version >= 1.13.7 is required for the exclude option to
710 # work correctly.  For linux or unix machines you should add
711 # "/proc" to $Conf{BackupFilesExclude} unless you have specified
712 # --one-file-system in $Conf{TarClientCmd} or --one-file-system in
713 # $Conf{RsyncArgs}.  Also, for tar, do not use a trailing "/" in
714 # the directory name: a trailing "/" causes the name to not match
715 # and the directory will not be excluded.
716 #
717 # Users report that for smbclient you should specify a directory
718 # followed by "/*", eg: "/proc/*", instead of just "/proc".
719 #
720 # FTP servers are traversed recursively so excluding directories will
721 # also exclude its contents.  You can use the wildcard characters "*"
722 # and "?" to define files for inclusion and exclusion.  Both
723 # attributes $Conf{BackupFilesOnly} and $Conf{BackupFilesExclude} can
724 # be defined for the same share.
725 #
726 # If a hash is used, a special key "*" means it applies to all
727 # shares that don't have a specific entry.
728 #
729 # Examples:
730 #    $Conf{BackupFilesExclude} = '/temp';
731 #    $Conf{BackupFilesExclude} = ['/temp'];     # same as first example
732 #    $Conf{BackupFilesExclude} = ['/temp', '/winnt/tmp'];
733 #    $Conf{BackupFilesExclude} = {
734 #       'c' => ['/temp', '/winnt/tmp'],         # these are for 'c' share
735 #       'd' => ['/junk', '/dont_back_this_up'], # these are for 'd' share
736 #    };
737 #    $Conf{BackupFilesExclude} = {
738 #       'c' => ['/temp', '/winnt/tmp'],         # these are for 'c' share
739 #       '*' => ['/junk', '/dont_back_this_up'], # these are for other shares
740 #    };
741 #
742 $Conf{BackupFilesExclude} = undef;
743
744 #
745 # PCs that are always or often on the network can be backed up after
746 # hours, to reduce PC, network and server load during working hours. For
747 # each PC a count of consecutive good pings is maintained. Once a PC has
748 # at least $Conf{BlackoutGoodCnt} consecutive good pings it is subject
749 # to "blackout" and not backed up during hours and days specified by
750 # $Conf{BlackoutPeriods}.
751 #
752 # To allow for periodic rebooting of a PC or other brief periods when a
753 # PC is not on the network, a number of consecutive bad pings is allowed
754 # before the good ping count is reset. This parameter is
755 # $Conf{BlackoutBadPingLimit}.
756 #
757 # Note that bad and good pings don't occur with the same interval. If a
758 # machine is always on the network, it will only be pinged roughly once
759 # every $Conf{IncrPeriod} (eg: once per day). So a setting for
760 # $Conf{BlackoutGoodCnt} of 7 means it will take around 7 days for a
761 # machine to be subject to blackout. On the other hand, if a ping is
762 # failed, it will be retried roughly every time BackupPC wakes up, eg,
763 # every one or two hours. So a setting for $Conf{BlackoutBadPingLimit} of
764 # 3 means that the PC will lose its blackout status after 3-6 hours of
765 # unavailability.
766 #
767 # To disable the blackout feature set $Conf{BlackoutGoodCnt} to a negative
768 # value.  A value of 0 will make all machines subject to blackout.  But
769 # if you don't want to do any backups during the day it would be easier
770 # to just set $Conf{WakeupSchedule} to a restricted schedule.
771 #
772 $Conf{BlackoutBadPingLimit} = 3;
773 $Conf{BlackoutGoodCnt}      = 7;
774
775 #
776 # One or more blackout periods can be specified.  If a client is
777 # subject to blackout then no regular (non-manual) backups will
778 # be started during any of these periods.  hourBegin and hourEnd
779 # specify hours fro midnight and weekDays is a list of days of
780 # the week where 0 is Sunday, 1 is Monday etc.
781 #
782 # For example:
783 #
784 #    $Conf{BlackoutPeriods} = [
785 #       {
786 #           hourBegin =>  7.0,
787 #           hourEnd   => 19.5,
788 #           weekDays  => [1, 2, 3, 4, 5],
789 #       },
790 #    ];
791 #
792 # specifies one blackout period from 7:00am to 7:30pm local time
793 # on Mon-Fri.
794 #
795 # The blackout period can also span midnight by setting
796 # hourBegin > hourEnd, eg:
797 #
798 #    $Conf{BlackoutPeriods} = [
799 #       {
800 #           hourBegin =>  7.0,
801 #           hourEnd   => 19.5,
802 #           weekDays  => [1, 2, 3, 4, 5],
803 #       },
804 #       {
805 #           hourBegin => 23,
806 #           hourEnd   =>  5,
807 #           weekDays  => [5, 6],
808 #       },
809 #    ];
810 #
811 # This specifies one blackout period from 7:00am to 7:30pm local time
812 # on Mon-Fri, and a second period from 11pm to 5am on Friday and
813 # Saturday night.
814 #
815 $Conf{BlackoutPeriods} = [
816     {
817         hourBegin =>  7.0,
818         hourEnd   => 19.5,
819         weekDays  => [1, 2, 3, 4, 5],
820     },
821 ];
822
823 #
824 # A backup of a share that has zero files is considered fatal. This is
825 # used to catch miscellaneous Xfer errors that result in no files being
826 # backed up.  If you have shares that might be empty (and therefore an
827 # empty backup is valid) you should set this flag to 0.
828 #
829 $Conf{BackupZeroFilesIsFatal} = 1;
830
831 ###########################################################################
832 # How to backup a client
833 # (can be overridden in the per-PC config.pl)
834 ###########################################################################
835 #
836 # What transport method to use to backup each host.  If you have
837 # a mixed set of WinXX and linux/unix hosts you will need to override
838 # this in the per-PC config.pl.
839 #
840 # The valid values are:
841 #
842 #   - 'smb':     backup and restore via smbclient and the SMB protocol.
843 #                Easiest choice for WinXX.
844 #
845 #   - 'rsync':   backup and restore via rsync (via rsh or ssh).
846 #                Best choice for linux/unix.  Good choice also for WinXX.
847 #
848 #   - 'rsyncd':  backup and restore via rsync daemon on the client.
849 #                Best choice for linux/unix if you have rsyncd running on
850 #                the client.  Good choice also for WinXX.
851 #
852 #   - 'tar':    backup and restore via tar, tar over ssh, rsh or nfs.
853 #               Good choice for linux/unix.
854 #
855 #   - 'archive': host is a special archive host.  Backups are not done.
856 #                An archive host is used to archive other host's backups
857 #                to permanent media, such as tape, CDR or DVD.
858 #               
859 #
860 $Conf{XferMethod} = 'smb';
861
862 #
863 # Level of verbosity in Xfer log files.  0 means be quiet, 1 will give
864 # will give one line per file, 2 will also show skipped files on
865 # incrementals, higher values give more output.
866 #
867 $Conf{XferLogLevel} = 1;
868
869 #
870 # Filename charset encoding on the client.  BackupPC uses utf8
871 # on the server for filename encoding.  If this is empty, then
872 # utf8 is assumed and client filenames will not be modified.
873 # If set to a different encoding then filenames will converted
874 # to/from utf8 automatically during backup and restore.
875 #
876 # If the file names displayed in the browser (eg: accents or special
877 # characters) don't look right then it is likely you haven't set
878 # $Conf{ClientCharset} correctly.
879 #
880 # If you are using smbclient on a WinXX machine, smbclient will convert
881 # to the "unix charset" setting in smb.conf.  The default is utf8,
882 # in which case leave $Conf{ClientCharset} empty since smbclient does
883 # the right conversion.
884 #
885 # If you are using rsync on a WinXX machine then it does no conversion.
886 # A typical WinXX encoding for latin1/western europe is 'cp1252',
887 # so in this case set $Conf{ClientCharset} to 'cp1252'.
888 #
889 # On a linux or unix client, run "locale charmap" to see the client's
890 # charset.  Set $Conf{ClientCharset} to this value.  A typical value
891 # for english/US is 'ISO-8859-1'.
892 #
893 # Do "perldoc Encode::Supported" to see the list of possible charset
894 # values.  The FAQ at http://www.cl.cam.ac.uk/~mgk25/unicode.html
895 # is excellent, and http://czyborra.com/charsets/iso8859.html
896 # provides more information on the iso-8859 charsets.
897 #
898 $Conf{ClientCharset} = '';
899
900 #
901 # Prior to 3.x no charset conversion was done by BackupPC.  Backups were
902 # stored in what ever charset the XferMethod provided - typically utf8
903 # for smbclient and the client's locale settings for rsync and tar (eg:
904 # cp1252 for rsync on WinXX and perhaps iso-8859-1 with rsync on linux).
905 # This setting tells BackupPC the charset that was used to store file
906 # names in old backups taken with BackupPC 2.x, so that non-ascii file
907 # names in old backups can be viewed and restored.
908 #
909 $Conf{ClientCharsetLegacy} = 'iso-8859-1';
910
911 ###########################################################################
912 # Samba Configuration
913 # (can be overwritten in the per-PC log file)
914 ###########################################################################
915 #
916 # Name of the host share that is backed up when using SMB.  This can be a
917 # string or an array of strings if there are multiple shares per host.
918 # Examples:
919 #
920 #   $Conf{SmbShareName} = 'c';          # backup 'c' share
921 #   $Conf{SmbShareName} = ['c', 'd'];   # backup 'c' and 'd' shares
922 #
923 # This setting only matters if $Conf{XferMethod} = 'smb'.
924 #
925 $Conf{SmbShareName} = 'C$';
926
927 #
928 # Smbclient share user name.  This is passed to smbclient's -U argument.
929 #
930 # This setting only matters if $Conf{XferMethod} = 'smb'.
931 #
932 $Conf{SmbShareUserName} = '';
933
934 #
935 # Smbclient share password.  This is passed to smbclient via its PASSWD
936 # environment variable.  There are several ways you can tell BackupPC
937 # the smb share password.  In each case you should be very careful about
938 # security.  If you put the password here, make sure that this file is
939 # not readable by regular users!  See the "Setting up config.pl" section
940 # in the documentation for more information.
941 #
942 # This setting only matters if $Conf{XferMethod} = 'smb'.
943 #
944 $Conf{SmbSharePasswd} = '';
945
946 #
947 # Full path for smbclient. Security caution: normal users should not
948 # allowed to write to this file or directory.
949 #
950 # smbclient is from the Samba distribution. smbclient is used to
951 # actually extract the incremental or full dump of the share filesystem
952 # from the PC.
953 #
954 # This setting only matters if $Conf{XferMethod} = 'smb'.
955 #
956 $Conf{SmbClientPath} = '';
957
958 #
959 # Command to run smbclient for a full dump.
960 # This setting only matters if $Conf{XferMethod} = 'smb'.
961 #
962 # The following variables are substituted at run-time:
963 #
964 #    $smbClientPath   same as $Conf{SmbClientPath}
965 #    $host            host to backup/restore
966 #    $hostIP          host IP address
967 #    $shareName       share name
968 #    $userName        user name
969 #    $fileList        list of files to backup (based on exclude/include)
970 #    $I_option        optional -I option to smbclient
971 #    $X_option        exclude option (if $fileList is an exclude list)
972 #    $timeStampFile   start time for incremental dump
973 #
974 # Note: all Cmds are executed directly without a shell, so the prog name
975 # needs to be a full path and you can't include shell syntax like
976 # redirection and pipes; put that in a script if you need it.
977 #
978 $Conf{SmbClientFullCmd} = '$smbClientPath \\\\$host\\$shareName'
979             . ' $I_option -U $userName -E -N -d 1'
980             . ' -c tarmode\\ full -Tc$X_option - $fileList';
981
982 #
983 # Command to run smbclient for an incremental dump.
984 # This setting only matters if $Conf{XferMethod} = 'smb'.
985 #
986 # Same variable substitutions are applied as $Conf{SmbClientFullCmd}.
987 #
988 # Note: all Cmds are executed directly without a shell, so the prog name
989 # needs to be a full path and you can't include shell syntax like
990 # redirection and pipes; put that in a script if you need it.
991 #
992 $Conf{SmbClientIncrCmd} = '$smbClientPath \\\\$host\\$shareName'
993             . ' $I_option -U $userName -E -N -d 1'
994             . ' -c tarmode\\ full -TcN$X_option $timeStampFile - $fileList';
995
996 #
997 # Command to run smbclient for a restore.
998 # This setting only matters if $Conf{XferMethod} = 'smb'.
999 #
1000 # Same variable substitutions are applied as $Conf{SmbClientFullCmd}.
1001 #
1002 # If your smb share is read-only then direct restores will fail.
1003 # You should set $Conf{SmbClientRestoreCmd} to undef and the
1004 # corresponding CGI restore option will be removed.
1005 #
1006 # Note: all Cmds are executed directly without a shell, so the prog name
1007 # needs to be a full path and you can't include shell syntax like
1008 # redirection and pipes; put that in a script if you need it.
1009 #
1010 $Conf{SmbClientRestoreCmd} = '$smbClientPath \\\\$host\\$shareName'
1011             . ' $I_option -U $userName -E -N -d 1'
1012             . ' -c tarmode\\ full -Tx -';
1013
1014 ###########################################################################
1015 # Tar Configuration
1016 # (can be overwritten in the per-PC log file)
1017 ###########################################################################
1018 #
1019 # Which host directories to backup when using tar transport.  This can be a
1020 # string or an array of strings if there are multiple directories to
1021 # backup per host.  Examples:
1022 #
1023 #   $Conf{TarShareName} = '/';                  # backup everything
1024 #   $Conf{TarShareName} = '/home';              # only backup /home
1025 #   $Conf{TarShareName} = ['/home', '/src'];    # backup /home and /src
1026 #
1027 # The fact this parameter is called 'TarShareName' is for historical
1028 # consistency with the Smb transport options.  You can use any valid
1029 # directory on the client: there is no need for it to correspond to
1030 # any Smb share or device mount point.
1031 #
1032 # Note also that you can also use $Conf{BackupFilesOnly} to specify
1033 # a specific list of directories to backup.  It's more efficient to
1034 # use this option instead of $Conf{TarShareName} since a new tar is
1035 # run for each entry in $Conf{TarShareName}.
1036 #
1037 # On the other hand, if you add --one-file-system to $Conf{TarClientCmd}
1038 # you can backup each file system separately, which makes restoring one
1039 # bad file system easier.  In this case you would list all of the mount
1040 # points here, since you can't get the same result with
1041 # $Conf{BackupFilesOnly}:
1042 #
1043 #     $Conf{TarShareName} = ['/', '/var', '/data', '/boot'];
1044 #
1045 # This setting only matters if $Conf{XferMethod} = 'tar'.
1046 #
1047 $Conf{TarShareName} = '/';
1048
1049 #
1050 # Full command to run tar on the client.  GNU tar is required.  You will
1051 # need to fill in the correct paths for ssh2 on the local host (server)
1052 # and GNU tar on the client.  Security caution: normal users should not
1053 # allowed to write to these executable files or directories.
1054 #
1055 # See the documentation for more information about setting up ssh2 keys.
1056 #
1057 # If you plan to use NFS then tar just runs locally and ssh2 is not needed.
1058 # For example, assuming the client filesystem is mounted below /mnt/hostName,
1059 # you could use something like:
1060 #
1061 #    $Conf{TarClientCmd} = '$tarPath -c -v -f - -C /mnt/$host/$shareName'
1062 #                        . ' --totals';
1063 #
1064 # In the case of NFS or rsh you need to make sure BackupPC's privileges
1065 # are sufficient to read all the files you want to backup.  Also, you
1066 # will probably want to add "/proc" to $Conf{BackupFilesExclude}.
1067 #
1068 # The following variables are substituted at run-time:
1069 #
1070 #   $host        host name
1071 #   $hostIP      host's IP address
1072 #   $incrDate    newer-than date for incremental backups
1073 #   $shareName   share name to backup (ie: top-level directory path)
1074 #   $fileList    specific files to backup or exclude
1075 #   $tarPath     same as $Conf{TarClientPath}
1076 #   $sshPath     same as $Conf{SshPath}
1077 #
1078 # If a variable is followed by a "+" it is shell escaped.  This is
1079 # necessary for the command part of ssh or rsh, since it ends up
1080 # getting passed through the shell.
1081 #
1082 # This setting only matters if $Conf{XferMethod} = 'tar'.
1083 #
1084 # Note: all Cmds are executed directly without a shell, so the prog name
1085 # needs to be a full path and you can't include shell syntax like
1086 # redirection and pipes; put that in a script if you need it.
1087 #
1088 $Conf{TarClientCmd} = '$sshPath -q -x -n -l root $host'
1089                     . ' env LC_ALL=C $tarPath -c -v -f - -C $shareName+'
1090                     . ' --totals';
1091
1092 #
1093 # Extra tar arguments for full backups.  Several variables are substituted at
1094 # run-time.  See $Conf{TarClientCmd} for the list of variable substitutions.
1095 #
1096 # If you are running tar locally (ie: without rsh or ssh) then remove the
1097 # "+" so that the argument is no longer shell escaped.
1098 #
1099 # This setting only matters if $Conf{XferMethod} = 'tar'.
1100 #
1101 $Conf{TarFullArgs} = '$fileList+';
1102
1103 #
1104 # Extra tar arguments for incr backups.  Several variables are substituted at
1105 # run-time.  See $Conf{TarClientCmd} for the list of variable substitutions.
1106 #
1107 # Note that GNU tar has several methods for specifying incremental backups,
1108 # including:
1109 #
1110 #   --newer-mtime $incrDate+
1111 #          This causes a file to be included if the modification time is
1112 #          later than $incrDate (meaning its contents might have changed).
1113 #          But changes in the ownership or modes will not qualify the
1114 #          file to be included in an incremental.
1115 #
1116 #   --newer=$incrDate+
1117 #          This causes the file to be included if any attribute of the
1118 #          file is later than $incrDate, meaning either attributes or
1119 #          the modification time.  This is the default method.  Do
1120 #          not use --atime-preserve in $Conf{TarClientCmd} above,
1121 #          otherwise resetting the atime (access time) counts as an
1122 #          attribute change, meaning the file will always be included
1123 #          in each new incremental dump.
1124 #
1125 # If you are running tar locally (ie: without rsh or ssh) then remove the
1126 # "+" so that the argument is no longer shell escaped.
1127 #
1128 # This setting only matters if $Conf{XferMethod} = 'tar'.
1129 #
1130 $Conf{TarIncrArgs} = '--newer=$incrDate+ $fileList+';
1131
1132 #
1133 # Full command to run tar for restore on the client.  GNU tar is required.
1134 # This can be the same as $Conf{TarClientCmd}, with tar's -c replaced by -x
1135 # and ssh's -n removed.
1136 #
1137 # See $Conf{TarClientCmd} for full details.
1138 #
1139 # This setting only matters if $Conf{XferMethod} = "tar".
1140 #
1141 # If you want to disable direct restores using tar, you should set
1142 # $Conf{TarClientRestoreCmd} to undef and the corresponding CGI
1143 # restore option will be removed.
1144 #
1145 # Note: all Cmds are executed directly without a shell, so the prog name
1146 # needs to be a full path and you can't include shell syntax like
1147 # redirection and pipes; put that in a script if you need it.
1148 #
1149 $Conf{TarClientRestoreCmd} = '$sshPath -q -x -l root $host'
1150                    . ' env LC_ALL=C $tarPath -x -p --numeric-owner --same-owner'
1151                    . ' -v -f - -C $shareName+';
1152
1153 #
1154 # Full path for tar on the client. Security caution: normal users should not
1155 # allowed to write to this file or directory.
1156 #
1157 # This setting only matters if $Conf{XferMethod} = 'tar'.
1158 #
1159 $Conf{TarClientPath} = '';
1160
1161 ###########################################################################
1162 # Rsync/Rsyncd Configuration
1163 # (can be overwritten in the per-PC log file)
1164 ###########################################################################
1165 #
1166 # Path to rsync executable on the client
1167 #
1168 $Conf{RsyncClientPath} = '';
1169
1170 #
1171 # Full command to run rsync on the client machine.  The following variables
1172 # are substituted at run-time:
1173 #
1174 #        $host           host name being backed up
1175 #        $hostIP         host's IP address
1176 #        $shareName      share name to backup (ie: top-level directory path)
1177 #        $rsyncPath      same as $Conf{RsyncClientPath}
1178 #        $sshPath        same as $Conf{SshPath}
1179 #        $argList        argument list, built from $Conf{RsyncArgs},
1180 #                        $shareName, $Conf{BackupFilesExclude} and
1181 #                        $Conf{BackupFilesOnly}
1182 #
1183 # This setting only matters if $Conf{XferMethod} = 'rsync'.
1184 #
1185 $Conf{RsyncClientCmd} = '$sshPath -q -x -l root $host $rsyncPath $argList+';
1186
1187 #
1188 # Full command to run rsync for restore on the client.  The following
1189 # variables are substituted at run-time:
1190 #
1191 #        $host           host name being backed up
1192 #        $hostIP         host's IP address
1193 #        $shareName      share name to backup (ie: top-level directory path)
1194 #        $rsyncPath      same as $Conf{RsyncClientPath}
1195 #        $sshPath        same as $Conf{SshPath}
1196 #        $argList        argument list, built from $Conf{RsyncArgs},
1197 #                        $shareName, $Conf{BackupFilesExclude} and
1198 #                        $Conf{BackupFilesOnly}
1199 #
1200 # This setting only matters if $Conf{XferMethod} = 'rsync'.
1201 #
1202 # Note: all Cmds are executed directly without a shell, so the prog name
1203 # needs to be a full path and you can't include shell syntax like
1204 # redirection and pipes; put that in a script if you need it.
1205 #
1206 $Conf{RsyncClientRestoreCmd} = '$sshPath -q -x -l root $host $rsyncPath $argList+';
1207
1208 #
1209 # Share name to backup.  For $Conf{XferMethod} = "rsync" this should
1210 # be a file system path, eg '/' or '/home'.
1211 #
1212 # For $Conf{XferMethod} = "rsyncd" this should be the name of the module
1213 # to backup (ie: the name from /etc/rsynd.conf).
1214 #
1215 # This can also be a list of multiple file system paths or modules.
1216 # For example, by adding --one-file-system to $Conf{RsyncArgs} you
1217 # can backup each file system separately, which makes restoring one
1218 # bad file system easier.  In this case you would list all of the mount
1219 # points:
1220 #
1221 #     $Conf{RsyncShareName} = ['/', '/var', '/data', '/boot'];
1222 #
1223 $Conf{RsyncShareName} = '/';
1224
1225 #
1226 # Rsync daemon port on the client, for $Conf{XferMethod} = "rsyncd".
1227 #
1228 $Conf{RsyncdClientPort} = 873;
1229
1230 #
1231 # Rsync daemon user name on client, for $Conf{XferMethod} = "rsyncd".
1232 # The user name and password are stored on the client in whatever file
1233 # the "secrets file" parameter in rsyncd.conf points to
1234 # (eg: /etc/rsyncd.secrets).
1235 #
1236 $Conf{RsyncdUserName} = '';
1237
1238 #
1239 # Rsync daemon user name on client, for $Conf{XferMethod} = "rsyncd".
1240 # The user name and password are stored on the client in whatever file
1241 # the "secrets file" parameter in rsyncd.conf points to
1242 # (eg: /etc/rsyncd.secrets).
1243 #
1244 $Conf{RsyncdPasswd} = '';
1245
1246 #
1247 # Whether authentication is mandatory when connecting to the client's
1248 # rsyncd.  By default this is on, ensuring that BackupPC will refuse to
1249 # connect to an rsyncd on the client that is not password protected.
1250 # Turn off at your own risk.
1251 #
1252 $Conf{RsyncdAuthRequired} = 1;
1253
1254 #
1255 # When rsync checksum caching is enabled (by adding the
1256 # --checksum-seed=32761 option to $Conf{RsyncArgs}), the cached
1257 # checksums can be occasionally verified to make sure the file
1258 # contents matches the cached checksums.  This is to avoid the
1259 # risk that disk problems might cause the pool file contents to
1260 # get corrupted, but the cached checksums would make BackupPC
1261 # think that the file still matches the client.
1262 #
1263 # This setting is the probability (0 means never and 1 means always)
1264 # that a file will be rechecked.  Setting it to 0 means the checksums
1265 # will not be rechecked (unless there is a phase 0 failure).  Setting
1266 # it to 1 (ie: 100%) means all files will be checked, but that is
1267 # not a desirable setting since you are better off simply turning
1268 # caching off (ie: remove the --checksum-seed option).
1269 #   
1270 # The default of 0.01 means 1% (on average) of the files during a full
1271 # backup will have their cached checksum re-checked.
1272 #   
1273 # This setting has no effect unless checksum caching is turned on.
1274 #   
1275 $Conf{RsyncCsumCacheVerifyProb} = 0.01;
1276
1277 #
1278 # Arguments to rsync for backup.  Do not edit the first set unless you
1279 # have a thorough understanding of how File::RsyncP works.
1280 #
1281 $Conf{RsyncArgs} = [
1282             #
1283             # Do not edit these!
1284             #
1285             '--numeric-ids',
1286             '--perms',
1287             '--owner',
1288             '--group',
1289             '-D',
1290             '--links',
1291             '--hard-links',
1292             '--times',
1293             '--block-size=2048',
1294             '--recursive',
1295
1296             #
1297             # Rsync >= 2.6.3 supports the --checksum-seed option
1298             # which allows rsync checksum caching on the server.
1299             # Uncomment this to enable rsync checksum caching if
1300             # you have a recent client rsync version and you want
1301             # to enable checksum caching.
1302             #
1303             #'--checksum-seed=32761',
1304 ];
1305
1306 #
1307 # Additional arguments added to RsyncArgs.  This can be used in
1308 # conbination with $Conf{RsyncArgs} to allow customization of
1309 # the rsync arguments on a part-client basis.  The standard
1310 # arguments go in $Conf{RsyncArgs} and $Conf{RsyncArgsExtra}
1311 # can be set on a per-client basis.
1312 #
1313 # Examples of additional arguments that should work are --exclude/--include,
1314 # eg:
1315 #
1316 #     $Conf{RsyncArgsExtra} = [
1317 #           '--exclude', '/proc',
1318 #           '--exclude', '*.tmp',
1319 #     ];
1320 #
1321 # Both $Conf{RsyncArgs} and $Conf{RsyncArgsExtra} are subject
1322 # to the following variable substitutions:
1323 #
1324 #        $client       client name being backed up
1325 #        $host         host name (could be different from client name if
1326 #                                 $Conf{ClientNameAlias} is set)
1327 #        $hostIP       IP address of host
1328 #        $confDir      configuration directory path
1329 #
1330 # This allows settings of the form:
1331 #
1332 #     $Conf{RsyncArgsExtra} = [
1333 #             '--exclude-from=$confDir/pc/$host.exclude',
1334 #     ];
1335 #
1336 $Conf{RsyncArgsExtra} = [];
1337
1338 #
1339 # Arguments to rsync for restore.  Do not edit the first set unless you
1340 # have a thorough understanding of how File::RsyncP works.
1341 #
1342 # If you want to disable direct restores using rsync (eg: is the module
1343 # is read-only), you should set $Conf{RsyncRestoreArgs} to undef and
1344 # the corresponding CGI restore option will be removed.
1345 #
1346 # $Conf{RsyncRestoreArgs} is subject to the following variable
1347 # substitutions:
1348 #
1349 #        $client       client name being backed up
1350 #        $host         host name (could be different from client name if
1351 #                                 $Conf{ClientNameAlias} is set)
1352 #        $hostIP       IP address of host
1353 #        $confDir      configuration directory path
1354 #
1355 # Note: $Conf{RsyncArgsExtra} doesn't apply to $Conf{RsyncRestoreArgs}.
1356 #
1357 $Conf{RsyncRestoreArgs} = [
1358             #
1359             # Do not edit these!
1360             #
1361             '--numeric-ids',
1362             '--perms',
1363             '--owner',
1364             '--group',
1365             '-D',
1366             '--links',
1367             '--hard-links',
1368             '--times',
1369             '--block-size=2048',
1370             '--relative',
1371             '--ignore-times',
1372             '--recursive',
1373
1374             #
1375             # Rsync >= 2.6.3 supports the --checksum-seed option
1376             # which allows rsync checksum caching on the server.
1377             # Uncomment this to enable rsync checksum caching if
1378             # you have a recent client rsync version and you want
1379             # to enable checksum caching.
1380             #
1381             #'--checksum-seed=32761',
1382
1383             #
1384             # Add additional arguments here
1385             #
1386 ];
1387
1388 ###########################################################################
1389 # FTP Configuration
1390 # (can be overwritten in the per-PC log file)
1391 ##########################################################################
1392 #
1393 # Which host directories to backup when using FTP.  This can be a
1394 # string or an array of strings if there are multiple shares per host.
1395 #
1396 # This value must be specified in one of two ways: either as a
1397 # subdirectory of the 'share root' on the server, or as the absolute
1398 # path of the directory.
1399 #
1400 # In the following example, if the directory /home/username is the
1401 # root share of the ftp server with the given username, the following
1402 # two values will back up the same directory:
1403 #
1404 #    $Conf{FtpShareName} = 'www';                # www directory
1405 #    $Conf{FtpShareName} = '/home/username/www'; # same directory
1406 #
1407 # Path resolution is not supported; i.e.; you may not have an ftp
1408 # share path defined as '../otheruser' or '~/games'.
1409 #
1410 #  Multiple shares may also be specified, as with other protocols:
1411 #
1412 #    $Conf{FtpShareName} = [ 'www',
1413 #                            'bin',
1414 #                            'config' ];
1415 #
1416 # Note also that you can also use $Conf{BackupFilesOnly} to specify
1417 # a specific list of directories to backup.  It's more efficient to
1418 # use this option instead of $Conf{FtpShareName} since a new tar is
1419 # run for each entry in $Conf{FtpShareName}.
1420 #
1421 # This setting only matters if $Conf{XferMethod} = 'ftp'.
1422 #
1423 $Conf{FtpShareName} = '';
1424
1425 #
1426 # FTP user name.  This is used to log into the server.
1427 #
1428 # This setting is used only if $Conf{XferMethod} = 'ftp'.
1429 #
1430 $Conf{FtpUserName} = '';
1431
1432 #
1433 # FTP user password.  This is used to log into the server.
1434 #
1435 # This setting is used only if $Conf{XferMethod} = 'ftp'.
1436 #
1437 $Conf{FtpPasswd} = '';
1438
1439 #
1440 # Whether passive mode is used.  The correct setting depends upon
1441 # whether local or remote ports are accessible from the other machine,
1442 # which is affected by any firewall or routers between the FTP server
1443 # on the client and the BackupPC server.
1444 #
1445 # This setting is used only if $Conf{XferMethod} = 'ftp'.
1446 #
1447 $Conf{FtpPassive} = 1;
1448
1449 #
1450 # Transfer block size. This sets the size of the amounts of data in
1451 # each frame. While undefined, this value takes the default value.
1452 #
1453 # This setting is used only if $Conf{XferMethod} = 'ftp'.
1454 #
1455 $Conf{FtpBlockSize} = 10240;
1456
1457 #
1458 # The port of the ftp server.  If undefined, 21 is used.
1459 #
1460 # This setting is used only if $Conf{XferMethod} = 'ftp'.
1461 #
1462 $Conf{FtpPort} = 21;
1463
1464 #
1465 # Connection timeout for FTP.  When undefined, the default is 120 seconds.
1466 #
1467 # This setting is used only if $Conf{XferMethod} = 'ftp'.
1468 #
1469 $Conf{FtpTimeout} = 120;
1470
1471 #
1472 # Behaviour when BackupPC encounters symlinks on the FTP share.
1473 #
1474 # Symlinks cannot be restored via FTP, so the desired behaviour will
1475 # be different depending on the setup of the share. The default for
1476 # this behavor is 1.  Directory shares with more complicated directory
1477 # structures should consider other protocols.
1478 #
1479 $Conf{FtpFollowSymlinks} = 0;
1480
1481 ###########################################################################
1482 # Archive Configuration
1483 # (can be overwritten in the per-PC log file)
1484 ###########################################################################
1485 #
1486 # Archive Destination
1487 #
1488 # The Destination of the archive
1489 # e.g. /tmp for file archive or /dev/nst0 for device archive
1490 #
1491 $Conf{ArchiveDest} = '/tmp';
1492
1493 #
1494 # Archive Compression type
1495 #
1496 # The valid values are:
1497 #
1498 #   - 'none':  No Compression
1499 #
1500 #   - 'gzip':  Medium Compression. Recommended.
1501 #
1502 #   - 'bzip2': High Compression but takes longer.
1503 #
1504 $Conf{ArchiveComp} = 'gzip';
1505
1506 #
1507 # Archive Parity Files
1508 #
1509 # The amount of Parity data to generate, as a percentage
1510 # of the archive size.
1511 # Uses the commandline par2 (par2cmdline) available from
1512 # http://parchive.sourceforge.net
1513 #
1514 # Only useful for file dumps.
1515 #
1516 # Set to 0 to disable this feature.
1517 #
1518 $Conf{ArchivePar} = 0;
1519
1520 #
1521 # Archive Size Split
1522 #
1523 # Only for file archives. Splits the output into 
1524 # the specified size * 1,000,000.
1525 # e.g. to split into 650,000,000 bytes, specify 650 below.
1526
1527 # If the value is 0, or if $Conf{ArchiveDest} is an existing file or
1528 # device (e.g. a streaming tape drive), this feature is disabled.
1529 #
1530 $Conf{ArchiveSplit} = 0;
1531
1532 #
1533 # Archive Command
1534 #
1535 # This is the command that is called to actually run the archive process
1536 # for each host.  The following variables are substituted at run-time:
1537 #
1538 #   $Installdir    The installation directory of BackupPC
1539 #   $tarCreatePath The path to BackupPC_tarCreate
1540 #   $splitpath     The path to the split program
1541 #   $parpath       The path to the par2 program
1542 #   $host          The host to archive
1543 #   $backupnumber  The backup number of the host to archive
1544 #   $compression   The path to the compression program
1545 #   $compext       The extension assigned to the compression type
1546 #   $splitsize     The number of bytes to split archives into
1547 #   $archiveloc    The location to put the archive
1548 #   $parfile       The amount of parity data to create (percentage)
1549 #
1550 # Note: all Cmds are executed directly without a shell, so the prog name
1551 # needs to be a full path and you can't include shell syntax like
1552 # redirection and pipes; put that in a script if you need it.
1553 #
1554 $Conf{ArchiveClientCmd} = '$Installdir/bin/BackupPC_archiveHost'
1555         . ' $tarCreatePath $splitpath $parpath $host $backupnumber'
1556         . ' $compression $compext $splitsize $archiveloc $parfile *';
1557
1558 #
1559 # Full path for ssh. Security caution: normal users should not
1560 # allowed to write to this file or directory.
1561 #
1562 $Conf{SshPath} = '';
1563
1564 #
1565 # Full path for nmblookup. Security caution: normal users should not
1566 # allowed to write to this file or directory.
1567 #
1568 # nmblookup is from the Samba distribution. nmblookup is used to get the
1569 # netbios name, necessary for DHCP hosts.
1570 #
1571 $Conf{NmbLookupPath} = '';
1572
1573 #
1574 # NmbLookup command.  Given an IP address, does an nmblookup on that
1575 # IP address.  The following variables are substituted at run-time:
1576 #
1577 #   $nmbLookupPath      path to nmblookup ($Conf{NmbLookupPath})
1578 #   $host               IP address
1579 #
1580 # This command is only used for DHCP hosts: given an IP address, this
1581 # command should try to find its NetBios name.
1582 #
1583 # Note: all Cmds are executed directly without a shell, so the prog name
1584 # needs to be a full path and you can't include shell syntax like
1585 # redirection and pipes; put that in a script if you need it.
1586 #
1587 $Conf{NmbLookupCmd} = '$nmbLookupPath -A $host';
1588
1589 #
1590 # NmbLookup command.  Given a netbios name, finds that host by doing
1591 # a NetBios lookup.  Several variables are substituted at run-time:
1592 #
1593 #   $nmbLookupPath      path to nmblookup ($Conf{NmbLookupPath})
1594 #   $host               NetBios name
1595 #
1596 # In some cases you might need to change the broadcast address, for
1597 # example if nmblookup uses 192.168.255.255 by default and you find
1598 # that doesn't work, try 192.168.1.255 (or your equivalent class C
1599 # address) using the -B option:
1600 #
1601 #    $Conf{NmbLookupFindHostCmd} = '$nmbLookupPath -B 192.168.1.255 $host';
1602 #
1603 # If you use a WINS server and your machines don't respond to
1604 # multicast NetBios requests you can use this (replace 1.2.3.4
1605 # with the IP address of your WINS server):
1606 #
1607 #    $Conf{NmbLookupFindHostCmd} = '$nmbLookupPath -R -U 1.2.3.4 $host';
1608 #
1609 # This is preferred over multicast since it minimizes network traffic.
1610 #
1611 # Experiment manually for your site to see what form of nmblookup command
1612 # works.
1613 #
1614 # Note: all Cmds are executed directly without a shell, so the prog name
1615 # needs to be a full path and you can't include shell syntax like
1616 # redirection and pipes; put that in a script if you need it.
1617 #
1618 $Conf{NmbLookupFindHostCmd} = '$nmbLookupPath $host';
1619
1620 #
1621 # For fixed IP address hosts, BackupPC_dump can also verify the netbios
1622 # name to ensure it matches the host name.  An error is generated if
1623 # they do not match.  Typically this flag is off.  But if you are going
1624 # to transition a bunch of machines from fixed host addresses to DHCP,
1625 # setting this flag is a great way to verify that the machines have
1626 # their netbios name set correctly before turning on DCHP.
1627 #
1628 $Conf{FixedIPNetBiosNameCheck} = 0;
1629
1630 #
1631 # Full path to the ping command.  Security caution: normal users
1632 # should not be allowed to write to this file or directory.
1633 #
1634 # If you want to disable ping checking, set this to some program
1635 # that exits with 0 status, eg:
1636 #
1637 #     $Conf{PingPath} = '/bin/echo';
1638 #
1639 $Conf{PingPath} = '';
1640
1641 #
1642 # Ping command.  The following variables are substituted at run-time:
1643 #
1644 #   $pingPath      path to ping ($Conf{PingPath})
1645 #   $host          host name
1646 #
1647 # Wade Brown reports that on solaris 2.6 and 2.7 ping -s returns the wrong
1648 # exit status (0 even on failure).  Replace with "ping $host 1", which
1649 # gets the correct exit status but we don't get the round-trip time.
1650 #
1651 # Note: all Cmds are executed directly without a shell, so the prog name
1652 # needs to be a full path and you can't include shell syntax like
1653 # redirection and pipes; put that in a script if you need it.
1654 #
1655 $Conf{PingCmd} = '$pingPath -c 1 $host';
1656
1657 #
1658 # Maximum round-trip ping time in milliseconds.  This threshold is set
1659 # to avoid backing up PCs that are remotely connected through WAN or
1660 # dialup connections.  The output from ping -s (assuming it is supported
1661 # on your system) is used to check the round-trip packet time.  On your
1662 # local LAN round-trip times should be much less than 20msec.  On most
1663 # WAN or dialup connections the round-trip time will be typically more
1664 # than 20msec.  Tune if necessary.
1665 #
1666 $Conf{PingMaxMsec} = 20;
1667
1668 #
1669 # Compression level to use on files.  0 means no compression.  Compression
1670 # levels can be from 1 (least cpu time, slightly worse compression) to
1671 # 9 (most cpu time, slightly better compression).  The recommended value
1672 # is 3.  Changing to 5, for example, will take maybe 20% more cpu time
1673 # and will get another 2-3% additional compression. See the zlib
1674 # documentation for more information about compression levels.
1675 #
1676 # Changing compression on or off after backups have already been done
1677 # will require both compressed and uncompressed pool files to be stored.
1678 # This will increase the pool storage requirements, at least until all
1679 # the old backups expire and are deleted.
1680 #
1681 # It is ok to change the compression value (from one non-zero value to
1682 # another non-zero value) after dumps are already done.  Since BackupPC
1683 # matches pool files by comparing the uncompressed versions, it will still
1684 # correctly match new incoming files against existing pool files.  The
1685 # new compression level will take effect only for new files that are
1686 # newly compressed and added to the pool.
1687 #
1688 # If compression was off and you are enabling compression for the first
1689 # time you can use the BackupPC_compressPool utility to compress the
1690 # pool.  This avoids having the pool grow to accommodate both compressed
1691 # and uncompressed backups.  See the documentation for more information.
1692 #
1693 # Note: compression needs the Compress::Zlib perl library.  If the
1694 # Compress::Zlib library can't be found then $Conf{CompressLevel} is
1695 # forced to 0 (compression off).
1696 #
1697 $Conf{CompressLevel} = 0;
1698
1699 #
1700 # Timeout in seconds when listening for the transport program's
1701 # (smbclient, tar etc) stdout. If no output is received during this
1702 # time, then it is assumed that something has wedged during a backup,
1703 # and the backup is terminated.
1704 #
1705 # Note that stdout buffering combined with huge files being backed up
1706 # could cause longish delays in the output from smbclient that
1707 # BackupPC_dump sees, so in rare cases you might want to increase
1708 # this value.
1709 #
1710 # Despite the name, this parameter sets the timeout for all transport
1711 # methods (tar, smb etc).
1712 #
1713 $Conf{ClientTimeout} = 72000;
1714
1715 #
1716 # Maximum number of log files we keep around in each PC's directory
1717 # (ie: pc/$host).  These files are aged monthly.  A setting of 12
1718 # means there will be at most the files LOG, LOG.0, LOG.1, ... LOG.11
1719 # in the pc/$host directory (ie: about a years worth).  (Except this
1720 # month's LOG, these files will have a .z extension if compression
1721 # is on).
1722 #
1723 # If you decrease this number after BackupPC has been running for a
1724 # while you will have to manually remove the older log files.
1725 #
1726 $Conf{MaxOldPerPCLogFiles} = 12;
1727
1728 #
1729 # Optional commands to run before and after dumps and restores,
1730 # and also before and after each share of a dump.
1731 #
1732 # Stdout from these commands will be written to the Xfer (or Restore)
1733 # log file.  One example of using these commands would be to
1734 # shut down and restart a database server, dump a database
1735 # to files for backup, or doing a snapshot of a share prior
1736 # to a backup.  Example:
1737 #
1738 #    $Conf{DumpPreUserCmd} = '$sshPath -q -x -l root $host /usr/bin/dumpMysql';
1739 #
1740 # The following variable substitutions are made at run time for
1741 # $Conf{DumpPreUserCmd}, $Conf{DumpPostUserCmd}, $Conf{DumpPreShareCmd}
1742 # and $Conf{DumpPostShareCmd}:
1743 #
1744 #        $type         type of dump (incr or full)
1745 #        $xferOK       1 if the dump succeeded, 0 if it didn't
1746 #        $client       client name being backed up
1747 #        $host         host name (could be different from client name if
1748 #                                 $Conf{ClientNameAlias} is set)
1749 #        $hostIP       IP address of host
1750 #        $user         user name from the hosts file
1751 #        $moreUsers    list of additional users from the hosts file
1752 #        $share        the first share name (or current share for
1753 #                        $Conf{DumpPreShareCmd} and $Conf{DumpPostShareCmd})
1754 #        $shares       list of all the share names
1755 #        $XferMethod   value of $Conf{XferMethod} (eg: tar, rsync, smb)
1756 #        $sshPath      value of $Conf{SshPath},
1757 #        $cmdType      set to DumpPreUserCmd or DumpPostUserCmd
1758 #
1759 # The following variable substitutions are made at run time for
1760 # $Conf{RestorePreUserCmd} and $Conf{RestorePostUserCmd}:
1761 #
1762 #        $client       client name being backed up
1763 #        $xferOK       1 if the restore succeeded, 0 if it didn't
1764 #        $host         host name (could be different from client name if
1765 #                                 $Conf{ClientNameAlias} is set)
1766 #        $hostIP       IP address of host
1767 #        $user         user name from the hosts file
1768 #        $moreUsers    list of additional users from the hosts file
1769 #        $share        the first share name
1770 #        $XferMethod   value of $Conf{XferMethod} (eg: tar, rsync, smb)
1771 #        $sshPath      value of $Conf{SshPath},
1772 #        $type         set to "restore"
1773 #        $bkupSrcHost  host name of the restore source
1774 #        $bkupSrcShare share name of the restore source
1775 #        $bkupSrcNum   backup number of the restore source
1776 #        $pathHdrSrc   common starting path of restore source
1777 #        $pathHdrDest  common starting path of destination
1778 #        $fileList     list of files being restored
1779 #        $cmdType      set to RestorePreUserCmd or RestorePostUserCmd
1780 #
1781 # The following variable substitutions are made at run time for
1782 # $Conf{ArchivePreUserCmd} and $Conf{ArchivePostUserCmd}:
1783 #
1784 #        $client       client name being backed up
1785 #        $xferOK       1 if the archive succeeded, 0 if it didn't
1786 #        $host         Name of the archive host
1787 #        $user         user name from the hosts file
1788 #        $share        the first share name
1789 #        $XferMethod   value of $Conf{XferMethod} (eg: tar, rsync, smb)
1790 #        $HostList     list of hosts being archived
1791 #        $BackupList   list of backup numbers for the hosts being archived
1792 #        $archiveloc   location where the archive is sent to
1793 #        $parfile      amount of parity data being generated (percentage)
1794 #        $compression  compression program being used (eg: cat, gzip, bzip2)
1795 #        $compext      extension used for compression type (eg: raw, gz, bz2)
1796 #        $splitsize    size of the files that the archive creates
1797 #        $sshPath      value of $Conf{SshPath},
1798 #        $type         set to "archive"
1799 #        $cmdType      set to ArchivePreUserCmd or ArchivePostUserCmd
1800 #
1801 # Note: all Cmds are executed directly without a shell, so the prog name
1802 # needs to be a full path and you can't include shell syntax like
1803 # redirection and pipes; put that in a script if you need it.
1804 #
1805 $Conf{DumpPreUserCmd}     = undef;
1806 $Conf{DumpPostUserCmd}    = undef;
1807 $Conf{DumpPreShareCmd}    = undef;
1808 $Conf{DumpPostShareCmd}   = undef;
1809 $Conf{RestorePreUserCmd}  = undef;
1810 $Conf{RestorePostUserCmd} = undef;
1811 $Conf{ArchivePreUserCmd}  = undef;
1812 $Conf{ArchivePostUserCmd} = undef;
1813
1814 #
1815 # Whether the exit status of each PreUserCmd and
1816 # PostUserCmd is checked.
1817 #
1818 # If set and the Dump/Restore/Archive Pre/Post UserCmd
1819 # returns a non-zero exit status then the dump/restore/archive
1820 # is aborted.  To maintain backward compatibility (where
1821 # the exit status in early versions was always ignored),
1822 # this flag defaults to 0.
1823 #
1824 # If this flag is set and the Dump/Restore/Archive PreUserCmd
1825 # fails then the matching Dump/Restore/Archive PostUserCmd is
1826 # not executed.  If DumpPreShareCmd returns a non-exit status,
1827 # then DumpPostShareCmd is not executed, but the DumpPostUserCmd
1828 # is still run (since DumpPreUserCmd must have previously
1829 # succeeded).
1830 #
1831 # An example of a DumpPreUserCmd that might fail is a script
1832 # that snapshots or dumps a database which fails because
1833 # of some database error.
1834 #
1835 $Conf{UserCmdCheckStatus} = 0;
1836
1837 #
1838 # Override the client's host name.  This allows multiple clients
1839 # to all refer to the same physical host.  This should only be
1840 # set in the per-PC config file and is only used by BackupPC at
1841 # the last moment prior to generating the command used to backup
1842 # that machine (ie: the value of $Conf{ClientNameAlias} is invisible
1843 # everywhere else in BackupPC).  The setting can be a host name or
1844 # IP address, eg:
1845 #
1846 #         $Conf{ClientNameAlias} = 'realHostName';
1847 #         $Conf{ClientNameAlias} = '192.1.1.15';
1848 #
1849 # will cause the relevant smb/tar/rsync backup/restore commands to be
1850 # directed to realHostName, not the client name.
1851 #
1852 # Note: this setting doesn't work for hosts with DHCP set to 1.
1853 #
1854 $Conf{ClientNameAlias} = undef;
1855
1856 ###########################################################################
1857 # Email reminders, status and messages
1858 # (can be overridden in the per-PC config.pl)
1859 ###########################################################################
1860 #
1861 # Full path to the sendmail command.  Security caution: normal users
1862 # should not allowed to write to this file or directory.
1863 #
1864 $Conf{SendmailPath} = '';
1865
1866 #
1867 # Minimum period between consecutive emails to a single user.
1868 # This tries to keep annoying email to users to a reasonable
1869 # level.  Email checks are done nightly, so this number is effectively
1870 # rounded up (ie: 2.5 means a user will never receive email more
1871 # than once every 3 days).
1872 #
1873 $Conf{EMailNotifyMinDays} = 2.5;
1874
1875 #
1876 # Name to use as the "from" name for email.  Depending upon your mail
1877 # handler this is either a plain name (eg: "admin") or a fully-qualified
1878 # name (eg: "admin@mydomain.com").
1879 #
1880 $Conf{EMailFromUserName} = '';
1881
1882 #
1883 # Destination address to an administrative user who will receive a
1884 # nightly email with warnings and errors.  If there are no warnings
1885 # or errors then no email will be sent.  Depending upon your mail
1886 # handler this is either a plain name (eg: "admin") or a fully-qualified
1887 # name (eg: "admin@mydomain.com").
1888 #
1889 $Conf{EMailAdminUserName} = '';
1890
1891 #
1892 # Destination domain name for email sent to users.  By default
1893 # this is empty, meaning email is sent to plain, unqualified
1894 # addresses.  Otherwise, set it to the destintation domain, eg:
1895 #
1896 #    $Cong{EMailUserDestDomain} = '@mydomain.com';
1897 #
1898 # With this setting user email will be set to 'user@mydomain.com'.
1899 #
1900 $Conf{EMailUserDestDomain} = '';
1901
1902 #
1903 # This subject and message is sent to a user if their PC has never been
1904 # backed up.
1905 #
1906 # These values are language-dependent.  The default versions can be
1907 # found in the language file (eg: lib/BackupPC/Lang/en.pm).  If you
1908 # need to change the message, copy it here and edit it, eg:
1909 #
1910 #   $Conf{EMailNoBackupEverMesg} = <<'EOF';
1911 #   To: $user$domain
1912 #   cc:
1913 #   Subject: $subj
1914 #   
1915 #   Dear $userName,
1916 #   
1917 #   This is a site-specific email message.
1918 #   EOF
1919 #
1920 $Conf{EMailNoBackupEverSubj} = undef;
1921 $Conf{EMailNoBackupEverMesg} = undef;
1922
1923 #
1924 # How old the most recent backup has to be before notifying user.
1925 # When there have been no backups in this number of days the user
1926 # is sent an email.
1927 #
1928 $Conf{EMailNotifyOldBackupDays} = 7.0;
1929
1930 #
1931 # This subject and message is sent to a user if their PC has not recently
1932 # been backed up (ie: more than $Conf{EMailNotifyOldBackupDays} days ago).
1933 #
1934 # These values are language-dependent.  The default versions can be
1935 # found in the language file (eg: lib/BackupPC/Lang/en.pm).  If you
1936 # need to change the message, copy it here and edit it, eg:
1937 #
1938 #   $Conf{EMailNoBackupRecentMesg} = <<'EOF';
1939 #   To: $user$domain
1940 #   cc:
1941 #   Subject: $subj
1942 #   
1943 #   Dear $userName,
1944 #   
1945 #   This is a site-specific email message.
1946 #   EOF
1947 #
1948 $Conf{EMailNoBackupRecentSubj} = undef;
1949 $Conf{EMailNoBackupRecentMesg} = undef;
1950
1951 #
1952 # How old the most recent backup of Outlook files has to be before
1953 # notifying user.
1954 #
1955 $Conf{EMailNotifyOldOutlookDays} = 5.0;
1956
1957 #
1958 # This subject and message is sent to a user if their Outlook files have
1959 # not recently been backed up (ie: more than $Conf{EMailNotifyOldOutlookDays}
1960 # days ago).
1961 #
1962 # These values are language-dependent.  The default versions can be
1963 # found in the language file (eg: lib/BackupPC/Lang/en.pm).  If you
1964 # need to change the message, copy it here and edit it, eg:
1965 #
1966 #   $Conf{EMailOutlookBackupMesg} = <<'EOF';
1967 #   To: $user$domain
1968 #   cc:
1969 #   Subject: $subj
1970 #   
1971 #   Dear $userName,
1972 #   
1973 #   This is a site-specific email message.
1974 #   EOF
1975 #
1976 $Conf{EMailOutlookBackupSubj} = undef;
1977 $Conf{EMailOutlookBackupMesg} = undef;
1978
1979 #
1980 # Additional email headers.  This sets to charset to
1981 # utf8.
1982 #
1983 $Conf{EMailHeaders} = <<EOF;
1984 MIME-Version: 1.0
1985 Content-Type: text/plain; charset="utf-8"
1986 EOF
1987
1988 ###########################################################################
1989 # CGI user interface configuration settings
1990 # (can be overridden in the per-PC config.pl)
1991 ###########################################################################
1992 #
1993 # Normal users can only access information specific to their host.
1994 # They can start/stop/browse/restore backups.
1995 #
1996 # Administrative users have full access to all hosts, plus overall
1997 # status and log information.
1998 #
1999 # The administrative users are the union of the unix/linux group
2000 # $Conf{CgiAdminUserGroup} and the manual list of users, separated
2001 # by spaces, in $Conf{CgiAdminUsers}. If you don't want a group or
2002 # manual list of users set the corresponding configuration setting
2003 # to undef or an empty string.
2004 #
2005 # If you want every user to have admin privileges (careful!), set
2006 # $Conf{CgiAdminUsers} = '*'.
2007 #
2008 # Examples:
2009 #    $Conf{CgiAdminUserGroup} = 'admin';
2010 #    $Conf{CgiAdminUsers}     = 'craig celia';
2011 #    --> administrative users are the union of group admin, plus
2012 #      craig and celia.
2013 #
2014 #    $Conf{CgiAdminUserGroup} = '';
2015 #    $Conf{CgiAdminUsers}     = 'craig celia';
2016 #    --> administrative users are only craig and celia'.
2017 #
2018 $Conf{CgiAdminUserGroup} = '';
2019 $Conf{CgiAdminUsers}     = '';
2020
2021 #
2022 # URL of the BackupPC_Admin CGI script.  Used for email messages.
2023 #
2024 $Conf{CgiURL} = undef;
2025
2026 #   
2027 # Language to use.  See lib/BackupPC/Lang for the list of supported
2028 # languages, which include English (en), French (fr), Spanish (es),
2029 # German (de), Italian (it), Dutch (nl), Polish (pl), Portuguese
2030 # Brazillian (pt_br) and Chinese (zh_CH).
2031 #
2032 # Currently the Language setting applies to the CGI interface and email
2033 # messages sent to users.  Log files and other text are still in English.
2034 #
2035 $Conf{Language} = 'en';
2036
2037 #
2038 # User names that are rendered by the CGI interface can be turned
2039 # into links into their home page or other information about the
2040 # user.  To set this up you need to create two sprintf() strings,
2041 # that each contain a single '%s' that will be replaced by the user
2042 # name.  The default is a mailto: link.
2043 #
2044 # $Conf{CgiUserHomePageCheck} should be an absolute file path that
2045 # is used to check (via "-f") that the user has a valid home page.
2046 # Set this to undef or an empty string to turn off this check.
2047 #
2048 # $Conf{CgiUserUrlCreate} should be a full URL that points to the
2049 # user's home page.  Set this to undef or an empty string to turn
2050 # off generation of URLs for user names.
2051 #
2052 # Example:
2053 #    $Conf{CgiUserHomePageCheck} = '/var/www/html/users/%s.html';
2054 #    $Conf{CgiUserUrlCreate}     = 'http://myhost/users/%s.html';
2055 #    --> if /var/www/html/users/craig.html exists, then 'craig' will
2056 #      be rendered as a link to http://myhost/users/craig.html.
2057 #
2058 $Conf{CgiUserHomePageCheck} = '';
2059 $Conf{CgiUserUrlCreate}     = 'mailto:%s';
2060
2061 #
2062 # Date display format for CGI interface.  A value of 1 uses US-style
2063 # dates (MM/DD), a value of 2 uses full YYYY-MM-DD format, and zero
2064 # for international dates (DD/MM).
2065 #
2066 $Conf{CgiDateFormatMMDD} = 1;
2067
2068 #
2069 # If set, the complete list of hosts appears in the left navigation
2070 # bar pull-down for administrators.  Otherwise, just the hosts for which
2071 # the user is listed in the host file (as either the user or in moreUsers)
2072 # are displayed.
2073 #
2074 $Conf{CgiNavBarAdminAllHosts} = 1;
2075
2076 #
2077 # Enable/disable the search box in the navigation bar.
2078 #
2079 $Conf{CgiSearchBoxEnable} = 1;
2080
2081 #
2082 # Additional navigation bar links.  These appear for both regular users
2083 # and administrators.  This is a list of hashes giving the link (URL)
2084 # and the text (name) for the link.  Specifying lname instead of name
2085 # uses the language specific string (ie: $Lang->{lname}) instead of
2086 # just literally displaying name.
2087 #
2088 $Conf{CgiNavBarLinks} = [
2089     {
2090         link  => "?action=view&type=docs",
2091         lname => "Documentation",    # actually displays $Lang->{Documentation}
2092     },
2093     {
2094         link  => "http://backuppc.wiki.sourceforge.net",
2095         name  => "Wiki",              # displays literal "Wiki"
2096     },
2097     {
2098         link  => "http://backuppc.sourceforge.net",
2099         name  => "SourceForge",      # displays literal "SourceForge"
2100     },
2101 ];
2102
2103 #
2104 # Hilight colors based on status that are used in the PC summary page.
2105 #
2106 $Conf{CgiStatusHilightColor} = {
2107     Reason_backup_failed           => '#ffcccc',
2108     Reason_backup_done             => '#ccffcc',
2109     Reason_no_ping                 => '#ffff99',
2110     Reason_backup_canceled_by_user => '#ff9900',
2111     Status_backup_in_progress      => '#66cc99',
2112     Disabled_OnlyManualBackups     => '#d1d1d1',   
2113     Disabled_AllBackupsDisabled    => '#d1d1d1',          
2114 };
2115
2116 #
2117 # Additional CGI header text.
2118 #
2119 $Conf{CgiHeaders} = '<meta http-equiv="pragma" content="no-cache">';
2120
2121 #
2122 # Directory where images are stored.  This directory should be below
2123 # Apache's DocumentRoot.  This value isn't used by BackupPC but is
2124 # used by configure.pl when you upgrade BackupPC.
2125 #
2126 # Example:
2127 #     $Conf{CgiImageDir} = '/var/www/htdocs/BackupPC';
2128 #
2129 $Conf{CgiImageDir} = '';
2130
2131 #
2132 # Additional mappings of file name extenions to Content-Type for
2133 # individual file restore.  See $Ext2ContentType in BackupPC_Admin
2134 # for the default setting.  You can add additional settings here,
2135 # or override any default settings.  Example:
2136 #
2137 #     $Conf{CgiExt2ContentType} = {
2138 #                 'pl'  => 'text/plain',
2139 #          };
2140 #
2141 $Conf{CgiExt2ContentType} = { };
2142
2143 #
2144 # URL (without the leading http://host) for BackupPC's image directory.
2145 # The CGI script uses this value to serve up image files.
2146 #
2147 # Example:
2148 #     $Conf{CgiImageDirURL} = '/BackupPC';
2149 #
2150 $Conf{CgiImageDirURL} = '';
2151
2152 #
2153 # CSS stylesheet "skin" for the CGI interface.  It is stored
2154 # in the $Conf{CgiImageDir} directory and accessed via the
2155 # $Conf{CgiImageDirURL} URL.
2156 #
2157 # For BackupPC v3.x several color, layout and font changes were made.
2158 # The previous v2.x version is available as BackupPC_stnd_orig.css, so
2159 # if you prefer the old skin, change this to BackupPC_stnd_orig.css.
2160 #
2161 $Conf{CgiCSSFile} = 'BackupPC_stnd.css';
2162
2163 #
2164 # Whether the user is allowed to edit their per-PC config.
2165 #
2166 $Conf{CgiUserConfigEditEnable} = 1;
2167
2168 #
2169 # Which per-host config variables a non-admin user is allowed
2170 # to edit.  Admin users can edit all per-host config variables,
2171 # even if disabled in this list.
2172 #
2173 # SECURITY WARNING: Do not let users edit any of the Cmd
2174 # config variables!  That's because a user could set a
2175 # Cmd to a shell script of their choice and it will be
2176 # run as the BackupPC user.  That script could do all
2177 # sorts of bad things.
2178 #
2179 $Conf{CgiUserConfigEdit} = {
2180         FullPeriod                => 1,
2181         IncrPeriod                => 1,
2182         FullKeepCnt               => 1,
2183         FullKeepCntMin            => 1,
2184         FullAgeMax                => 1,
2185         IncrKeepCnt               => 1,
2186         IncrKeepCntMin            => 1,
2187         IncrAgeMax                => 1,
2188         IncrLevels                => 1,
2189         IncrFill                  => 1,
2190         PartialAgeMax             => 1,
2191         RestoreInfoKeepCnt        => 1,
2192         ArchiveInfoKeepCnt        => 1,
2193         BackupFilesOnly           => 1,
2194         BackupFilesExclude        => 1,
2195         BackupsDisable            => 1,
2196         BlackoutBadPingLimit      => 1,
2197         BlackoutGoodCnt           => 1,
2198         BlackoutPeriods           => 1,
2199         BackupZeroFilesIsFatal    => 1,
2200         ClientCharset             => 1,
2201         ClientCharsetLegacy       => 1,
2202         XferMethod                => 1,
2203         XferLogLevel              => 1,
2204         SmbShareName              => 1,
2205         SmbShareUserName          => 1,
2206         SmbSharePasswd            => 1,
2207         SmbClientFullCmd          => 0,
2208         SmbClientIncrCmd          => 0,
2209         SmbClientRestoreCmd       => 0,
2210         TarShareName              => 1,
2211         TarFullArgs               => 1,
2212         TarIncrArgs               => 1,
2213         TarClientCmd              => 0,
2214         TarClientRestoreCmd       => 0,
2215         TarClientPath             => 0,
2216         RsyncShareName            => 1,
2217         RsyncdClientPort          => 1,
2218         RsyncdPasswd              => 1,
2219         RsyncdUserName            => 1,
2220         RsyncdAuthRequired        => 1,
2221         RsyncCsumCacheVerifyProb  => 1,
2222         RsyncArgs                 => 1,
2223         RsyncArgsExtra            => 1,
2224         RsyncRestoreArgs          => 1,
2225         RsyncClientCmd            => 0,
2226         RsyncClientRestoreCmd     => 0,
2227         RsyncClientPath           => 0,
2228         FtpShareName              => 1,
2229         FtpUserName               => 1,
2230         FtpPasswd                 => 1,
2231         FtpBlockSize              => 1,
2232         FtpPort                   => 1,
2233         FtpTimeout                => 1,
2234         FtpFollowSymlinks         => 1,
2235         FtpRestoreEnabled         => 1,
2236         ArchiveDest               => 1,
2237         ArchiveComp               => 1,
2238         ArchivePar                => 1,
2239         ArchiveSplit              => 1,
2240         ArchiveClientCmd          => 0,
2241         FixedIPNetBiosNameCheck   => 1,
2242         NmbLookupCmd              => 0,
2243         NmbLookupFindHostCmd      => 0,
2244         PingMaxMsec               => 1,
2245         PingCmd                   => 0,
2246         ClientTimeout             => 1,
2247         MaxOldPerPCLogFiles       => 1,
2248         CompressLevel             => 1,
2249         ClientNameAlias           => 1,
2250         DumpPreUserCmd            => 0,
2251         DumpPostUserCmd           => 0,
2252         RestorePreUserCmd         => 0,
2253         RestorePostUserCmd        => 0,
2254         ArchivePreUserCmd         => 0,
2255         ArchivePostUserCmd        => 0,
2256         DumpPostShareCmd          => 0,
2257         DumpPreShareCmd           => 0,
2258         UserCmdCheckStatus        => 0,
2259         EMailNotifyMinDays        => 1,
2260         EMailFromUserName         => 1,
2261         EMailAdminUserName        => 1,
2262         EMailUserDestDomain       => 1,
2263         EMailNoBackupEverSubj     => 1,
2264         EMailNoBackupEverMesg     => 1,
2265         EMailNotifyOldBackupDays  => 1,
2266         EMailNoBackupRecentSubj   => 1,
2267         EMailNoBackupRecentMesg   => 1,
2268         EMailNotifyOldOutlookDays => 1,
2269         EMailOutlookBackupSubj    => 1,
2270         EMailOutlookBackupMesg    => 1,
2271         EMailHeaders              => 1,
2272 };
2273
2274
2275 # XXX XXX XXX XXX XXX XXX XXX
2276 # XXX support for search
2277
2278
2279 # add search database dsn
2280 #
2281 #$Conf{SearchDSN} = 'dbi:SQLite:dbname=$TopDir/search.db';
2282 $Conf{SearchDSN} = 'dbi:Pg:dbname=backuppc';
2283 $Conf{SearchUser} = 'dpavlin';
2284 #
2285
2286 # if you want to use experimental Hyper Estraier support (which require
2287 # installation of Search::Estraier perl module from CPAN) select
2288 # path to index (relative to $TopDir) or node URI
2289 # use following line to disable Hyper Estraier and prevent upgrades
2290 # from overwriting it
2291 #$Conf{SearchModule} = 'BackupPC::Search::Estraier';
2292 #$Conf{HyperEstraierIndex} = 'http://localhost:1978/node/backuppc';
2293
2294 # which search engine to use
2295 $Conf{SearchModule} = 'BackupPC::Search::KinoSearch';
2296 $Conf{KinoPath} = '/tmp/kinosearch';
2297
2298 #
2299 # temp directory for storing gzip and iso files when createing iso images
2300 #
2301 $Conf{GzipTempDir} = "$Conf{TopDir}/temp";
2302
2303 #
2304 # nameing schema for snapshots (.tar.gz will be added)
2305 # \h    - hostname
2306 # \s    - share
2307 # \n    - increment numer
2308 #
2309 $Conf{GzipSchema} = '\\h_\\s_\\n';
2310 #
2311
2312 #
2313 # archive media size (in bytes)
2314 # default: 4.2Gb for DVD
2315 #
2316 #$Conf{ArchiveMediaSize} = 4200 * 1024 * 1024;
2317
2318 #
2319 # maximum size of one (uncompressed) file on archive medium (in bytes)
2320 # default: 2Gb - 2k for DVD
2321 #$Conf{ArchiveChunkSize} = (2048 - 2) * 1024 * 1024;
2322
2323 #
2324 # Temporary directory for ISO images (relative to install dir)
2325 #
2326 $Conf{ISOTempDir} = 'temp/iso';
2327
2328 ####
2329 # configuration data for burning
2330 ####
2331 #$Conf{CDRecordBin} = 'cdrecord';
2332 #$Conf{CDRecordOpts} = 'dev=/dev/hdc blank=fast -dao -v -eject -dummy';
2333
2334 #$Conf{CDRecordBin} = 'dvdrecord';
2335 #$Conf{CDRecordOpts} = 'dev=0,0,0 -dao -v -eject -dummy';
2336
2337 # gzip level for creating tar.gz increments
2338 # default is -6, -1 is fast, -9 is slow
2339 #$Conf{GzipLevel} = '-6';
2340 $Conf{GzipLevel} = '-1';
2341
2342 # number of archive copies to burn
2343 $Conf{BurnMultipleCopies} = 2;
2344
2345 # Other command-line utilities used
2346 #$Conf{ejectBin} = 'eject';
2347 #$Conf{ejectOpts} = '/dev/cdrom';
2348 $Conf{ejectBin} = 'true';
2349 $Conf{ejectOpts} = ' ';
2350
2351
2352 # FIXME disable burning
2353 $Conf{ejectBin} = 'true';
2354 $Conf{ejectOpts} = ' ';
2355 $Conf{CDRecordBin} = 'cat';
2356 $Conf{CDRecordOpts} = '>/dev/null <';
2357
2358
2359 $Conf{mkisofsBin} = 'mkisofs';
2360
2361 # temporary path used when recovering of increments
2362 # (you might put this into tmpfs if you have enough RAM)
2363 $Conf{IncrementTempDir} = '/tmp/increment-restore/';