* Added more options to server backup command: rather than just forcing
[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-2007  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 # If a hash is used, a special key "*" means it applies to all
721 # shares that don't have a specific entry.
722 #
723 # Examples:
724 #    $Conf{BackupFilesExclude} = '/temp';
725 #    $Conf{BackupFilesExclude} = ['/temp'];     # same as first example
726 #    $Conf{BackupFilesExclude} = ['/temp', '/winnt/tmp'];
727 #    $Conf{BackupFilesExclude} = {
728 #       'c' => ['/temp', '/winnt/tmp'],         # these are for 'c' share
729 #       'd' => ['/junk', '/dont_back_this_up'], # these are for 'd' share
730 #    };
731 #    $Conf{BackupFilesExclude} = {
732 #       'c' => ['/temp', '/winnt/tmp'],         # these are for 'c' share
733 #       '*' => ['/junk', '/dont_back_this_up'], # these are for other shares
734 #    };
735 #
736 $Conf{BackupFilesExclude} = undef;
737
738 #
739 # PCs that are always or often on the network can be backed up after
740 # hours, to reduce PC, network and server load during working hours. For
741 # each PC a count of consecutive good pings is maintained. Once a PC has
742 # at least $Conf{BlackoutGoodCnt} consecutive good pings it is subject
743 # to "blackout" and not backed up during hours and days specified by
744 # $Conf{BlackoutPeriods}.
745 #
746 # To allow for periodic rebooting of a PC or other brief periods when a
747 # PC is not on the network, a number of consecutive bad pings is allowed
748 # before the good ping count is reset. This parameter is
749 # $Conf{BlackoutBadPingLimit}.
750 #
751 # Note that bad and good pings don't occur with the same interval. If a
752 # machine is always on the network, it will only be pinged roughly once
753 # every $Conf{IncrPeriod} (eg: once per day). So a setting for
754 # $Conf{BlackoutGoodCnt} of 7 means it will take around 7 days for a
755 # machine to be subject to blackout. On the other hand, if a ping is
756 # failed, it will be retried roughly every time BackupPC wakes up, eg,
757 # every one or two hours. So a setting for $Conf{BlackoutBadPingLimit} of
758 # 3 means that the PC will lose its blackout status after 3-6 hours of
759 # unavailability.
760 #
761 # To disable the blackout feature set $Conf{BlackoutGoodCnt} to a negative
762 # value.  A value of 0 will make all machines subject to blackout.  But
763 # if you don't want to do any backups during the day it would be easier
764 # to just set $Conf{WakeupSchedule} to a restricted schedule.
765 #
766 $Conf{BlackoutBadPingLimit} = 3;
767 $Conf{BlackoutGoodCnt}      = 7;
768
769 #
770 # One or more blackout periods can be specified.  If a client is
771 # subject to blackout then no regular (non-manual) backups will
772 # be started during any of these periods.  hourBegin and hourEnd
773 # specify hours fro midnight and weekDays is a list of days of
774 # the week where 0 is Sunday, 1 is Monday etc.
775 #
776 # For example:
777 #
778 #    $Conf{BlackoutPeriods} = [
779 #       {
780 #           hourBegin =>  7.0,
781 #           hourEnd   => 19.5,
782 #           weekDays  => [1, 2, 3, 4, 5],
783 #       },
784 #    ];
785 #
786 # specifies one blackout period from 7:00am to 7:30pm local time
787 # on Mon-Fri.
788 #
789 # The blackout period can also span midnight by setting
790 # hourBegin > hourEnd, eg:
791 #
792 #    $Conf{BlackoutPeriods} = [
793 #       {
794 #           hourBegin =>  7.0,
795 #           hourEnd   => 19.5,
796 #           weekDays  => [1, 2, 3, 4, 5],
797 #       },
798 #       {
799 #           hourBegin => 23,
800 #           hourEnd   =>  5,
801 #           weekDays  => [5, 6],
802 #       },
803 #    ];
804 #
805 # This specifies one blackout period from 7:00am to 7:30pm local time
806 # on Mon-Fri, and a second period from 11pm to 5am on Friday and
807 # Saturday night.
808 #
809 $Conf{BlackoutPeriods} = [
810     {
811         hourBegin =>  7.0,
812         hourEnd   => 19.5,
813         weekDays  => [1, 2, 3, 4, 5],
814     },
815 ];
816
817 #
818 # A backup of a share that has zero files is considered fatal. This is
819 # used to catch miscellaneous Xfer errors that result in no files being
820 # backed up.  If you have shares that might be empty (and therefore an
821 # empty backup is valid) you should set this flag to 0.
822 #
823 $Conf{BackupZeroFilesIsFatal} = 1;
824
825 ###########################################################################
826 # How to backup a client
827 # (can be overridden in the per-PC config.pl)
828 ###########################################################################
829 #
830 # What transport method to use to backup each host.  If you have
831 # a mixed set of WinXX and linux/unix hosts you will need to override
832 # this in the per-PC config.pl.
833 #
834 # The valid values are:
835 #
836 #   - 'smb':     backup and restore via smbclient and the SMB protocol.
837 #                Easiest choice for WinXX.
838 #
839 #   - 'rsync':   backup and restore via rsync (via rsh or ssh).
840 #                Best choice for linux/unix.  Good choice also for WinXX.
841 #
842 #   - 'rsyncd':  backup and restore via rsync daemon on the client.
843 #                Best choice for linux/unix if you have rsyncd running on
844 #                the client.  Good choice also for WinXX.
845 #
846 #   - 'tar':    backup and restore via tar, tar over ssh, rsh or nfs.
847 #               Good choice for linux/unix.
848 #
849 #   - 'archive': host is a special archive host.  Backups are not done.
850 #                An archive host is used to archive other host's backups
851 #                to permanent media, such as tape, CDR or DVD.
852 #               
853 #
854 $Conf{XferMethod} = 'smb';
855
856 #
857 # Level of verbosity in Xfer log files.  0 means be quiet, 1 will give
858 # will give one line per file, 2 will also show skipped files on
859 # incrementals, higher values give more output.
860 #
861 $Conf{XferLogLevel} = 1;
862
863 #
864 # Filename charset encoding on the client.  BackupPC uses utf8
865 # on the server for filename encoding.  If this is empty, then
866 # utf8 is assumed and client filenames will not be modified.
867 # If set to a different encoding then filenames will converted
868 # to/from utf8 automatically during backup and restore.
869 #
870 # If the file names displayed in the browser (eg: accents or special
871 # characters) don't look right then it is likely you haven't set
872 # $Conf{ClientCharset} correctly.
873 #
874 # If you are using smbclient on a WinXX machine, smbclient will convert
875 # to the "unix charset" setting in smb.conf.  The default is utf8,
876 # in which case leave $Conf{ClientCharset} empty since smbclient does
877 # the right conversion.
878 #
879 # If you are using rsync on a WinXX machine then it does no conversion.
880 # A typical WinXX encoding for latin1/western europe is 'cp1252',
881 # so in this case set $Conf{ClientCharset} to 'cp1252'.
882 #
883 # On a linux or unix client, run "locale charmap" to see the client's
884 # charset.  Set $Conf{ClientCharset} to this value.  A typical value
885 # for english/US is 'ISO-8859-1'.
886 #
887 # Do "perldoc Encode::Supported" to see the list of possible charset
888 # values.  The FAQ at http://www.cl.cam.ac.uk/~mgk25/unicode.html
889 # is excellent, and http://czyborra.com/charsets/iso8859.html
890 # provides more information on the iso-8859 charsets.
891 #
892 $Conf{ClientCharset} = '';
893
894 #
895 # Prior to 3.x no charset conversion was done by BackupPC.  Backups were
896 # stored in what ever charset the XferMethod provided - typically utf8
897 # for smbclient and the client's locale settings for rsync and tar (eg:
898 # cp1252 for rsync on WinXX and perhaps iso-8859-1 with rsync on linux).
899 # This setting tells BackupPC the charset that was used to store file
900 # names in old backups taken with BackupPC 2.x, so that non-ascii file
901 # names in old backups can be viewed and restored.
902 #
903 $Conf{ClientCharsetLegacy} = 'iso-8859-1';
904
905 ###########################################################################
906 # Samba Configuration
907 # (can be overwritten in the per-PC log file)
908 ###########################################################################
909 #
910 # Name of the host share that is backed up when using SMB.  This can be a
911 # string or an array of strings if there are multiple shares per host.
912 # Examples:
913 #
914 #   $Conf{SmbShareName} = 'c';          # backup 'c' share
915 #   $Conf{SmbShareName} = ['c', 'd'];   # backup 'c' and 'd' shares
916 #
917 # This setting only matters if $Conf{XferMethod} = 'smb'.
918 #
919 $Conf{SmbShareName} = 'C$';
920
921 #
922 # Smbclient share user name.  This is passed to smbclient's -U argument.
923 #
924 # This setting only matters if $Conf{XferMethod} = 'smb'.
925 #
926 $Conf{SmbShareUserName} = '';
927
928 #
929 # Smbclient share password.  This is passed to smbclient via its PASSWD
930 # environment variable.  There are several ways you can tell BackupPC
931 # the smb share password.  In each case you should be very careful about
932 # security.  If you put the password here, make sure that this file is
933 # not readable by regular users!  See the "Setting up config.pl" section
934 # in the documentation for more information.
935 #
936 # This setting only matters if $Conf{XferMethod} = 'smb'.
937 #
938 $Conf{SmbSharePasswd} = '';
939
940 #
941 # Full path for smbclient. Security caution: normal users should not
942 # allowed to write to this file or directory.
943 #
944 # smbclient is from the Samba distribution. smbclient is used to
945 # actually extract the incremental or full dump of the share filesystem
946 # from the PC.
947 #
948 # This setting only matters if $Conf{XferMethod} = 'smb'.
949 #
950 $Conf{SmbClientPath} = '';
951
952 #
953 # Command to run smbclient for a full dump.
954 # This setting only matters if $Conf{XferMethod} = 'smb'.
955 #
956 # The following variables are substituted at run-time:
957 #
958 #    $smbClientPath   same as $Conf{SmbClientPath}
959 #    $host            host to backup/restore
960 #    $hostIP          host IP address
961 #    $shareName       share name
962 #    $userName        user name
963 #    $fileList        list of files to backup (based on exclude/include)
964 #    $I_option        optional -I option to smbclient
965 #    $X_option        exclude option (if $fileList is an exclude list)
966 #    $timeStampFile   start time for incremental dump
967 #
968 # Note: all Cmds are executed directly without a shell, so the prog name
969 # needs to be a full path and you can't include shell syntax like
970 # redirection and pipes; put that in a script if you need it.
971 #
972 $Conf{SmbClientFullCmd} = '$smbClientPath \\\\$host\\$shareName'
973             . ' $I_option -U $userName -E -N -d 1'
974             . ' -c tarmode\\ full -Tc$X_option - $fileList';
975
976 #
977 # Command to run smbclient for an incremental dump.
978 # This setting only matters if $Conf{XferMethod} = 'smb'.
979 #
980 # Same variable substitutions are applied as $Conf{SmbClientFullCmd}.
981 #
982 # Note: all Cmds are executed directly without a shell, so the prog name
983 # needs to be a full path and you can't include shell syntax like
984 # redirection and pipes; put that in a script if you need it.
985 #
986 $Conf{SmbClientIncrCmd} = '$smbClientPath \\\\$host\\$shareName'
987             . ' $I_option -U $userName -E -N -d 1'
988             . ' -c tarmode\\ full -TcN$X_option $timeStampFile - $fileList';
989
990 #
991 # Command to run smbclient for a restore.
992 # This setting only matters if $Conf{XferMethod} = 'smb'.
993 #
994 # Same variable substitutions are applied as $Conf{SmbClientFullCmd}.
995 #
996 # If your smb share is read-only then direct restores will fail.
997 # You should set $Conf{SmbClientRestoreCmd} to undef and the
998 # corresponding CGI restore option will be removed.
999 #
1000 # Note: all Cmds are executed directly without a shell, so the prog name
1001 # needs to be a full path and you can't include shell syntax like
1002 # redirection and pipes; put that in a script if you need it.
1003 #
1004 $Conf{SmbClientRestoreCmd} = '$smbClientPath \\\\$host\\$shareName'
1005             . ' $I_option -U $userName -E -N -d 1'
1006             . ' -c tarmode\\ full -Tx -';
1007
1008 ###########################################################################
1009 # Tar Configuration
1010 # (can be overwritten in the per-PC log file)
1011 ###########################################################################
1012 #
1013 # Which host directories to backup when using tar transport.  This can be a
1014 # string or an array of strings if there are multiple directories to
1015 # backup per host.  Examples:
1016 #
1017 #   $Conf{TarShareName} = '/';                  # backup everything
1018 #   $Conf{TarShareName} = '/home';              # only backup /home
1019 #   $Conf{TarShareName} = ['/home', '/src'];    # backup /home and /src
1020 #
1021 # The fact this parameter is called 'TarShareName' is for historical
1022 # consistency with the Smb transport options.  You can use any valid
1023 # directory on the client: there is no need for it to correspond to
1024 # any Smb share or device mount point.
1025 #
1026 # Note also that you can also use $Conf{BackupFilesOnly} to specify
1027 # a specific list of directories to backup.  It's more efficient to
1028 # use this option instead of $Conf{TarShareName} since a new tar is
1029 # run for each entry in $Conf{TarShareName}.
1030 #
1031 # On the other hand, if you add --one-file-system to $Conf{TarClientCmd}
1032 # you can backup each file system separately, which makes restoring one
1033 # bad file system easier.  In this case you would list all of the mount
1034 # points here, since you can't get the same result with
1035 # $Conf{BackupFilesOnly}:
1036 #
1037 #     $Conf{TarShareName} = ['/', '/var', '/data', '/boot'];
1038 #
1039 # This setting only matters if $Conf{XferMethod} = 'tar'.
1040 #
1041 $Conf{TarShareName} = '/';
1042
1043 #
1044 # Full command to run tar on the client.  GNU tar is required.  You will
1045 # need to fill in the correct paths for ssh2 on the local host (server)
1046 # and GNU tar on the client.  Security caution: normal users should not
1047 # allowed to write to these executable files or directories.
1048 #
1049 # See the documentation for more information about setting up ssh2 keys.
1050 #
1051 # If you plan to use NFS then tar just runs locally and ssh2 is not needed.
1052 # For example, assuming the client filesystem is mounted below /mnt/hostName,
1053 # you could use something like:
1054 #
1055 #    $Conf{TarClientCmd} = '$tarPath -c -v -f - -C /mnt/$host/$shareName'
1056 #                        . ' --totals';
1057 #
1058 # In the case of NFS or rsh you need to make sure BackupPC's privileges
1059 # are sufficient to read all the files you want to backup.  Also, you
1060 # will probably want to add "/proc" to $Conf{BackupFilesExclude}.
1061 #
1062 # The following variables are substituted at run-time:
1063 #
1064 #   $host        host name
1065 #   $hostIP      host's IP address
1066 #   $incrDate    newer-than date for incremental backups
1067 #   $shareName   share name to backup (ie: top-level directory path)
1068 #   $fileList    specific files to backup or exclude
1069 #   $tarPath     same as $Conf{TarClientPath}
1070 #   $sshPath     same as $Conf{SshPath}
1071 #
1072 # If a variable is followed by a "+" it is shell escaped.  This is
1073 # necessary for the command part of ssh or rsh, since it ends up
1074 # getting passed through the shell.
1075 #
1076 # This setting only matters if $Conf{XferMethod} = 'tar'.
1077 #
1078 # Note: all Cmds are executed directly without a shell, so the prog name
1079 # needs to be a full path and you can't include shell syntax like
1080 # redirection and pipes; put that in a script if you need it.
1081 #
1082 $Conf{TarClientCmd} = '$sshPath -q -x -n -l root $host'
1083                     . ' env LC_ALL=C $tarPath -c -v -f - -C $shareName+'
1084                     . ' --totals';
1085
1086 #
1087 # Extra tar arguments for full backups.  Several variables are substituted at
1088 # run-time.  See $Conf{TarClientCmd} for the list of variable substitutions.
1089 #
1090 # If you are running tar locally (ie: without rsh or ssh) then remove the
1091 # "+" so that the argument is no longer shell escaped.
1092 #
1093 # This setting only matters if $Conf{XferMethod} = 'tar'.
1094 #
1095 $Conf{TarFullArgs} = '$fileList+';
1096
1097 #
1098 # Extra tar arguments for incr backups.  Several variables are substituted at
1099 # run-time.  See $Conf{TarClientCmd} for the list of variable substitutions.
1100 #
1101 # Note that GNU tar has several methods for specifying incremental backups,
1102 # including:
1103 #
1104 #   --newer-mtime $incrDate+
1105 #          This causes a file to be included if the modification time is
1106 #          later than $incrDate (meaning its contents might have changed).
1107 #          But changes in the ownership or modes will not qualify the
1108 #          file to be included in an incremental.
1109 #
1110 #   --newer=$incrDate+
1111 #          This causes the file to be included if any attribute of the
1112 #          file is later than $incrDate, meaning either attributes or
1113 #          the modification time.  This is the default method.  Do
1114 #          not use --atime-preserve in $Conf{TarClientCmd} above,
1115 #          otherwise resetting the atime (access time) counts as an
1116 #          attribute change, meaning the file will always be included
1117 #          in each new incremental dump.
1118 #
1119 # If you are running tar locally (ie: without rsh or ssh) then remove the
1120 # "+" so that the argument is no longer shell escaped.
1121 #
1122 # This setting only matters if $Conf{XferMethod} = 'tar'.
1123 #
1124 $Conf{TarIncrArgs} = '--newer=$incrDate+ $fileList+';
1125
1126 #
1127 # Full command to run tar for restore on the client.  GNU tar is required.
1128 # This can be the same as $Conf{TarClientCmd}, with tar's -c replaced by -x
1129 # and ssh's -n removed.
1130 #
1131 # See $Conf{TarClientCmd} for full details.
1132 #
1133 # This setting only matters if $Conf{XferMethod} = "tar".
1134 #
1135 # If you want to disable direct restores using tar, you should set
1136 # $Conf{TarClientRestoreCmd} to undef and the corresponding CGI
1137 # restore option will be removed.
1138 #
1139 # Note: all Cmds are executed directly without a shell, so the prog name
1140 # needs to be a full path and you can't include shell syntax like
1141 # redirection and pipes; put that in a script if you need it.
1142 #
1143 $Conf{TarClientRestoreCmd} = '$sshPath -q -x -l root $host'
1144                    . ' env LC_ALL=C $tarPath -x -p --numeric-owner --same-owner'
1145                    . ' -v -f - -C $shareName+';
1146
1147 #
1148 # Full path for tar on the client. Security caution: normal users should not
1149 # allowed to write to this file or directory.
1150 #
1151 # This setting only matters if $Conf{XferMethod} = 'tar'.
1152 #
1153 $Conf{TarClientPath} = '';
1154
1155 ###########################################################################
1156 # Rsync/Rsyncd Configuration
1157 # (can be overwritten in the per-PC log file)
1158 ###########################################################################
1159 #
1160 # Path to rsync executable on the client
1161 #
1162 $Conf{RsyncClientPath} = '';
1163
1164 #
1165 # Full command to run rsync on the client machine.  The following variables
1166 # are substituted at run-time:
1167 #
1168 #        $host           host name being backed up
1169 #        $hostIP         host's IP address
1170 #        $shareName      share name to backup (ie: top-level directory path)
1171 #        $rsyncPath      same as $Conf{RsyncClientPath}
1172 #        $sshPath        same as $Conf{SshPath}
1173 #        $argList        argument list, built from $Conf{RsyncArgs},
1174 #                        $shareName, $Conf{BackupFilesExclude} and
1175 #                        $Conf{BackupFilesOnly}
1176 #
1177 # This setting only matters if $Conf{XferMethod} = 'rsync'.
1178 #
1179 $Conf{RsyncClientCmd} = '$sshPath -q -x -l root $host $rsyncPath $argList+';
1180
1181 #
1182 # Full command to run rsync for restore on the client.  The following
1183 # variables are substituted at run-time:
1184 #
1185 #        $host           host name being backed up
1186 #        $hostIP         host's IP address
1187 #        $shareName      share name to backup (ie: top-level directory path)
1188 #        $rsyncPath      same as $Conf{RsyncClientPath}
1189 #        $sshPath        same as $Conf{SshPath}
1190 #        $argList        argument list, built from $Conf{RsyncArgs},
1191 #                        $shareName, $Conf{BackupFilesExclude} and
1192 #                        $Conf{BackupFilesOnly}
1193 #
1194 # This setting only matters if $Conf{XferMethod} = 'rsync'.
1195 #
1196 # Note: all Cmds are executed directly without a shell, so the prog name
1197 # needs to be a full path and you can't include shell syntax like
1198 # redirection and pipes; put that in a script if you need it.
1199 #
1200 $Conf{RsyncClientRestoreCmd} = '$sshPath -q -x -l root $host $rsyncPath $argList+';
1201
1202 #
1203 # Share name to backup.  For $Conf{XferMethod} = "rsync" this should
1204 # be a file system path, eg '/' or '/home'.
1205 #
1206 # For $Conf{XferMethod} = "rsyncd" this should be the name of the module
1207 # to backup (ie: the name from /etc/rsynd.conf).
1208 #
1209 # This can also be a list of multiple file system paths or modules.
1210 # For example, by adding --one-file-system to $Conf{RsyncArgs} you
1211 # can backup each file system separately, which makes restoring one
1212 # bad file system easier.  In this case you would list all of the mount
1213 # points:
1214 #
1215 #     $Conf{RsyncShareName} = ['/', '/var', '/data', '/boot'];
1216 #
1217 $Conf{RsyncShareName} = '/';
1218
1219 #
1220 # Rsync daemon port on the client, for $Conf{XferMethod} = "rsyncd".
1221 #
1222 $Conf{RsyncdClientPort} = 873;
1223
1224 #
1225 # Rsync daemon user name on client, for $Conf{XferMethod} = "rsyncd".
1226 # The user name and password are stored on the client in whatever file
1227 # the "secrets file" parameter in rsyncd.conf points to
1228 # (eg: /etc/rsyncd.secrets).
1229 #
1230 $Conf{RsyncdUserName} = '';
1231
1232 #
1233 # Rsync daemon user name on client, for $Conf{XferMethod} = "rsyncd".
1234 # The user name and password are stored on the client in whatever file
1235 # the "secrets file" parameter in rsyncd.conf points to
1236 # (eg: /etc/rsyncd.secrets).
1237 #
1238 $Conf{RsyncdPasswd} = '';
1239
1240 #
1241 # Whether authentication is mandatory when connecting to the client's
1242 # rsyncd.  By default this is on, ensuring that BackupPC will refuse to
1243 # connect to an rsyncd on the client that is not password protected.
1244 # Turn off at your own risk.
1245 #
1246 $Conf{RsyncdAuthRequired} = 1;
1247
1248 #
1249 # When rsync checksum caching is enabled (by adding the
1250 # --checksum-seed=32761 option to $Conf{RsyncArgs}), the cached
1251 # checksums can be occasionally verified to make sure the file
1252 # contents matches the cached checksums.  This is to avoid the
1253 # risk that disk problems might cause the pool file contents to
1254 # get corrupted, but the cached checksums would make BackupPC
1255 # think that the file still matches the client.
1256 #
1257 # This setting is the probability (0 means never and 1 means always)
1258 # that a file will be rechecked.  Setting it to 0 means the checksums
1259 # will not be rechecked (unless there is a phase 0 failure).  Setting
1260 # it to 1 (ie: 100%) means all files will be checked, but that is
1261 # not a desirable setting since you are better off simply turning
1262 # caching off (ie: remove the --checksum-seed option).
1263 #   
1264 # The default of 0.01 means 1% (on average) of the files during a full
1265 # backup will have their cached checksum re-checked.
1266 #   
1267 # This setting has no effect unless checksum caching is turned on.
1268 #   
1269 $Conf{RsyncCsumCacheVerifyProb} = 0.01;
1270
1271 #
1272 # Arguments to rsync for backup.  Do not edit the first set unless you
1273 # have a thorough understanding of how File::RsyncP works.
1274 #
1275 $Conf{RsyncArgs} = [
1276             #
1277             # Do not edit these!
1278             #
1279             '--numeric-ids',
1280             '--perms',
1281             '--owner',
1282             '--group',
1283             '-D',
1284             '--links',
1285             '--hard-links',
1286             '--times',
1287             '--block-size=2048',
1288             '--recursive',
1289
1290             #
1291             # Rsync >= 2.6.3 supports the --checksum-seed option
1292             # which allows rsync checksum caching on the server.
1293             # Uncomment this to enable rsync checksum caching if
1294             # you have a recent client rsync version and you want
1295             # to enable checksum caching.
1296             #
1297             #'--checksum-seed=32761',
1298 ];
1299
1300 #
1301 # Additional arguments added to RsyncArgs.  This can be used in
1302 # conbination with $Conf{RsyncArgs} to allow customization of
1303 # the rsync arguments on a part-client basis.  The standard
1304 # arguments go in $Conf{RsyncArgs} and $Conf{RsyncArgsExtra}
1305 # can be set on a per-client basis.
1306 #
1307 # Examples of additional arguments that should work are --exclude/--include,
1308 # eg:
1309 #
1310 #     $Conf{RsyncArgsExtra} = [
1311 #           '--exclude', '/proc',
1312 #           '--exclude', '*.tmp',
1313 #     ];
1314 #
1315 # Both $Conf{RsyncArgs} and $Conf{RsyncArgsExtra} are subject
1316 # to the following variable substitutions:
1317 #
1318 #        $client       client name being backed up
1319 #        $host         host name (could be different from client name if
1320 #                                 $Conf{ClientNameAlias} is set)
1321 #        $hostIP       IP address of host
1322 #        $confDir      configuration directory path
1323 #
1324 # This allows settings of the form:
1325 #
1326 #     $Conf{RsyncArgsExtra} = [
1327 #             '--exclude-from=$confDir/pc/$host.exclude',
1328 #     ];
1329 #
1330 $Conf{RsyncArgsExtra} = [];
1331
1332 #
1333 # Arguments to rsync for restore.  Do not edit the first set unless you
1334 # have a thorough understanding of how File::RsyncP works.
1335 #
1336 # If you want to disable direct restores using rsync (eg: is the module
1337 # is read-only), you should set $Conf{RsyncRestoreArgs} to undef and
1338 # the corresponding CGI restore option will be removed.
1339 #
1340 # $Conf{RsyncRestoreArgs} is subject to the following variable
1341 # substitutions:
1342 #
1343 #        $client       client name being backed up
1344 #        $host         host name (could be different from client name if
1345 #                                 $Conf{ClientNameAlias} is set)
1346 #        $hostIP       IP address of host
1347 #        $confDir      configuration directory path
1348 #
1349 # Note: $Conf{RsyncArgsExtra} doesn't apply to $Conf{RsyncRestoreArgs}.
1350 #
1351 $Conf{RsyncRestoreArgs} = [
1352             #
1353             # Do not edit these!
1354             #
1355             '--numeric-ids',
1356             '--perms',
1357             '--owner',
1358             '--group',
1359             '-D',
1360             '--links',
1361             '--hard-links',
1362             '--times',
1363             '--block-size=2048',
1364             '--relative',
1365             '--ignore-times',
1366             '--recursive',
1367
1368             #
1369             # Rsync >= 2.6.3 supports the --checksum-seed option
1370             # which allows rsync checksum caching on the server.
1371             # Uncomment this to enable rsync checksum caching if
1372             # you have a recent client rsync version and you want
1373             # to enable checksum caching.
1374             #
1375             #'--checksum-seed=32761',
1376
1377             #
1378             # Add additional arguments here
1379             #
1380 ];
1381
1382 ###########################################################################
1383 # FTP Configuration
1384 # (can be overwritten in the per-PC log file)
1385 ##########################################################################
1386 #
1387 # Name of the host share that is backed up when using FTP.  This can be a
1388 # string or an array of strings if there are multiple shares per host.
1389 # Examples:
1390 #
1391 #   $Conf{FtpShareName} = 'c';          # backup 'c' share
1392 #   $Conf{FtpShareName} = ['c', 'd'];   # backup 'c' and 'd' shares
1393 #
1394 # This setting only matters if $Conf{XferMethod} = 'ftp'.
1395 #
1396 $Conf{FtpShareName} = '';
1397
1398 #
1399 # FTP user name.  This is used to log into the server.
1400 #
1401 # This setting is used only if $Conf{XferMethod} = 'ftp'.
1402 #
1403 $Conf{FtpUserName} = '';
1404
1405 #
1406 # FTP user password.  This is used to log into the server.
1407 #
1408 # This setting is used only if $Conf{XferMethod} = 'ftp'.
1409 #
1410 $Conf{FtpPasswd} = '';
1411
1412 #
1413 # Transfer block size. This sets the size of the amounts of data in
1414 # each frame. While undefined, this value takes the default value.
1415 #
1416 # This setting is used only if $Conf{XferMethod} = 'ftp'.
1417 #
1418 $Conf{FtpBlockSize} = 10240;
1419
1420 #
1421 # The port of the ftp server.  If undefined, 21 is used.
1422 #
1423 # This setting is used only if $Conf{XferMethod} = 'ftp'.
1424 #
1425 $Conf{FtpPort} = 21;
1426
1427 #
1428 # Connection timeout for FTP.  When undefined, the default is 120 seconds.
1429 #
1430 # This setting is used only if $Conf{XferMethod} = 'ftp'.
1431 #
1432 $Conf{FtpTimeout} = 120;
1433
1434 #
1435 # Behaviour when BackupPC encounters symlinks on the FTP share.
1436 #
1437 # Symlinks cannot be restored via FTP, so the desired behaviour will
1438 # be different depending on the setup of the share. The default for
1439 # this behavor is 1.  Directory shares with more complicated directory
1440 # structures should consider other protocols.
1441 #
1442 $Conf{FtpFollowSymlinks} = 0;
1443
1444 #
1445 # Direct restore enabling for FTP.
1446 #
1447 # Currently set to 0 since restore functionality is incomplete.
1448 #
1449 $Conf{FtpRestoreEnabled} = 0;
1450
1451 ###########################################################################
1452 # Archive Configuration
1453 # (can be overwritten in the per-PC log file)
1454 ###########################################################################
1455 #
1456 # Archive Destination
1457 #
1458 # The Destination of the archive
1459 # e.g. /tmp for file archive or /dev/nst0 for device archive
1460 #
1461 $Conf{ArchiveDest} = '/tmp';
1462
1463 #
1464 # Archive Compression type
1465 #
1466 # The valid values are:
1467 #
1468 #   - 'none':  No Compression
1469 #
1470 #   - 'gzip':  Medium Compression. Recommended.
1471 #
1472 #   - 'bzip2': High Compression but takes longer.
1473 #
1474 $Conf{ArchiveComp} = 'gzip';
1475
1476 #
1477 # Archive Parity Files
1478 #
1479 # The amount of Parity data to generate, as a percentage
1480 # of the archive size.
1481 # Uses the commandline par2 (par2cmdline) available from
1482 # http://parchive.sourceforge.net
1483 #
1484 # Only useful for file dumps.
1485 #
1486 # Set to 0 to disable this feature.
1487 #
1488 $Conf{ArchivePar} = 0;
1489
1490 #
1491 # Archive Size Split
1492 #
1493 # Only for file archives. Splits the output into 
1494 # the specified size * 1,000,000.
1495 # e.g. to split into 650,000,000 bytes, specify 650 below.
1496
1497 # If the value is 0, or if $Conf{ArchiveDest} is an existing file or
1498 # device (e.g. a streaming tape drive), this feature is disabled.
1499 #
1500 $Conf{ArchiveSplit} = 0;
1501
1502 #
1503 # Archive Command
1504 #
1505 # This is the command that is called to actually run the archive process
1506 # for each host.  The following variables are substituted at run-time:
1507 #
1508 #   $Installdir    The installation directory of BackupPC
1509 #   $tarCreatePath The path to BackupPC_tarCreate
1510 #   $splitpath     The path to the split program
1511 #   $parpath       The path to the par2 program
1512 #   $host          The host to archive
1513 #   $backupnumber  The backup number of the host to archive
1514 #   $compression   The path to the compression program
1515 #   $compext       The extension assigned to the compression type
1516 #   $splitsize     The number of bytes to split archives into
1517 #   $archiveloc    The location to put the archive
1518 #   $parfile       The amount of parity data to create (percentage)
1519 #
1520 # Note: all Cmds are executed directly without a shell, so the prog name
1521 # needs to be a full path and you can't include shell syntax like
1522 # redirection and pipes; put that in a script if you need it.
1523 #
1524 $Conf{ArchiveClientCmd} = '$Installdir/bin/BackupPC_archiveHost'
1525         . ' $tarCreatePath $splitpath $parpath $host $backupnumber'
1526         . ' $compression $compext $splitsize $archiveloc $parfile *';
1527
1528 #
1529 # Full path for ssh. Security caution: normal users should not
1530 # allowed to write to this file or directory.
1531 #
1532 $Conf{SshPath} = '';
1533
1534 #
1535 # Full path for nmblookup. Security caution: normal users should not
1536 # allowed to write to this file or directory.
1537 #
1538 # nmblookup is from the Samba distribution. nmblookup is used to get the
1539 # netbios name, necessary for DHCP hosts.
1540 #
1541 $Conf{NmbLookupPath} = '';
1542
1543 #
1544 # NmbLookup command.  Given an IP address, does an nmblookup on that
1545 # IP address.  The following variables are substituted at run-time:
1546 #
1547 #   $nmbLookupPath      path to nmblookup ($Conf{NmbLookupPath})
1548 #   $host               IP address
1549 #
1550 # This command is only used for DHCP hosts: given an IP address, this
1551 # command should try to find its NetBios name.
1552 #
1553 # Note: all Cmds are executed directly without a shell, so the prog name
1554 # needs to be a full path and you can't include shell syntax like
1555 # redirection and pipes; put that in a script if you need it.
1556 #
1557 $Conf{NmbLookupCmd} = '$nmbLookupPath -A $host';
1558
1559 #
1560 # NmbLookup command.  Given a netbios name, finds that host by doing
1561 # a NetBios lookup.  Several variables are substituted at run-time:
1562 #
1563 #   $nmbLookupPath      path to nmblookup ($Conf{NmbLookupPath})
1564 #   $host               NetBios name
1565 #
1566 # In some cases you might need to change the broadcast address, for
1567 # example if nmblookup uses 192.168.255.255 by default and you find
1568 # that doesn't work, try 192.168.1.255 (or your equivalent class C
1569 # address) using the -B option:
1570 #
1571 #    $Conf{NmbLookupFindHostCmd} = '$nmbLookupPath -B 192.168.1.255 $host';
1572 #
1573 # If you use a WINS server and your machines don't respond to
1574 # multicast NetBios requests you can use this (replace 1.2.3.4
1575 # with the IP address of your WINS server):
1576 #
1577 #    $Conf{NmbLookupFindHostCmd} = '$nmbLookupPath -R -U 1.2.3.4 $host';
1578 #
1579 # This is preferred over multicast since it minimizes network traffic.
1580 #
1581 # Experiment manually for your site to see what form of nmblookup command
1582 # works.
1583 #
1584 # Note: all Cmds are executed directly without a shell, so the prog name
1585 # needs to be a full path and you can't include shell syntax like
1586 # redirection and pipes; put that in a script if you need it.
1587 #
1588 $Conf{NmbLookupFindHostCmd} = '$nmbLookupPath $host';
1589
1590 #
1591 # For fixed IP address hosts, BackupPC_dump can also verify the netbios
1592 # name to ensure it matches the host name.  An error is generated if
1593 # they do not match.  Typically this flag is off.  But if you are going
1594 # to transition a bunch of machines from fixed host addresses to DHCP,
1595 # setting this flag is a great way to verify that the machines have
1596 # their netbios name set correctly before turning on DCHP.
1597 #
1598 $Conf{FixedIPNetBiosNameCheck} = 0;
1599
1600 #
1601 # Full path to the ping command.  Security caution: normal users
1602 # should not be allowed to write to this file or directory.
1603 #
1604 # If you want to disable ping checking, set this to some program
1605 # that exits with 0 status, eg:
1606 #
1607 #     $Conf{PingPath} = '/bin/echo';
1608 #
1609 $Conf{PingPath} = '';
1610
1611 #
1612 # Ping command.  The following variables are substituted at run-time:
1613 #
1614 #   $pingPath      path to ping ($Conf{PingPath})
1615 #   $host          host name
1616 #
1617 # Wade Brown reports that on solaris 2.6 and 2.7 ping -s returns the wrong
1618 # exit status (0 even on failure).  Replace with "ping $host 1", which
1619 # gets the correct exit status but we don't get the round-trip time.
1620 #
1621 # Note: all Cmds are executed directly without a shell, so the prog name
1622 # needs to be a full path and you can't include shell syntax like
1623 # redirection and pipes; put that in a script if you need it.
1624 #
1625 $Conf{PingCmd} = '$pingPath -c 1 $host';
1626
1627 #
1628 # Maximum round-trip ping time in milliseconds.  This threshold is set
1629 # to avoid backing up PCs that are remotely connected through WAN or
1630 # dialup connections.  The output from ping -s (assuming it is supported
1631 # on your system) is used to check the round-trip packet time.  On your
1632 # local LAN round-trip times should be much less than 20msec.  On most
1633 # WAN or dialup connections the round-trip time will be typically more
1634 # than 20msec.  Tune if necessary.
1635 #
1636 $Conf{PingMaxMsec} = 20;
1637
1638 #
1639 # Compression level to use on files.  0 means no compression.  Compression
1640 # levels can be from 1 (least cpu time, slightly worse compression) to
1641 # 9 (most cpu time, slightly better compression).  The recommended value
1642 # is 3.  Changing to 5, for example, will take maybe 20% more cpu time
1643 # and will get another 2-3% additional compression. See the zlib
1644 # documentation for more information about compression levels.
1645 #
1646 # Changing compression on or off after backups have already been done
1647 # will require both compressed and uncompressed pool files to be stored.
1648 # This will increase the pool storage requirements, at least until all
1649 # the old backups expire and are deleted.
1650 #
1651 # It is ok to change the compression value (from one non-zero value to
1652 # another non-zero value) after dumps are already done.  Since BackupPC
1653 # matches pool files by comparing the uncompressed versions, it will still
1654 # correctly match new incoming files against existing pool files.  The
1655 # new compression level will take effect only for new files that are
1656 # newly compressed and added to the pool.
1657 #
1658 # If compression was off and you are enabling compression for the first
1659 # time you can use the BackupPC_compressPool utility to compress the
1660 # pool.  This avoids having the pool grow to accommodate both compressed
1661 # and uncompressed backups.  See the documentation for more information.
1662 #
1663 # Note: compression needs the Compress::Zlib perl library.  If the
1664 # Compress::Zlib library can't be found then $Conf{CompressLevel} is
1665 # forced to 0 (compression off).
1666 #
1667 $Conf{CompressLevel} = 0;
1668
1669 #
1670 # Timeout in seconds when listening for the transport program's
1671 # (smbclient, tar etc) stdout. If no output is received during this
1672 # time, then it is assumed that something has wedged during a backup,
1673 # and the backup is terminated.
1674 #
1675 # Note that stdout buffering combined with huge files being backed up
1676 # could cause longish delays in the output from smbclient that
1677 # BackupPC_dump sees, so in rare cases you might want to increase
1678 # this value.
1679 #
1680 # Despite the name, this parameter sets the timeout for all transport
1681 # methods (tar, smb etc).
1682 #
1683 $Conf{ClientTimeout} = 72000;
1684
1685 #
1686 # Maximum number of log files we keep around in each PC's directory
1687 # (ie: pc/$host).  These files are aged monthly.  A setting of 12
1688 # means there will be at most the files LOG, LOG.0, LOG.1, ... LOG.11
1689 # in the pc/$host directory (ie: about a years worth).  (Except this
1690 # month's LOG, these files will have a .z extension if compression
1691 # is on).
1692 #
1693 # If you decrease this number after BackupPC has been running for a
1694 # while you will have to manually remove the older log files.
1695 #
1696 $Conf{MaxOldPerPCLogFiles} = 12;
1697
1698 #
1699 # Optional commands to run before and after dumps and restores,
1700 # and also before and after each share of a dump.
1701 #
1702 # Stdout from these commands will be written to the Xfer (or Restore)
1703 # log file.  One example of using these commands would be to
1704 # shut down and restart a database server, dump a database
1705 # to files for backup, or doing a snapshot of a share prior
1706 # to a backup.  Example:
1707 #
1708 #    $Conf{DumpPreUserCmd} = '$sshPath -q -x -l root $host /usr/bin/dumpMysql';
1709 #
1710 # The following variable substitutions are made at run time for
1711 # $Conf{DumpPreUserCmd}, $Conf{DumpPostUserCmd}, $Conf{DumpPreShareCmd}
1712 # and $Conf{DumpPostShareCmd}:
1713 #
1714 #        $type         type of dump (incr or full)
1715 #        $xferOK       1 if the dump succeeded, 0 if it didn't
1716 #        $client       client name being backed up
1717 #        $host         host name (could be different from client name if
1718 #                                 $Conf{ClientNameAlias} is set)
1719 #        $hostIP       IP address of host
1720 #        $user         user name from the hosts file
1721 #        $moreUsers    list of additional users from the hosts file
1722 #        $share        the first share name (or current share for
1723 #                        $Conf{DumpPreShareCmd} and $Conf{DumpPostShareCmd})
1724 #        $shares       list of all the share names
1725 #        $XferMethod   value of $Conf{XferMethod} (eg: tar, rsync, smb)
1726 #        $sshPath      value of $Conf{SshPath},
1727 #        $cmdType      set to DumpPreUserCmd or DumpPostUserCmd
1728 #
1729 # The following variable substitutions are made at run time for
1730 # $Conf{RestorePreUserCmd} and $Conf{RestorePostUserCmd}:
1731 #
1732 #        $client       client name being backed up
1733 #        $xferOK       1 if the restore succeeded, 0 if it didn't
1734 #        $host         host name (could be different from client name if
1735 #                                 $Conf{ClientNameAlias} is set)
1736 #        $hostIP       IP address of host
1737 #        $user         user name from the hosts file
1738 #        $moreUsers    list of additional users from the hosts file
1739 #        $share        the first share name
1740 #        $XferMethod   value of $Conf{XferMethod} (eg: tar, rsync, smb)
1741 #        $sshPath      value of $Conf{SshPath},
1742 #        $type         set to "restore"
1743 #        $bkupSrcHost  host name of the restore source
1744 #        $bkupSrcShare share name of the restore source
1745 #        $bkupSrcNum   backup number of the restore source
1746 #        $pathHdrSrc   common starting path of restore source
1747 #        $pathHdrDest  common starting path of destination
1748 #        $fileList     list of files being restored
1749 #        $cmdType      set to RestorePreUserCmd or RestorePostUserCmd
1750 #
1751 # The following variable substitutions are made at run time for
1752 # $Conf{ArchivePreUserCmd} and $Conf{ArchivePostUserCmd}:
1753 #
1754 #        $client       client name being backed up
1755 #        $xferOK       1 if the archive succeeded, 0 if it didn't
1756 #        $host         Name of the archive host
1757 #        $user         user name from the hosts file
1758 #        $share        the first share name
1759 #        $XferMethod   value of $Conf{XferMethod} (eg: tar, rsync, smb)
1760 #        $HostList     list of hosts being archived
1761 #        $BackupList   list of backup numbers for the hosts being archived
1762 #        $archiveloc   location where the archive is sent to
1763 #        $parfile      amount of parity data being generated (percentage)
1764 #        $compression  compression program being used (eg: cat, gzip, bzip2)
1765 #        $compext      extension used for compression type (eg: raw, gz, bz2)
1766 #        $splitsize    size of the files that the archive creates
1767 #        $sshPath      value of $Conf{SshPath},
1768 #        $type         set to "archive"
1769 #        $cmdType      set to ArchivePreUserCmd or ArchivePostUserCmd
1770 #
1771 # Note: all Cmds are executed directly without a shell, so the prog name
1772 # needs to be a full path and you can't include shell syntax like
1773 # redirection and pipes; put that in a script if you need it.
1774 #
1775 $Conf{DumpPreUserCmd}     = undef;
1776 $Conf{DumpPostUserCmd}    = undef;
1777 $Conf{DumpPreShareCmd}    = undef;
1778 $Conf{DumpPostShareCmd}   = undef;
1779 $Conf{RestorePreUserCmd}  = undef;
1780 $Conf{RestorePostUserCmd} = undef;
1781 $Conf{ArchivePreUserCmd}  = undef;
1782 $Conf{ArchivePostUserCmd} = undef;
1783
1784 #
1785 # Whether the exit status of each PreUserCmd and
1786 # PostUserCmd is checked.
1787 #
1788 # If set and the Dump/Restore/Archive Pre/Post UserCmd
1789 # returns a non-zero exit status then the dump/restore/archive
1790 # is aborted.  To maintain backward compatibility (where
1791 # the exit status in early versions was always ignored),
1792 # this flag defaults to 0.
1793 #
1794 # If this flag is set and the Dump/Restore/Archive PreUserCmd
1795 # fails then the matching Dump/Restore/Archive PostUserCmd is
1796 # not executed.  If DumpPreShareCmd returns a non-exit status,
1797 # then DumpPostShareCmd is not executed, but the DumpPostUserCmd
1798 # is still run (since DumpPreUserCmd must have previously
1799 # succeeded).
1800 #
1801 # An example of a DumpPreUserCmd that might fail is a script
1802 # that snapshots or dumps a database which fails because
1803 # of some database error.
1804 #
1805 $Conf{UserCmdCheckStatus} = 0;
1806
1807 #
1808 # Override the client's host name.  This allows multiple clients
1809 # to all refer to the same physical host.  This should only be
1810 # set in the per-PC config file and is only used by BackupPC at
1811 # the last moment prior to generating the command used to backup
1812 # that machine (ie: the value of $Conf{ClientNameAlias} is invisible
1813 # everywhere else in BackupPC).  The setting can be a host name or
1814 # IP address, eg:
1815 #
1816 #         $Conf{ClientNameAlias} = 'realHostName';
1817 #         $Conf{ClientNameAlias} = '192.1.1.15';
1818 #
1819 # will cause the relevant smb/tar/rsync backup/restore commands to be
1820 # directed to realHostName, not the client name.
1821 #
1822 # Note: this setting doesn't work for hosts with DHCP set to 1.
1823 #
1824 $Conf{ClientNameAlias} = undef;
1825
1826 ###########################################################################
1827 # Email reminders, status and messages
1828 # (can be overridden in the per-PC config.pl)
1829 ###########################################################################
1830 #
1831 # Full path to the sendmail command.  Security caution: normal users
1832 # should not allowed to write to this file or directory.
1833 #
1834 $Conf{SendmailPath} = '';
1835
1836 #
1837 # Minimum period between consecutive emails to a single user.
1838 # This tries to keep annoying email to users to a reasonable
1839 # level.  Email checks are done nightly, so this number is effectively
1840 # rounded up (ie: 2.5 means a user will never receive email more
1841 # than once every 3 days).
1842 #
1843 $Conf{EMailNotifyMinDays} = 2.5;
1844
1845 #
1846 # Name to use as the "from" name for email.  Depending upon your mail
1847 # handler this is either a plain name (eg: "admin") or a fully-qualified
1848 # name (eg: "admin@mydomain.com").
1849 #
1850 $Conf{EMailFromUserName} = '';
1851
1852 #
1853 # Destination address to an administrative user who will receive a
1854 # nightly email with warnings and errors.  If there are no warnings
1855 # or errors then no email will be sent.  Depending upon your mail
1856 # handler this is either a plain name (eg: "admin") or a fully-qualified
1857 # name (eg: "admin@mydomain.com").
1858 #
1859 $Conf{EMailAdminUserName} = '';
1860
1861 #
1862 # Destination domain name for email sent to users.  By default
1863 # this is empty, meaning email is sent to plain, unqualified
1864 # addresses.  Otherwise, set it to the destintation domain, eg:
1865 #
1866 #    $Cong{EMailUserDestDomain} = '@mydomain.com';
1867 #
1868 # With this setting user email will be set to 'user@mydomain.com'.
1869 #
1870 $Conf{EMailUserDestDomain} = '';
1871
1872 #
1873 # This subject and message is sent to a user if their PC has never been
1874 # backed up.
1875 #
1876 # These values are language-dependent.  The default versions can be
1877 # found in the language file (eg: lib/BackupPC/Lang/en.pm).  If you
1878 # need to change the message, copy it here and edit it, eg:
1879 #
1880 #   $Conf{EMailNoBackupEverMesg} = <<'EOF';
1881 #   To: $user$domain
1882 #   cc:
1883 #   Subject: $subj
1884 #   
1885 #   Dear $userName,
1886 #   
1887 #   This is a site-specific email message.
1888 #   EOF
1889 #
1890 $Conf{EMailNoBackupEverSubj} = undef;
1891 $Conf{EMailNoBackupEverMesg} = undef;
1892
1893 #
1894 # How old the most recent backup has to be before notifying user.
1895 # When there have been no backups in this number of days the user
1896 # is sent an email.
1897 #
1898 $Conf{EMailNotifyOldBackupDays} = 7.0;
1899
1900 #
1901 # This subject and message is sent to a user if their PC has not recently
1902 # been backed up (ie: more than $Conf{EMailNotifyOldBackupDays} days ago).
1903 #
1904 # These values are language-dependent.  The default versions can be
1905 # found in the language file (eg: lib/BackupPC/Lang/en.pm).  If you
1906 # need to change the message, copy it here and edit it, eg:
1907 #
1908 #   $Conf{EMailNoBackupRecentMesg} = <<'EOF';
1909 #   To: $user$domain
1910 #   cc:
1911 #   Subject: $subj
1912 #   
1913 #   Dear $userName,
1914 #   
1915 #   This is a site-specific email message.
1916 #   EOF
1917 #
1918 $Conf{EMailNoBackupRecentSubj} = undef;
1919 $Conf{EMailNoBackupRecentMesg} = undef;
1920
1921 #
1922 # How old the most recent backup of Outlook files has to be before
1923 # notifying user.
1924 #
1925 $Conf{EMailNotifyOldOutlookDays} = 5.0;
1926
1927 #
1928 # This subject and message is sent to a user if their Outlook files have
1929 # not recently been backed up (ie: more than $Conf{EMailNotifyOldOutlookDays}
1930 # days ago).
1931 #
1932 # These values are language-dependent.  The default versions can be
1933 # found in the language file (eg: lib/BackupPC/Lang/en.pm).  If you
1934 # need to change the message, copy it here and edit it, eg:
1935 #
1936 #   $Conf{EMailOutlookBackupMesg} = <<'EOF';
1937 #   To: $user$domain
1938 #   cc:
1939 #   Subject: $subj
1940 #   
1941 #   Dear $userName,
1942 #   
1943 #   This is a site-specific email message.
1944 #   EOF
1945 #
1946 $Conf{EMailOutlookBackupSubj} = undef;
1947 $Conf{EMailOutlookBackupMesg} = undef;
1948
1949 #
1950 # Additional email headers.  This sets to charset to
1951 # utf8.
1952 #
1953 $Conf{EMailHeaders} = <<EOF;
1954 MIME-Version: 1.0
1955 Content-Type: text/plain; charset="utf-8"
1956 EOF
1957
1958 ###########################################################################
1959 # CGI user interface configuration settings
1960 # (can be overridden in the per-PC config.pl)
1961 ###########################################################################
1962 #
1963 # Normal users can only access information specific to their host.
1964 # They can start/stop/browse/restore backups.
1965 #
1966 # Administrative users have full access to all hosts, plus overall
1967 # status and log information.
1968 #
1969 # The administrative users are the union of the unix/linux group
1970 # $Conf{CgiAdminUserGroup} and the manual list of users, separated
1971 # by spaces, in $Conf{CgiAdminUsers}. If you don't want a group or
1972 # manual list of users set the corresponding configuration setting
1973 # to undef or an empty string.
1974 #
1975 # If you want every user to have admin privileges (careful!), set
1976 # $Conf{CgiAdminUsers} = '*'.
1977 #
1978 # Examples:
1979 #    $Conf{CgiAdminUserGroup} = 'admin';
1980 #    $Conf{CgiAdminUsers}     = 'craig celia';
1981 #    --> administrative users are the union of group admin, plus
1982 #      craig and celia.
1983 #
1984 #    $Conf{CgiAdminUserGroup} = '';
1985 #    $Conf{CgiAdminUsers}     = 'craig celia';
1986 #    --> administrative users are only craig and celia'.
1987 #
1988 $Conf{CgiAdminUserGroup} = '';
1989 $Conf{CgiAdminUsers}     = '';
1990
1991 #
1992 # URL of the BackupPC_Admin CGI script.  Used for email messages.
1993 #
1994 $Conf{CgiURL} = undef;
1995
1996 #   
1997 # Language to use.  See lib/BackupPC/Lang for the list of supported
1998 # languages, which include English (en), French (fr), Spanish (es),
1999 # German (de), Italian (it), Dutch (nl), Polish (pl), Portuguese
2000 # Brazillian (pt_br) and Chinese (zh_CH).
2001 #
2002 # Currently the Language setting applies to the CGI interface and email
2003 # messages sent to users.  Log files and other text are still in English.
2004 #
2005 $Conf{Language} = 'en';
2006
2007 #
2008 # User names that are rendered by the CGI interface can be turned
2009 # into links into their home page or other information about the
2010 # user.  To set this up you need to create two sprintf() strings,
2011 # that each contain a single '%s' that will be replaced by the user
2012 # name.  The default is a mailto: link.
2013 #
2014 # $Conf{CgiUserHomePageCheck} should be an absolute file path that
2015 # is used to check (via "-f") that the user has a valid home page.
2016 # Set this to undef or an empty string to turn off this check.
2017 #
2018 # $Conf{CgiUserUrlCreate} should be a full URL that points to the
2019 # user's home page.  Set this to undef or an empty string to turn
2020 # off generation of URLs for user names.
2021 #
2022 # Example:
2023 #    $Conf{CgiUserHomePageCheck} = '/var/www/html/users/%s.html';
2024 #    $Conf{CgiUserUrlCreate}     = 'http://myhost/users/%s.html';
2025 #    --> if /var/www/html/users/craig.html exists, then 'craig' will
2026 #      be rendered as a link to http://myhost/users/craig.html.
2027 #
2028 $Conf{CgiUserHomePageCheck} = '';
2029 $Conf{CgiUserUrlCreate}     = 'mailto:%s';
2030
2031 #
2032 # Date display format for CGI interface.  A value of 1 uses US-style
2033 # dates (MM/DD), a value of 2 uses full YYYY-MM-DD format, and zero
2034 # for international dates (DD/MM).
2035 #
2036 $Conf{CgiDateFormatMMDD} = 1;
2037
2038 #
2039 # If set, the complete list of hosts appears in the left navigation
2040 # bar pull-down for administrators.  Otherwise, just the hosts for which
2041 # the user is listed in the host file (as either the user or in moreUsers)
2042 # are displayed.
2043 #
2044 $Conf{CgiNavBarAdminAllHosts} = 1;
2045
2046 #
2047 # Enable/disable the search box in the navigation bar.
2048 #
2049 $Conf{CgiSearchBoxEnable} = 1;
2050
2051 #
2052 # Additional navigation bar links.  These appear for both regular users
2053 # and administrators.  This is a list of hashes giving the link (URL)
2054 # and the text (name) for the link.  Specifying lname instead of name
2055 # uses the language specific string (ie: $Lang->{lname}) instead of
2056 # just literally displaying name.
2057 #
2058 $Conf{CgiNavBarLinks} = [
2059     {
2060         link  => "?action=view&type=docs",
2061         lname => "Documentation",    # actually displays $Lang->{Documentation}
2062     },
2063     {
2064         link  => "http://backuppc.wiki.sourceforge.net",
2065         name  => "Wiki",              # displays literal "Wiki"
2066     },
2067     {
2068         link  => "http://backuppc.sourceforge.net",
2069         name  => "SourceForge",      # displays literal "SourceForge"
2070     },
2071 ];
2072
2073 #
2074 # Hilight colors based on status that are used in the PC summary page.
2075 #
2076 $Conf{CgiStatusHilightColor} = {
2077     Reason_backup_failed           => '#ffcccc',
2078     Reason_backup_done             => '#ccffcc',
2079     Reason_no_ping                 => '#ffff99',
2080     Reason_backup_canceled_by_user => '#ff9900',
2081     Status_backup_in_progress      => '#66cc99',
2082     Disabled_OnlyManualBackups     => '#d1d1d1',   
2083     Disabled_AllBackupsDisabled    => '#d1d1d1',          
2084 };
2085
2086 #
2087 # Additional CGI header text.
2088 #
2089 $Conf{CgiHeaders} = '<meta http-equiv="pragma" content="no-cache">';
2090
2091 #
2092 # Directory where images are stored.  This directory should be below
2093 # Apache's DocumentRoot.  This value isn't used by BackupPC but is
2094 # used by configure.pl when you upgrade BackupPC.
2095 #
2096 # Example:
2097 #     $Conf{CgiImageDir} = '/var/www/htdocs/BackupPC';
2098 #
2099 $Conf{CgiImageDir} = '';
2100
2101 #
2102 # Additional mappings of file name extenions to Content-Type for
2103 # individual file restore.  See $Ext2ContentType in BackupPC_Admin
2104 # for the default setting.  You can add additional settings here,
2105 # or override any default settings.  Example:
2106 #
2107 #     $Conf{CgiExt2ContentType} = {
2108 #                 'pl'  => 'text/plain',
2109 #          };
2110 #
2111 $Conf{CgiExt2ContentType} = { };
2112
2113 #
2114 # URL (without the leading http://host) for BackupPC's image directory.
2115 # The CGI script uses this value to serve up image files.
2116 #
2117 # Example:
2118 #     $Conf{CgiImageDirURL} = '/BackupPC';
2119 #
2120 $Conf{CgiImageDirURL} = '';
2121
2122 #
2123 # CSS stylesheet "skin" for the CGI interface.  It is stored
2124 # in the $Conf{CgiImageDir} directory and accessed via the
2125 # $Conf{CgiImageDirURL} URL.
2126 #
2127 # For BackupPC v3.x several color, layout and font changes were made.
2128 # The previous v2.x version is available as BackupPC_stnd_orig.css, so
2129 # if you prefer the old skin, change this to BackupPC_stnd_orig.css.
2130 #
2131 $Conf{CgiCSSFile} = 'BackupPC_stnd.css';
2132
2133 #
2134 # Whether the user is allowed to edit their per-PC config.
2135 #
2136 $Conf{CgiUserConfigEditEnable} = 1;
2137
2138 #
2139 # Which per-host config variables a non-admin user is allowed
2140 # to edit.  Admin users can edit all per-host config variables,
2141 # even if disabled in this list.
2142 #
2143 # SECURITY WARNING: Do not let users edit any of the Cmd
2144 # config variables!  That's because a user could set a
2145 # Cmd to a shell script of their choice and it will be
2146 # run as the BackupPC user.  That script could do all
2147 # sorts of bad things.
2148 #
2149 $Conf{CgiUserConfigEdit} = {
2150         FullPeriod                => 1,
2151         IncrPeriod                => 1,
2152         FullKeepCnt               => 1,
2153         FullKeepCntMin            => 1,
2154         FullAgeMax                => 1,
2155         IncrKeepCnt               => 1,
2156         IncrKeepCntMin            => 1,
2157         IncrAgeMax                => 1,
2158         IncrLevels                => 1,
2159         IncrFill                  => 1,
2160         PartialAgeMax             => 1,
2161         RestoreInfoKeepCnt        => 1,
2162         ArchiveInfoKeepCnt        => 1,
2163         BackupFilesOnly           => 1,
2164         BackupFilesExclude        => 1,
2165         BackupsDisable            => 1,
2166         BlackoutBadPingLimit      => 1,
2167         BlackoutGoodCnt           => 1,
2168         BlackoutPeriods           => 1,
2169         BackupZeroFilesIsFatal    => 1,
2170         ClientCharset             => 1,
2171         ClientCharsetLegacy       => 1,
2172         XferMethod                => 1,
2173         XferLogLevel              => 1,
2174         SmbShareName              => 1,
2175         SmbShareUserName          => 1,
2176         SmbSharePasswd            => 1,
2177         SmbClientFullCmd          => 0,
2178         SmbClientIncrCmd          => 0,
2179         SmbClientRestoreCmd       => 0,
2180         TarShareName              => 1,
2181         TarFullArgs               => 1,
2182         TarIncrArgs               => 1,
2183         TarClientCmd              => 0,
2184         TarClientRestoreCmd       => 0,
2185         TarClientPath             => 0,
2186         RsyncShareName            => 1,
2187         RsyncdClientPort          => 1,
2188         RsyncdPasswd              => 1,
2189         RsyncdUserName            => 1,
2190         RsyncdAuthRequired        => 1,
2191         RsyncCsumCacheVerifyProb  => 1,
2192         RsyncArgs                 => 1,
2193         RsyncArgsExtra            => 1,
2194         RsyncRestoreArgs          => 1,
2195         RsyncClientCmd            => 0,
2196         RsyncClientRestoreCmd     => 0,
2197         RsyncClientPath           => 0,
2198         FtpShareName              => 1,
2199         FtpUserName               => 1,
2200         FtpPasswd                 => 1,
2201         FtpBlockSize              => 1,
2202         FtpPort                   => 1,
2203         FtpTimeout                => 1,
2204         FtpFollowSymlinks         => 1,
2205         FtpRestoreEnabled         => 1,
2206         ArchiveDest               => 1,
2207         ArchiveComp               => 1,
2208         ArchivePar                => 1,
2209         ArchiveSplit              => 1,
2210         ArchiveClientCmd          => 0,
2211         FixedIPNetBiosNameCheck   => 1,
2212         NmbLookupCmd              => 0,
2213         NmbLookupFindHostCmd      => 0,
2214         PingMaxMsec               => 1,
2215         PingCmd                   => 0,
2216         ClientTimeout             => 1,
2217         MaxOldPerPCLogFiles       => 1,
2218         CompressLevel             => 1,
2219         ClientNameAlias           => 1,
2220         DumpPreUserCmd            => 0,
2221         DumpPostUserCmd           => 0,
2222         RestorePreUserCmd         => 0,
2223         RestorePostUserCmd        => 0,
2224         ArchivePreUserCmd         => 0,
2225         ArchivePostUserCmd        => 0,
2226         DumpPostShareCmd          => 0,
2227         DumpPreShareCmd           => 0,
2228         UserCmdCheckStatus        => 0,
2229         EMailNotifyMinDays        => 1,
2230         EMailFromUserName         => 1,
2231         EMailAdminUserName        => 1,
2232         EMailUserDestDomain       => 1,
2233         EMailNoBackupEverSubj     => 1,
2234         EMailNoBackupEverMesg     => 1,
2235         EMailNotifyOldBackupDays  => 1,
2236         EMailNoBackupRecentSubj   => 1,
2237         EMailNoBackupRecentMesg   => 1,
2238         EMailNotifyOldOutlookDays => 1,
2239         EMailOutlookBackupSubj    => 1,
2240         EMailOutlookBackupMesg    => 1,
2241         EMailHeaders              => 1,
2242 };