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