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