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