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