Merge lp:~louis/ubuntu/trusty/backuppc/backuppc-merge into lp:ubuntu/trusty/backuppc

Proposed by Louis Bouchard
Status: Needs review
Proposed branch: lp:~louis/ubuntu/trusty/backuppc/backuppc-merge
Merge into: lp:ubuntu/trusty/backuppc
Diff against target: 15395 lines (+8182/-4378)
96 files modified
ChangeLog (+67/-1)
README (+7/-7)
bin/BackupPC (+2/-2)
bin/BackupPC_archive (+2/-2)
bin/BackupPC_archiveHost (+3/-3)
bin/BackupPC_archiveStart (+2/-2)
bin/BackupPC_attribPrint (+2/-2)
bin/BackupPC_dump (+3/-3)
bin/BackupPC_fixupBackupSummary (+2/-2)
bin/BackupPC_link (+2/-2)
bin/BackupPC_nightly (+2/-2)
bin/BackupPC_restore (+2/-2)
bin/BackupPC_sendEmail (+3/-4)
bin/BackupPC_serverMesg (+2/-2)
bin/BackupPC_tarCreate (+2/-2)
bin/BackupPC_tarExtract (+2/-2)
bin/BackupPC_tarPCCopy (+2/-2)
bin/BackupPC_trashClean (+2/-2)
bin/BackupPC_zcat (+2/-2)
bin/BackupPC_zipCreate (+13/-5)
cgi-bin/BackupPC_Admin (+2/-2)
conf/BackupPC_stnd.css (+2/-2)
conf/BackupPC_stnd_orig.css (+2/-2)
conf/config.pl (+8/-5)
conf/hosts (+1/-1)
configure.pl (+8/-5)
debian/README.Debian (+10/-0)
debian/backuppc.default (+2/-0)
debian/backuppc.init (+3/-0)
debian/backuppc.templates (+1/-1)
debian/changelog (+50/-0)
debian/patches/config.pl.diff (+0/-27)
debian/postinst (+16/-3)
debian/postrm (+11/-2)
debian/rules (+2/-0)
doc/BackupPC.html (+3114/-4060)
doc/BackupPC.pod (+35/-25)
init.d/src/debian-backuppc (+1/-1)
init.d/src/gentoo-backuppc (+1/-1)
init.d/src/linux-backuppc (+1/-1)
init.d/src/slackware-backuppc (+1/-1)
init.d/src/solaris-backuppc (+1/-1)
init.d/src/suse-backuppc (+1/-1)
lib/BackupPC/Attrib.pm (+2/-2)
lib/BackupPC/CGI/AdminOptions.pm (+2/-2)
lib/BackupPC/CGI/Archive.pm (+2/-2)
lib/BackupPC/CGI/ArchiveInfo.pm (+2/-2)
lib/BackupPC/CGI/Browse.pm (+32/-8)
lib/BackupPC/CGI/DirHistory.pm (+28/-7)
lib/BackupPC/CGI/EditConfig.pm (+2/-2)
lib/BackupPC/CGI/EmailSummary.pm (+2/-2)
lib/BackupPC/CGI/GeneralInfo.pm (+2/-2)
lib/BackupPC/CGI/HostInfo.pm (+7/-4)
lib/BackupPC/CGI/LOGlist.pm (+2/-2)
lib/BackupPC/CGI/Lib.pm (+22/-5)
lib/BackupPC/CGI/Queue.pm (+2/-2)
lib/BackupPC/CGI/RSS.pm (+4/-3)
lib/BackupPC/CGI/ReloadServer.pm (+2/-2)
lib/BackupPC/CGI/Restore.pm (+30/-4)
lib/BackupPC/CGI/RestoreFile.pm (+12/-3)
lib/BackupPC/CGI/RestoreInfo.pm (+2/-2)
lib/BackupPC/CGI/StartServer.pm (+2/-2)
lib/BackupPC/CGI/StartStopBackup.pm (+2/-2)
lib/BackupPC/CGI/StopServer.pm (+2/-2)
lib/BackupPC/CGI/Summary.pm (+2/-2)
lib/BackupPC/CGI/View.pm (+5/-5)
lib/BackupPC/Config/Meta.pm (+3/-3)
lib/BackupPC/FileZIO.pm (+2/-2)
lib/BackupPC/Lang/cz.pm (+13/-7)
lib/BackupPC/Lang/de.pm (+13/-7)
lib/BackupPC/Lang/en.pm (+13/-7)
lib/BackupPC/Lang/es.pm (+13/-7)
lib/BackupPC/Lang/fr.pm (+13/-7)
lib/BackupPC/Lang/it.pm (+13/-7)
lib/BackupPC/Lang/ja.pm (+1462/-0)
lib/BackupPC/Lang/nl.pm (+13/-7)
lib/BackupPC/Lang/pl.pm (+13/-7)
lib/BackupPC/Lang/pt_br.pm (+13/-7)
lib/BackupPC/Lang/ru.pm (+1480/-0)
lib/BackupPC/Lang/uk.pm (+1479/-0)
lib/BackupPC/Lang/zh_CN.pm (+13/-7)
lib/BackupPC/Lib.pm (+31/-14)
lib/BackupPC/PoolWrite.pm (+2/-2)
lib/BackupPC/Storage.pm (+2/-2)
lib/BackupPC/Storage/Text.pm (+3/-3)
lib/BackupPC/View.pm (+2/-2)
lib/BackupPC/Xfer.pm (+2/-2)
lib/BackupPC/Xfer/Archive.pm (+2/-2)
lib/BackupPC/Xfer/Ftp.pm (+1/-1)
lib/BackupPC/Xfer/Protocol.pm (+2/-2)
lib/BackupPC/Xfer/Rsync.pm (+2/-2)
lib/BackupPC/Xfer/RsyncDigest.pm (+2/-2)
lib/BackupPC/Xfer/RsyncFileIO.pm (+2/-2)
lib/BackupPC/Xfer/Smb.pm (+2/-2)
lib/BackupPC/Xfer/Tar.pm (+2/-2)
lib/BackupPC/Zip/FileMember.pm (+2/-2)
To merge this branch: bzr merge lp:~louis/ubuntu/trusty/backuppc/backuppc-merge
Reviewer Review Type Date Requested Status
Chris J Arges Approve
Dimitri John Ledkov Pending
Review via email: mp+200536@code.launchpad.net

Description of the change

- Merged upstream debian
- Edited debian/patch/config.pl.diff to adapt to updated upstream
- Fixed double entry in debian/control Depends:
- fixed doc/BackupPC.pod according to previous version

To post a comment you must log in.
Revision history for this message
Chris J Arges (arges) wrote :

I was able to run sponsor-patch on this and it built locally just fine. I reviewed the debdiff and it looks ok.

Revision history for this message
Chris J Arges (arges) :
review: Approve

Unmerged revisions

41. By Louis Bouchard

* Merge from Debian unstable. Remaining changes:
  - debian/backuppc.init, debian/rules, debian/postinst: Do not call init
    script on shutdown and reboot (TearDown) (Debian #488660).
  - debian/control:
    + Remove estraneous libtime-modules-perl (Debian #734356).
    + Depend on default-mta | mail-transport-agent, instead of enumerating a
      long list of alternative MTAs.
* New upstream release. Closes: #716824
* Fix Typo in kill signal name (ALRM vs ARLM). Closes: #698441
* Enable Apache2 (2.4) configuration by default. Closes: #718550 #710956
* Non-maintainer upload.
* Patch BackupPC.pod for POD errors with Perl 5.18
  pod2man has become more strict with perl 5.18. The applied patch
  converts the non-7-bit clean character into UTF-8 and declares the
  file's encoding as such.
  Thanks to Dominic Hargreaves <email address hidden> (Closes: #719827)
* Non-maintainer upload.
* Do not ship /etc/backuppc/config.pl as a conffile; it is handled
  by ucf already (Closes: #706315)
* Added libtime-modules-perl dependency. Closes: #525395
* Remove /var/lib/backuppc/pc/localhost if it's empty
  Closes: #672372
* Added stuff to support Apache 2.4. Closes: #669765
* Added NICE support in /etc/default/backuppc. Closes: #639102
* Changed the default display date format. Closes: #663975

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog' (properties changed: +x to -x)
--- ChangeLog 2011-09-19 00:55:51 +0000
+++ ChangeLog 2014-01-06 14:04:46 +0000
@@ -11,13 +11,79 @@
11#11#
12#========================================================================12#========================================================================
13#13#
14# Version 3.2.1, released 24 Apr 2011.14# Version 3.3.0, released 14 Apr 2013.
15#15#
16# See http://backuppc.sourceforge.net.16# See http://backuppc.sourceforge.net.
17#17#
18#========================================================================18#========================================================================
1919
20#------------------------------------------------------------------------20#------------------------------------------------------------------------
21# Version 3.3.0, 14 Apr 2013
22#------------------------------------------------------------------------
23
24* Changed restore file name from restore.{zip|tar} to restore_$host_YYYY-MM-DD.{zip|tar},
25 where the date is the start date of the backup. Originally suggested by Brad Alexander,
26 with a healthy debate among Les, Holger, Jeffrey, Adam, Carl and others.
27
28* Changed the timeStamp2 function in lib/BackupPC/CGI/Lib.pm so that times more than 330
29 days ago also include the year. More recent times continue to use just the day of month
30 and month.
31
32* Made the directory path display (when browsing backups or history) a sequence of links,
33 allowing any parent directory to be quick selected.
34
35* Added Japanese language file lib/BackupPC/Lang/ja.pm submitted by Rikiya
36 Yamamoto.
37
38* Added Ukrainian language file lib/BackupPC/Lang/uk.pm submitted by Serhiy Yakimchuck.
39
40* Added Russian language file lib/BackupPC/Lang/ru.pm submitted by Sergei Butakov.
41
42* Patch from Alexander Moisseev that fixed file name encodings in zip files.
43 The default charset is now utf8. Added a menu option to override the codepage.
44
45* Removed -N option from smbclient command in conf/config.pl to remain compatible
46 with more recent versions (3.2.3 and later) of smbclient. Reported and discussed
47 by various people on the mail list, most recently by Jeff Boyce, Les Mikesell and
48 Holger Parplies. Alexander Moisseev also submitted a patch.
49
50 Using smbclient >= 3.2.3 with the -N option will give a "tree connect failed:
51 NT_STATUS_ACCESS_DENIED" error.
52
53* Reapplied a patch from Tyler Wagner for lib/BackupPC/CGI/HostInfo.pl so that
54 empty email status info doesn't appear. Somehow this missed 3.2.1.
55
56* Fixed check on $parfile in bin/BackupPC_archiveHost since it is numeric.
57 Fix submitted by Tim Massey.
58
59* Ensure $num is numeric in lib/BackupPC/CGI/View.pm error message
60 to avoid XSS attack. Report and patch by Jamie Strandboge.
61
62* Ensure $num and $share in lib/BackupPC/CGI/RestoreFile.pm error messages
63 are escaped, to avoid XSS vulnerability. Report and patch by Jamie Strandboge.
64 Also added some additional error checking and tweaked the handling of the
65 invalid number error message.
66
67* Fixed qw(...) deprecated syntax warnings in lib/BackupPC/Storage/Text.pm
68 and lib/BackupPC/Lib.pm. Patch supplied by Juergen Harms. Also got a
69 patch from Alexander Moisseev and report from Richard Shaw.
70
71* Fixed error in bin/BackupPC_sendEmail that caused accumulation of
72 per-host errors in the admin email to be skipped if a host's user
73 is not defined. Reported by Marco Dalla Via.
74
75* Fixed lib/BackupPC/CGI/RSS.pm so that the base_url is correct for https.
76 Report and fix by Samuel Monsarrat.
77
78* Added more careful checking that IO::Dirent returns valid inodes and file types.
79 Suggested by Daniel Harvey.
80
81* Removed redundant setting of $Lang{CfgEdit_Title_Other} from all the Lang files.
82
83* Applied couple of fixes to Lib.pm suggested by Jeffrey Kosowsky for special case of where
84 configuration commands are fragments of perl code.
85
86#------------------------------------------------------------------------
21# Version 3.2.1, 24 Apr 201187# Version 3.2.1, 24 Apr 2011
22#------------------------------------------------------------------------88#------------------------------------------------------------------------
2389
2490
=== modified file 'LICENSE' (properties changed: +x to -x)
=== modified file 'README' (properties changed: +x to -x)
--- README 2011-09-19 00:55:51 +0000
+++ README 2014-01-06 14:04:46 +0000
@@ -1,11 +1,11 @@
11
2 BackupPC2 BackupPC
33
4 Version 3.2.14 Version 3.3.0
55
6 24 Apr 20116 14 Apr 2013
77
8 Copyright (C) 2001-2010 Craig Barratt. All rights reserved.8 Copyright (C) 2001-2013 Craig Barratt. All rights reserved.
99
10 This program is free software; you can redistribute it and/or10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License.11 modify it under the terms of the GNU General Public License.
@@ -28,8 +28,8 @@
2828
29To install BackupPC run these commands as root:29To install BackupPC run these commands as root:
3030
31 tar zxf BackupPC-3.2.1.tar.gz31 tar zxf BackupPC-3.3.0.tar.gz
32 cd BackupPC-3.2.132 cd BackupPC-3.3.0
33 perl configure.pl33 perl configure.pl
3434
35This will automatically determine some system information and prompt you35This will automatically determine some system information and prompt you
3636
=== modified file 'bin/BackupPC'
--- bin/BackupPC 2011-09-19 00:55:51 +0000
+++ bin/BackupPC 2014-01-06 14:04:46 +0000
@@ -29,7 +29,7 @@
29# Craig Barratt <cbarratt@users.sourceforge.net>29# Craig Barratt <cbarratt@users.sourceforge.net>
30#30#
31# COPYRIGHT31# COPYRIGHT
32# Copyright (C) 2001-2009 Craig Barratt32# Copyright (C) 2001-2013 Craig Barratt
33#33#
34# This program is free software; you can redistribute it and/or modify34# This program is free software; you can redistribute it and/or modify
35# it under the terms of the GNU General Public License as published by35# it under the terms of the GNU General Public License as published by
@@ -47,7 +47,7 @@
47#47#
48#========================================================================48#========================================================================
49#49#
50# Version 3.2.1, released 24 Apr 2011.50# Version 3.3.0, released 14 Apr 2013.
51#51#
52# See http://backuppc.sourceforge.net.52# See http://backuppc.sourceforge.net.
53#53#
5454
=== modified file 'bin/BackupPC_archive'
--- bin/BackupPC_archive 2011-09-19 00:55:51 +0000
+++ bin/BackupPC_archive 2014-01-06 14:04:46 +0000
@@ -11,7 +11,7 @@
11# Josh Marshall11# Josh Marshall
12#12#
13# COPYRIGHT13# COPYRIGHT
14# Copyright (C) 2001-2009 Craig Barratt14# Copyright (C) 2001-2013 Craig Barratt
15#15#
16# This program is free software; you can redistribute it and/or modify16# This program is free software; you can redistribute it and/or modify
17# it under the terms of the GNU General Public License as published by17# it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@
29#29#
30#========================================================================30#========================================================================
31#31#
32# Version 3.2.1, released 24 Apr 2011.32# Version 3.3.0, released 14 Apr 2013.
33#33#
34# See http://backuppc.sourceforge.net.34# See http://backuppc.sourceforge.net.
35#35#
3636
=== modified file 'bin/BackupPC_archiveHost'
--- bin/BackupPC_archiveHost 2011-09-19 00:55:51 +0000
+++ bin/BackupPC_archiveHost 2014-01-06 14:04:46 +0000
@@ -20,7 +20,7 @@
20# Josh Marshall20# Josh Marshall
21#21#
22# COPYRIGHT22# COPYRIGHT
23# Copyright (C) 2001-2009 Craig Barratt23# Copyright (C) 2001-2013 Craig Barratt
24#24#
25# This program is free software; you can redistribute it and/or modify25# This program is free software; you can redistribute it and/or modify
26# it under the terms of the GNU General Public License as published by26# it under the terms of the GNU General Public License as published by
@@ -38,7 +38,7 @@
38#38#
39#========================================================================39#========================================================================
40#40#
41# Version 3.2.1, released 24 Apr 2011.41# Version 3.3.0, released 14 Apr 2013.
42#42#
43# See http://backuppc.sourceforge.net.43# See http://backuppc.sourceforge.net.
44#44#
@@ -154,7 +154,7 @@
154# ie: not a tape device).154# ie: not a tape device).
155#155#
156if ( -d $outLoc && -x $parPath ) {156if ( -d $outLoc && -x $parPath ) {
157 if ( length($parfile) ) {157 if ( length($parfile) && $parfile != 0 ) {
158 print("Running $parPath to create parity files\n");158 print("Running $parPath to create parity files\n");
159 my $parCmd = "$parPath c -r$parfile $outLocE/$host.$bkupNum.tar$fileExt.par2 $outLocE/$host.$bkupNum.tar$fileExt*";159 my $parCmd = "$parPath c -r$parfile $outLocE/$host.$bkupNum.tar$fileExt.par2 $outLocE/$host.$bkupNum.tar$fileExt*";
160 $ret = system($parCmd);160 $ret = system($parCmd);
161161
=== modified file 'bin/BackupPC_archiveStart'
--- bin/BackupPC_archiveStart 2011-09-19 00:55:51 +0000
+++ bin/BackupPC_archiveStart 2014-01-06 14:04:46 +0000
@@ -17,7 +17,7 @@
17# Craig Barratt <cbarratt@users.sourceforge.net>17# Craig Barratt <cbarratt@users.sourceforge.net>
18#18#
19# COPYRIGHT19# COPYRIGHT
20# Copyright (C) 2007-2009 Craig Barratt20# Copyright (C) 2007-2013 Craig Barratt
21#21#
22# This program is free software; you can redistribute it and/or modify22# This program is free software; you can redistribute it and/or modify
23# it under the terms of the GNU General Public License as published by23# it under the terms of the GNU General Public License as published by
@@ -35,7 +35,7 @@
35#35#
36#========================================================================36#========================================================================
37#37#
38# Version 3.2.1, released 24 Apr 2011.38# Version 3.3.0, released 14 Apr 2013.
39#39#
40# See http://backuppc.sourceforge.net.40# See http://backuppc.sourceforge.net.
41#41#
4242
=== modified file 'bin/BackupPC_attribPrint'
--- bin/BackupPC_attribPrint 2011-09-19 00:55:51 +0000
+++ bin/BackupPC_attribPrint 2014-01-06 14:04:46 +0000
@@ -13,7 +13,7 @@
13# Craig Barratt <cbarratt@users.sourceforge.net>13# Craig Barratt <cbarratt@users.sourceforge.net>
14#14#
15# COPYRIGHT15# COPYRIGHT
16# Copyright (C) 2005-2009 Craig Barratt16# Copyright (C) 2005-2013 Craig Barratt
17#17#
18# This program is free software; you can redistribute it and/or modify18# This program is free software; you can redistribute it and/or modify
19# it under the terms of the GNU General Public License as published by19# it under the terms of the GNU General Public License as published by
@@ -31,7 +31,7 @@
31#31#
32#========================================================================32#========================================================================
33#33#
34# Version 3.2.1, released 24 Apr 2011.34# Version 3.3.0, released 14 Apr 2013.
35#35#
36# See http://backuppc.sourceforge.net.36# See http://backuppc.sourceforge.net.
37#37#
3838
=== modified file 'bin/BackupPC_dump'
--- bin/BackupPC_dump 2011-09-19 00:55:51 +0000
+++ bin/BackupPC_dump 2014-01-06 14:04:46 +0000
@@ -59,7 +59,7 @@
59# Craig Barratt <cbarratt@users.sourceforge.net>59# Craig Barratt <cbarratt@users.sourceforge.net>
60#60#
61# COPYRIGHT61# COPYRIGHT
62# Copyright (C) 2001-2009 Craig Barratt62# Copyright (C) 2001-2013 Craig Barratt
63#63#
64# This program is free software; you can redistribute it and/or modify64# This program is free software; you can redistribute it and/or modify
65# it under the terms of the GNU General Public License as published by65# it under the terms of the GNU General Public License as published by
@@ -77,7 +77,7 @@
77#77#
78#========================================================================78#========================================================================
79#79#
80# Version 3.2.1, released 24 Apr 2011.80# Version 3.3.0, released 14 Apr 2013.
81#81#
82# See http://backuppc.sourceforge.net.82# See http://backuppc.sourceforge.net.
83#83#
@@ -1066,7 +1066,7 @@
1066 # Send ALRMs to BackupPC_tarExtract if we are using it1066 # Send ALRMs to BackupPC_tarExtract if we are using it
1067 #1067 #
1068 if ( $tarPid > 0 ) {1068 if ( $tarPid > 0 ) {
1069 kill($bpc->sigName2num("ARLM"), $tarPid);1069 kill($bpc->sigName2num("ALRM"), $tarPid);
1070 }1070 }
10711071
1072 #1072 #
10731073
=== modified file 'bin/BackupPC_fixupBackupSummary'
--- bin/BackupPC_fixupBackupSummary 2011-09-19 00:55:51 +0000
+++ bin/BackupPC_fixupBackupSummary 2014-01-06 14:04:46 +0000
@@ -12,7 +12,7 @@
12# Craig Barratt <cbarratt@users.sourceforge.net>12# Craig Barratt <cbarratt@users.sourceforge.net>
13#13#
14# COPYRIGHT14# COPYRIGHT
15# Copyright (C) 2005-2009 Craig Barratt15# Copyright (C) 2005-2013 Craig Barratt
16#16#
17# This program is free software; you can redistribute it and/or modify17# This program is free software; you can redistribute it and/or modify
18# it under the terms of the GNU General Public License as published by18# it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@
30#30#
31#========================================================================31#========================================================================
32#32#
33# Version 3.2.1, released 24 Apr 2011.33# Version 3.3.0, released 14 Apr 2013.
34#34#
35# See http://backuppc.sourceforge.net.35# See http://backuppc.sourceforge.net.
36#36#
3737
=== modified file 'bin/BackupPC_link'
--- bin/BackupPC_link 2011-09-19 00:55:51 +0000
+++ bin/BackupPC_link 2014-01-06 14:04:46 +0000
@@ -21,7 +21,7 @@
21# Craig Barratt <cbarratt@users.sourceforge.net>21# Craig Barratt <cbarratt@users.sourceforge.net>
22#22#
23# COPYRIGHT23# COPYRIGHT
24# Copyright (C) 2001-2009 Craig Barratt24# Copyright (C) 2001-2013 Craig Barratt
25#25#
26# This program is free software; you can redistribute it and/or modify26# This program is free software; you can redistribute it and/or modify
27# it under the terms of the GNU General Public License as published by27# it under the terms of the GNU General Public License as published by
@@ -39,7 +39,7 @@
39#39#
40#========================================================================40#========================================================================
41#41#
42# Version 3.2.1, released 24 Apr 2011.42# Version 3.3.0, released 14 Apr 2013.
43#43#
44# See http://backuppc.sourceforge.net.44# See http://backuppc.sourceforge.net.
45#45#
4646
=== modified file 'bin/BackupPC_nightly'
--- bin/BackupPC_nightly 2011-09-19 00:55:51 +0000
+++ bin/BackupPC_nightly 2014-01-06 14:04:46 +0000
@@ -37,7 +37,7 @@
37# Craig Barratt <cbarratt@users.sourceforge.net>37# Craig Barratt <cbarratt@users.sourceforge.net>
38#38#
39# COPYRIGHT39# COPYRIGHT
40# Copyright (C) 2001-2009 Craig Barratt40# Copyright (C) 2001-2013 Craig Barratt
41#41#
42# This program is free software; you can redistribute it and/or modify42# This program is free software; you can redistribute it and/or modify
43# it under the terms of the GNU General Public License as published by43# it under the terms of the GNU General Public License as published by
@@ -55,7 +55,7 @@
55#55#
56#========================================================================56#========================================================================
57#57#
58# Version 3.2.1, released 24 Apr 2011.58# Version 3.3.0, released 14 Apr 2013.
59#59#
60# See http://backuppc.sourceforge.net.60# See http://backuppc.sourceforge.net.
61#61#
6262
=== modified file 'bin/BackupPC_restore'
--- bin/BackupPC_restore 2011-09-19 00:55:51 +0000
+++ bin/BackupPC_restore 2014-01-06 14:04:46 +0000
@@ -11,7 +11,7 @@
11# Craig Barratt <cbarratt@users.sourceforge.net>11# Craig Barratt <cbarratt@users.sourceforge.net>
12#12#
13# COPYRIGHT13# COPYRIGHT
14# Copyright (C) 2001-2009 Craig Barratt14# Copyright (C) 2001-2013 Craig Barratt
15#15#
16# This program is free software; you can redistribute it and/or modify16# This program is free software; you can redistribute it and/or modify
17# it under the terms of the GNU General Public License as published by17# it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@
29#29#
30#========================================================================30#========================================================================
31#31#
32# Version 3.2.1, released 24 Apr 2011.32# Version 3.3.0, released 14 Apr 2013.
33#33#
34# See http://backuppc.sourceforge.net.34# See http://backuppc.sourceforge.net.
35#35#
3636
=== modified file 'bin/BackupPC_sendEmail'
--- bin/BackupPC_sendEmail 2011-09-19 00:55:51 +0000
+++ bin/BackupPC_sendEmail 2014-01-06 14:04:46 +0000
@@ -13,7 +13,7 @@
13# Craig Barratt <cbarratt@users.sourceforge.net>13# Craig Barratt <cbarratt@users.sourceforge.net>
14#14#
15# COPYRIGHT15# COPYRIGHT
16# Copyright (C) 2001-2009 Craig Barratt16# Copyright (C) 2001-2013 Craig Barratt
17#17#
18# This program is free software; you can redistribute it and/or modify18# This program is free software; you can redistribute it and/or modify
19# it under the terms of the GNU General Public License as published by19# it under the terms of the GNU General Public License as published by
@@ -31,7 +31,7 @@
31#31#
32#========================================================================32#========================================================================
33#33#
34# Version 3.2.1, released 24 Apr 2011.34# Version 3.3.0, released 14 Apr 2013.
35#35#
36# See http://backuppc.sourceforge.net.36# See http://backuppc.sourceforge.net.
37#37#
@@ -186,8 +186,6 @@
186 %Conf = $bpc->Conf();186 %Conf = $bpc->Conf();
187 my $user = $Hosts->{$host}{user};187 my $user = $Hosts->{$host}{user};
188188
189 next if ( $user eq "" );
190
191 #189 #
192 # Accumulate host errors for the admin email below190 # Accumulate host errors for the admin email below
193 #191 #
@@ -204,6 +202,7 @@
204 || $Conf{XferMethod} eq "archive"202 || $Conf{XferMethod} eq "archive"
205 || $Conf{BackupsDisable}203 || $Conf{BackupsDisable}
206 || $Hosts->{$host}{user} eq ""204 || $Hosts->{$host}{user} eq ""
205 || $user eq ""
207 );206 );
208 my @Backups = $bpc->BackupInfoRead($host);207 my @Backups = $bpc->BackupInfoRead($host);
209 my $numBackups = @Backups;208 my $numBackups = @Backups;
210209
=== modified file 'bin/BackupPC_serverMesg'
--- bin/BackupPC_serverMesg 2011-09-19 00:55:51 +0000
+++ bin/BackupPC_serverMesg 2014-01-06 14:04:46 +0000
@@ -25,7 +25,7 @@
25# Craig Barratt <cbarratt@users.sourceforge.net>25# Craig Barratt <cbarratt@users.sourceforge.net>
26#26#
27# COPYRIGHT27# COPYRIGHT
28# Copyright (C) 2001-2009 Craig Barratt28# Copyright (C) 2001-2013 Craig Barratt
29#29#
30# This program is free software; you can redistribute it and/or modify30# This program is free software; you can redistribute it and/or modify
31# it under the terms of the GNU General Public License as published by31# it under the terms of the GNU General Public License as published by
@@ -43,7 +43,7 @@
43#43#
44#========================================================================44#========================================================================
45#45#
46# Version 3.2.1, released 24 Apr 2011.46# Version 3.3.0, released 14 Apr 2013.
47#47#
48# See http://backuppc.sourceforge.net.48# See http://backuppc.sourceforge.net.
49#49#
5050
=== modified file 'bin/BackupPC_tarCreate'
--- bin/BackupPC_tarCreate 2011-09-19 00:55:51 +0000
+++ bin/BackupPC_tarCreate 2014-01-06 14:04:46 +0000
@@ -37,7 +37,7 @@
37# Craig Barratt <cbarratt@users.sourceforge.net>37# Craig Barratt <cbarratt@users.sourceforge.net>
38#38#
39# COPYRIGHT39# COPYRIGHT
40# Copyright (C) 2001-2009 Craig Barratt40# Copyright (C) 2001-2013 Craig Barratt
41#41#
42# This program is free software; you can redistribute it and/or modify42# This program is free software; you can redistribute it and/or modify
43# it under the terms of the GNU General Public License as published by43# it under the terms of the GNU General Public License as published by
@@ -55,7 +55,7 @@
55#55#
56#========================================================================56#========================================================================
57#57#
58# Version 3.2.1, released 24 Apr 2011.58# Version 3.3.0, released 14 Apr 2013.
59#59#
60# See http://backuppc.sourceforge.net.60# See http://backuppc.sourceforge.net.
61#61#
6262
=== modified file 'bin/BackupPC_tarExtract'
--- bin/BackupPC_tarExtract 2011-09-19 00:55:51 +0000
+++ bin/BackupPC_tarExtract 2014-01-06 14:04:46 +0000
@@ -9,7 +9,7 @@
9# Craig Barratt <cbarratt@users.sourceforge.net>9# Craig Barratt <cbarratt@users.sourceforge.net>
10#10#
11# COPYRIGHT11# COPYRIGHT
12# Copyright (C) 2001-2009 Craig Barratt12# Copyright (C) 2001-2013 Craig Barratt
13#13#
14# This program is free software; you can redistribute it and/or modify14# This program is free software; you can redistribute it and/or modify
15# it under the terms of the GNU General Public License as published by15# it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
27#27#
28#========================================================================28#========================================================================
29#29#
30# Version 3.2.1, released 24 Apr 2011.30# Version 3.3.0, released 14 Apr 2013.
31#31#
32# See http://backuppc.sourceforge.net.32# See http://backuppc.sourceforge.net.
33#33#
3434
=== modified file 'bin/BackupPC_tarPCCopy'
--- bin/BackupPC_tarPCCopy 2011-09-19 00:55:51 +0000
+++ bin/BackupPC_tarPCCopy 2014-01-06 14:04:46 +0000
@@ -20,7 +20,7 @@
20# Craig Barratt <cbarratt@users.sourceforge.net>20# Craig Barratt <cbarratt@users.sourceforge.net>
21#21#
22# COPYRIGHT22# COPYRIGHT
23# Copyright (C) 2005-2009 Craig Barratt23# Copyright (C) 2005-2013 Craig Barratt
24#24#
25# This program is free software; you can redistribute it and/or modify25# This program is free software; you can redistribute it and/or modify
26# it under the terms of the GNU General Public License as published by26# it under the terms of the GNU General Public License as published by
@@ -38,7 +38,7 @@
38#38#
39#========================================================================39#========================================================================
40#40#
41# Version 3.2.1, released 24 Apr 2011.41# Version 3.3.0, released 14 Apr 2013.
42#42#
43# See http://backuppc.sourceforge.net.43# See http://backuppc.sourceforge.net.
44#44#
4545
=== modified file 'bin/BackupPC_trashClean'
--- bin/BackupPC_trashClean 2011-09-19 00:55:51 +0000
+++ bin/BackupPC_trashClean 2014-01-06 14:04:46 +0000
@@ -11,7 +11,7 @@
11# Craig Barratt <cbarratt@users.sourceforge.net>11# Craig Barratt <cbarratt@users.sourceforge.net>
12#12#
13# COPYRIGHT13# COPYRIGHT
14# Copyright (C) 2001-2009 Craig Barratt14# Copyright (C) 2001-2013 Craig Barratt
15#15#
16# This program is free software; you can redistribute it and/or modify16# This program is free software; you can redistribute it and/or modify
17# it under the terms of the GNU General Public License as published by17# it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@
29#29#
30#========================================================================30#========================================================================
31#31#
32# Version 3.2.1, released 24 Apr 2011.32# Version 3.3.0, released 14 Apr 2013.
33#33#
34# See http://backuppc.sourceforge.net.34# See http://backuppc.sourceforge.net.
35#35#
3636
=== modified file 'bin/BackupPC_zcat'
--- bin/BackupPC_zcat 2011-09-19 00:55:51 +0000
+++ bin/BackupPC_zcat 2014-01-06 14:04:46 +0000
@@ -14,7 +14,7 @@
14# Craig Barratt <cbarratt@users.sourceforge.net>14# Craig Barratt <cbarratt@users.sourceforge.net>
15#15#
16# COPYRIGHT16# COPYRIGHT
17# Copyright (C) 2001-2009 Craig Barratt17# Copyright (C) 2001-2013 Craig Barratt
18#18#
19# This program is free software; you can redistribute it and/or modify19# This program is free software; you can redistribute it and/or modify
20# it under the terms of the GNU General Public License as published by20# it under the terms of the GNU General Public License as published by
@@ -32,7 +32,7 @@
32#32#
33#========================================================================33#========================================================================
34#34#
35# Version 3.2.1, released 24 Apr 2011.35# Version 3.3.0, released 14 Apr 2013.
36#36#
37# See http://backuppc.sourceforge.net.37# See http://backuppc.sourceforge.net.
38#38#
3939
=== modified file 'bin/BackupPC_zipCreate'
--- bin/BackupPC_zipCreate 2011-09-19 00:55:51 +0000
+++ bin/BackupPC_zipCreate 2014-01-06 14:04:46 +0000
@@ -21,7 +21,7 @@
21# -r pathRemove path prefix that will be replaced with pathAdd21# -r pathRemove path prefix that will be replaced with pathAdd
22# -p pathAdd new path prefix22# -p pathAdd new path prefix
23# -c level compression level (default is 0, no compression)23# -c level compression level (default is 0, no compression)
24# -e charset charset for encoding file names (default: cp1252)24# -e charset charset for encoding file names (default: utf8)
25#25#
26# The -h, -n and -s options specify which dump is used to generate26# The -h, -n and -s options specify which dump is used to generate
27# the zip archive. The -r and -p options can be used to relocate27# the zip archive. The -r and -p options can be used to relocate
@@ -33,7 +33,7 @@
33# Based on Backup_tarCreate by Craig Barratt <cbarratt@users.sourceforge.net>33# Based on Backup_tarCreate by Craig Barratt <cbarratt@users.sourceforge.net>
34#34#
35# COPYRIGHT35# COPYRIGHT
36# Copyright (C) 2002-2009 Craig Barratt and Guillaume Filion36# Copyright (C) 2002-2013 Craig Barratt and Guillaume Filion
37#37#
38# This program is free software; you can redistribute it and/or modify38# This program is free software; you can redistribute it and/or modify
39# it under the terms of the GNU General Public License as published by39# it under the terms of the GNU General Public License as published by
@@ -51,7 +51,7 @@
51#51#
52#========================================================================52#========================================================================
53#53#
54# Version 3.2.1, released 24 Apr 2011.54# Version 3.3.0, released 14 Apr 2013.
55#55#
56# See http://backuppc.sourceforge.net.56# See http://backuppc.sourceforge.net.
57#57#
@@ -93,7 +93,7 @@
93 -r pathRemove path prefix that will be replaced with pathAdd93 -r pathRemove path prefix that will be replaced with pathAdd
94 -p pathAdd new path prefix94 -p pathAdd new path prefix
95 -c level compression level (default is 0, no compression)95 -c level compression level (default is 0, no compression)
96 -e charset charset for encoding file names (default: cp1252)96 -e charset charset for encoding file names (default: utf8)
97EOF97EOF
98 exit(1);98 exit(1);
99}99}
@@ -135,7 +135,7 @@
135 exit(1);135 exit(1);
136}136}
137137
138my $Charset = "cp1252";138my $Charset = ""; # default: utf8
139$Charset = $opts{e} if ( $opts{e} ne "" );139$Charset = $opts{e} if ( $opts{e} ne "" );
140140
141my $PathRemove = $1 if ( $opts{r} =~ /(.+)/ );141my $PathRemove = $1 if ( $opts{r} =~ /(.+)/ );
@@ -311,6 +311,14 @@
311 # Specify the compression level for this member311 # Specify the compression level for this member
312 $zipmember->desiredCompressionLevel($compLevel) if ($compLevel =~ /[0-9]/);312 $zipmember->desiredCompressionLevel($compLevel) if ($compLevel =~ /[0-9]/);
313 313
314 if ( $Charset =~ /^(?:utf[-_]?8)?$/i ) {
315 # Set general purpose bit 11 for UTF-8 code page
316 $zipmember->{bitFlag} = $zipmember->{bitFlag} | 0x0800 ;
317 } elsif ( $Charset =~ /^cp(?:437|720|737|775|85[02578]|86[069]|874|93[26]|949|950)$/i ) {
318 # Set "version made by" field to 0 (MS-DOS) for OEM code pages
319 $zipmember->fileAttributeFormat('FA_MSDOS');
320 }
321
314 # Finally Zip the member322 # Finally Zip the member
315 $zipfh->addMember($zipmember);323 $zipfh->addMember($zipmember);
316}324}
317325
=== modified file 'cgi-bin/BackupPC_Admin'
--- cgi-bin/BackupPC_Admin 2011-09-19 00:55:51 +0000
+++ cgi-bin/BackupPC_Admin 2014-01-06 14:04:46 +0000
@@ -21,7 +21,7 @@
21# Craig Barratt <cbarratt@users.sourceforge.net>21# Craig Barratt <cbarratt@users.sourceforge.net>
22#22#
23# COPYRIGHT23# COPYRIGHT
24# Copyright (C) 2001-2009 Craig Barratt24# Copyright (C) 2001-2013 Craig Barratt
25#25#
26# This program is free software; you can redistribute it and/or modify26# This program is free software; you can redistribute it and/or modify
27# it under the terms of the GNU General Public License as published by27# it under the terms of the GNU General Public License as published by
@@ -39,7 +39,7 @@
39#39#
40#========================================================================40#========================================================================
41#41#
42# Version 3.2.1, released 24 Apr 2011.42# Version 3.3.0, released 14 Apr 2013.
43#43#
44# See http://backuppc.sourceforge.net.44# See http://backuppc.sourceforge.net.
45#45#
4646
=== modified file 'conf/BackupPC_stnd.css'
--- conf/BackupPC_stnd.css 2011-09-19 00:55:51 +0000
+++ conf/BackupPC_stnd.css 2014-01-06 14:04:46 +0000
@@ -1,7 +1,7 @@
1/*1/*
2 * BackupPC standard CSS definitions2 * BackupPC standard CSS definitions
3 *3 *
4 * Version 3.2.1, released 24 Apr 2011.4 * Version 3.3.0, released 14 Apr 2013.
5 *5 *
6 * See http://backuppc.sourceforge.net.6 * See http://backuppc.sourceforge.net.
7 *7 *
@@ -9,7 +9,7 @@
9 * Craig Barratt <cbarratt@users.sourceforge.net>9 * Craig Barratt <cbarratt@users.sourceforge.net>
10 *10 *
11 * COPYRIGHT11 * COPYRIGHT
12 * Copyright (C) 2004-2009 Craig Barratt12 * Copyright (C) 2004-2013 Craig Barratt
13 */13 */
1414
15body {15body {
1616
=== modified file 'conf/BackupPC_stnd_orig.css'
--- conf/BackupPC_stnd_orig.css 2011-09-19 00:55:51 +0000
+++ conf/BackupPC_stnd_orig.css 2014-01-06 14:04:46 +0000
@@ -1,7 +1,7 @@
1/*1/*
2 * BackupPC standard CSS definitions2 * BackupPC standard CSS definitions
3 *3 *
4 * Version 3.2.1, released 24 Apr 2011.4 * Version 3.3.0, released 14 Apr 2013.
5 *5 *
6 * See http://backuppc.sourceforge.net.6 * See http://backuppc.sourceforge.net.
7 *7 *
@@ -9,7 +9,7 @@
9 * Craig Barratt <cbarratt@users.sourceforge.net>9 * Craig Barratt <cbarratt@users.sourceforge.net>
10 *10 *
11 * COPYRIGHT11 * COPYRIGHT
12 * Copyright (C) 2004-2009 Craig Barratt12 * Copyright (C) 2004-2013 Craig Barratt
13 */13 */
1414
15body {15body {
1616
=== modified file 'conf/config.pl'
--- conf/config.pl 2011-03-07 11:35:50 +0000
+++ conf/config.pl 2014-01-06 14:04:46 +0000
@@ -29,7 +29,7 @@
29# Craig Barratt <cbarratt@users.sourceforge.net>29# Craig Barratt <cbarratt@users.sourceforge.net>
30#30#
31# COPYRIGHT31# COPYRIGHT
32# Copyright (C) 2001-2009 Craig Barratt32# Copyright (C) 2001-2013 Craig Barratt
33#33#
34# See http://backuppc.sourceforge.net.34# See http://backuppc.sourceforge.net.
35#35#
@@ -976,7 +976,7 @@
976# redirection and pipes; put that in a script if you need it.976# redirection and pipes; put that in a script if you need it.
977#977#
978$Conf{SmbClientFullCmd} = '$smbClientPath \\\\$host\\$shareName'978$Conf{SmbClientFullCmd} = '$smbClientPath \\\\$host\\$shareName'
979 . ' $I_option -U $userName -E -N -d 1'979 . ' $I_option -U $userName -E -d 1'
980 . ' -c tarmode\\ full -Tc$X_option - $fileList';980 . ' -c tarmode\\ full -Tc$X_option - $fileList';
981981
982#982#
@@ -990,7 +990,7 @@
990# redirection and pipes; put that in a script if you need it.990# redirection and pipes; put that in a script if you need it.
991#991#
992$Conf{SmbClientIncrCmd} = '$smbClientPath \\\\$host\\$shareName'992$Conf{SmbClientIncrCmd} = '$smbClientPath \\\\$host\\$shareName'
993 . ' $I_option -U $userName -E -N -d 1'993 . ' $I_option -U $userName -E -d 1'
994 . ' -c tarmode\\ full -TcN$X_option $timeStampFile - $fileList';994 . ' -c tarmode\\ full -TcN$X_option $timeStampFile - $fileList';
995995
996#996#
@@ -1008,7 +1008,7 @@
1008# redirection and pipes; put that in a script if you need it.1008# redirection and pipes; put that in a script if you need it.
1009#1009#
1010$Conf{SmbClientRestoreCmd} = '$smbClientPath \\\\$host\\$shareName'1010$Conf{SmbClientRestoreCmd} = '$smbClientPath \\\\$host\\$shareName'
1011 . ' $I_option -U $userName -E -N -d 1'1011 . ' $I_option -U $userName -E -d 1'
1012 . ' -c tarmode\\ full -Tx -';1012 . ' -c tarmode\\ full -Tx -';
10131013
1014###########################################################################1014###########################################################################
@@ -1047,11 +1047,14 @@
1047$Conf{TarShareName} = '/';1047$Conf{TarShareName} = '/';
10481048
1049#1049#
1050# Full command to run tar on the client. GNU tar is required. You will1050# Command to run tar on the client. GNU tar is required. You will
1051# need to fill in the correct paths for ssh2 on the local host (server)1051# need to fill in the correct paths for ssh2 on the local host (server)
1052# and GNU tar on the client. Security caution: normal users should not1052# and GNU tar on the client. Security caution: normal users should not
1053# allowed to write to these executable files or directories.1053# allowed to write to these executable files or directories.
1054#1054#
1055# $Conf{TarClientCmd} is appended with with either $Conf{TarFullArgs} or
1056# $Conf{TarIncrArgs} to create the final command that is run.
1057#
1055# See the documentation for more information about setting up ssh2 keys.1058# See the documentation for more information about setting up ssh2 keys.
1056#1059#
1057# If you plan to use NFS then tar just runs locally and ssh2 is not needed.1060# If you plan to use NFS then tar just runs locally and ssh2 is not needed.
10581061
=== modified file 'conf/hosts'
--- conf/hosts 2010-11-21 14:59:53 +0000
+++ conf/hosts 2014-01-06 14:04:46 +0000
@@ -41,7 +41,7 @@
41# Craig Barratt <craig@arraycomm.com>41# Craig Barratt <craig@arraycomm.com>
42#42#
43# COPYRIGHT43# COPYRIGHT
44# Copyright (C) 2001-2009 Craig Barratt44# Copyright (C) 2001-2013 Craig Barratt
45#45#
46# See http://backuppc.sourceforge.net.46# See http://backuppc.sourceforge.net.
47#47#
4848
=== modified file 'configure.pl' (properties changed: +x to -x)
--- configure.pl 2011-09-19 00:55:51 +0000
+++ configure.pl 2014-01-06 14:04:46 +0000
@@ -19,7 +19,7 @@
19# Craig Barratt <cbarratt@users.sourceforge.net>19# Craig Barratt <cbarratt@users.sourceforge.net>
20#20#
21# COPYRIGHT21# COPYRIGHT
22# Copyright (C) 2001-2010 Craig Barratt22# Copyright (C) 2001-2013 Craig Barratt
23#23#
24# This program is free software; you can redistribute it and/or modify24# This program is free software; you can redistribute it and/or modify
25# it under the terms of the GNU General Public License as published by25# it under the terms of the GNU General Public License as published by
@@ -37,7 +37,7 @@
37#37#
38#========================================================================38#========================================================================
39#39#
40# Version 3.2.1, released 24 Apr 2011.40# Version 3.3.0, released 14 Apr 2013.
41#41#
42# See http://backuppc.sourceforge.net.42# See http://backuppc.sourceforge.net.
43#43#
@@ -72,7 +72,7 @@
72BackupPC distribution. This probably means you did not cd to the72BackupPC distribution. This probably means you did not cd to the
73unpacked BackupPC distribution before running configure.pl, eg:73unpacked BackupPC distribution before running configure.pl, eg:
7474
75 cd BackupPC-3.2.175 cd BackupPC-3.3.0
76 ./configure.pl76 ./configure.pl
7777
78Please try again.78Please try again.
@@ -642,9 +642,12 @@
642 lib/BackupPC/Lang/es.pm642 lib/BackupPC/Lang/es.pm
643 lib/BackupPC/Lang/fr.pm643 lib/BackupPC/Lang/fr.pm
644 lib/BackupPC/Lang/it.pm644 lib/BackupPC/Lang/it.pm
645 lib/BackupPC/Lang/ja.pm
645 lib/BackupPC/Lang/nl.pm646 lib/BackupPC/Lang/nl.pm
646 lib/BackupPC/Lang/pl.pm647 lib/BackupPC/Lang/pl.pm
647 lib/BackupPC/Lang/pt_br.pm648 lib/BackupPC/Lang/pt_br.pm
649 lib/BackupPC/Lang/ru.pm
650 lib/BackupPC/Lang/uk.pm
648 lib/BackupPC/Lang/zh_CN.pm651 lib/BackupPC/Lang/zh_CN.pm
649 lib/BackupPC/Storage/Text.pm652 lib/BackupPC/Storage/Text.pm
650 lib/BackupPC/Xfer.pm653 lib/BackupPC/Xfer.pm
@@ -673,7 +676,7 @@
673 #676 #
674 # Install new CSS file, making a backup copy if necessary677 # Install new CSS file, making a backup copy if necessary
675 #678 #
676 my $cssBackup = "$DestDir$Conf{CgiImageDir}/BackupPC_stnd.css.pre-3.2.1";679 my $cssBackup = "$DestDir$Conf{CgiImageDir}/BackupPC_stnd.css.pre-3.3.0";
677 if ( -f "$DestDir$Conf{CgiImageDir}/BackupPC_stnd.css" && !-f $cssBackup ) {680 if ( -f "$DestDir$Conf{CgiImageDir}/BackupPC_stnd.css" && !-f $cssBackup ) {
678 rename("$DestDir$Conf{CgiImageDir}/BackupPC_stnd.css", $cssBackup);681 rename("$DestDir$Conf{CgiImageDir}/BackupPC_stnd.css", $cssBackup);
679 }682 }
@@ -893,7 +896,7 @@
893#896#
894# Now backup and write the config file897# Now backup and write the config file
895#898#
896my $confCopy = "$dest.pre-3.2.1";899my $confCopy = "$dest.pre-3.3.0";
897if ( -f $dest && !-f $confCopy ) {900if ( -f $dest && !-f $confCopy ) {
898 #901 #
899 # Make copy of config file, preserving ownership and modes902 # Make copy of config file, preserving ownership and modes
900903
=== modified file 'debian/README.Debian'
--- debian/README.Debian 2011-01-14 11:02:06 +0000
+++ debian/README.Debian 2014-01-06 14:04:46 +0000
@@ -105,5 +105,15 @@
105- Data directory is /var/lib/backuppc/105- Data directory is /var/lib/backuppc/
106106
107107
108/etc/default/backuppc
109---------------------
110
111You can change the nice value by adding a line like 'NICE=10' to
112/etc/default/backuppc
113
114
115
116
117
108118
109 -- Ludovic Drolez <ldrolez@debian.org>, Mon, 16 Jun 2004 10:43:48 +0200119 -- Ludovic Drolez <ldrolez@debian.org>, Mon, 16 Jun 2004 10:43:48 +0200
110120
=== added file 'debian/backuppc.default'
--- debian/backuppc.default 1970-01-01 00:00:00 +0000
+++ debian/backuppc.default 2014-01-06 14:04:46 +0000
@@ -0,0 +1,2 @@
1# Nice BackupPC daemon value
2NICE=0
03
=== modified file 'debian/backuppc.init'
--- debian/backuppc.init 2013-01-06 03:04:32 +0000
+++ debian/backuppc.init 2014-01-06 14:04:46 +0000
@@ -23,6 +23,9 @@
23DATADIR=/var/lib/backuppc23DATADIR=/var/lib/backuppc
24USER=backuppc24USER=backuppc
25NICE=025NICE=0
26
27test -f /etc/default/backuppc && . /etc/default/backuppc
28
26#29#
27NAME=backuppc30NAME=backuppc
28DAEMON=BackupPC31DAEMON=BackupPC
2932
=== modified file 'debian/backuppc.templates'
--- debian/backuppc.templates 2009-12-18 10:44:41 +0000
+++ debian/backuppc.templates 2014-01-06 14:04:46 +0000
@@ -11,7 +11,7 @@
11Template: backuppc/reconfigure-webserver11Template: backuppc/reconfigure-webserver
12Type: multiselect12Type: multiselect
13Choices: apache213Choices: apache2
14Default:14Default: apache2
15_Description: Which web server would you like to reconfigure automatically:15_Description: Which web server would you like to reconfigure automatically:
16 BackupPC supports any web server with CGI enabled, but this automatic16 BackupPC supports any web server with CGI enabled, but this automatic
17 configuration process only supports Apache.17 configuration process only supports Apache.
1818
=== modified file 'debian/changelog'
--- debian/changelog 2013-12-20 02:17:32 +0000
+++ debian/changelog 2014-01-06 14:04:46 +0000
@@ -1,3 +1,53 @@
1backuppc (3.3.0-1ubuntu1) trusty-proposed; urgency=low
2
3 * Merge from Debian unstable. Remaining changes:
4 - debian/backuppc.init, debian/rules, debian/postinst: Do not call init
5 script on shutdown and reboot (TearDown) (Debian #488660).
6 - debian/control:
7 + Remove estraneous libtime-modules-perl (Debian #734356).
8 + Depend on default-mta | mail-transport-agent, instead of enumerating a
9 long list of alternative MTAs.
10
11 -- Louis Bouchard <louis.bouchard@ubuntu.com> Mon, 06 Jan 2014 13:26:25 +0100
12
13backuppc (3.3.0-1) unstable; urgency=low
14
15 * New upstream release. Closes: #716824
16 * Fix Typo in kill signal name (ALRM vs ARLM). Closes: #698441
17 * Enable Apache2 (2.4) configuration by default. Closes: #718550 #710956
18
19 -- Ludovic Drolez <ldrolez@debian.org> Thu, 12 Sep 2013 6:13:50 +0200
20
21backuppc (3.2.1-5.2) unstable; urgency=low
22
23 * Non-maintainer upload.
24 * Patch BackupPC.pod for POD errors with Perl 5.18
25 pod2man has become more strict with perl 5.18. The applied patch
26 converts the non-7-bit clean character into UTF-8 and declares the
27 file's encoding as such.
28 Thanks to Dominic Hargreaves <dom@earth.li> (Closes: #719827)
29
30 -- Salvatore Bonaccorso <carnil@debian.org> Sat, 24 Aug 2013 15:29:57 +0200
31
32backuppc (3.2.1-5.1) unstable; urgency=low
33
34 * Non-maintainer upload.
35 * Do not ship /etc/backuppc/config.pl as a conffile; it is handled
36 by ucf already (Closes: #706315)
37
38 -- Jonathan Wiltshire <jmw@tiger-computing.co.uk> Fri, 07 Jun 2013 11:42:08 +0100
39
40backuppc (3.2.1-5) unstable; urgency=low
41
42 * Added libtime-modules-perl dependency. Closes: #525395
43 * Remove /var/lib/backuppc/pc/localhost if it's empty
44 Closes: #672372
45 * Added stuff to support Apache 2.4. Closes: #669765
46 * Added NICE support in /etc/default/backuppc. Closes: #639102
47 * Changed the default display date format. Closes: #663975
48
49 -- Ludovic Drolez <ldrolez@debian.org> Thu, 03 Jan 2013 17:27:35 +0100
50
1backuppc (3.2.1-4ubuntu2) trusty; urgency=medium51backuppc (3.2.1-4ubuntu2) trusty; urgency=medium
252
3 * Specify pod2man encoding.53 * Specify pod2man encoding.
454
=== modified file 'debian/patches/config.pl.diff'
--- debian/patches/config.pl.diff 2011-03-07 11:35:50 +0000
+++ debian/patches/config.pl.diff 2014-01-06 14:04:46 +0000
@@ -21,33 +21,6 @@
21 $Conf{CatPath} = '/bin/cat';21 $Conf{CatPath} = '/bin/cat';
22 $Conf{GzipPath} = '/bin/gzip';22 $Conf{GzipPath} = '/bin/gzip';
23 $Conf{Bzip2Path} = '/bin/bzip2';23 $Conf{Bzip2Path} = '/bin/bzip2';
24@@ -952,7 +952,7 @@
25 # redirection and pipes; put that in a script if you need it.
26 #
27 $Conf{SmbClientFullCmd} = '$smbClientPath \\\\$host\\$shareName'
28- . ' $I_option -U $userName -E -N -d 1'
29+ . ' $I_option -U $userName -E -d 1'
30 . ' -c tarmode\\ full -Tc$X_option - $fileList';
31
32 #
33@@ -966,7 +966,7 @@
34 # redirection and pipes; put that in a script if you need it.
35 #
36 $Conf{SmbClientIncrCmd} = '$smbClientPath \\\\$host\\$shareName'
37- . ' $I_option -U $userName -E -N -d 1'
38+ . ' $I_option -U $userName -E -d 1'
39 . ' -c tarmode\\ full -TcN$X_option $timeStampFile - $fileList';
40
41 #
42@@ -984,7 +984,7 @@
43 # redirection and pipes; put that in a script if you need it.
44 #
45 $Conf{SmbClientRestoreCmd} = '$smbClientPath \\\\$host\\$shareName'
46- . ' $I_option -U $userName -E -N -d 1'
47+ . ' $I_option -U $userName -E -d 1'
48 . ' -c tarmode\\ full -Tx -';
49
50 #
51@@ -1462,7 +1462,7 @@24@@ -1462,7 +1462,7 @@
52 # Full path for ssh. Security caution: normal users should not25 # Full path for ssh. Security caution: normal users should not
53 # allowed to write to this file or directory.26 # allowed to write to this file or directory.
5427
=== modified file 'debian/postinst'
--- debian/postinst 2011-06-15 16:28:41 +0000
+++ debian/postinst 2014-01-06 14:04:46 +0000
@@ -52,6 +52,19 @@
52 > /etc/$webserver/httpd.conf52 > /etc/$webserver/httpd.conf
53 fi53 fi
54 # add new links54 # add new links
55
56 # Apache 2.4
57 if [ -d /etc/$webserver/conf-available -a ! -f /etc/$webserver/conf-available/backuppc.conf -a ! -h /etc/$webserver/conf-available/backuppc.conf ]; then
58 ln -s /etc/backuppc/apache.conf /etc/$webserver/conf-available/backuppc.conf
59 [ -f /etc/$webserver/conf.d/backuppc.conf ] && rm /etc/$webserver/conf.d/backuppc.conf
60
61 if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
62 . /usr/share/apache2/apache2-maintscript-helper
63 apache2_invoke enconf backuppc.conf
64 fi
65 fi
66
67 # Apache < 2.4
55 newfile=false68 newfile=false
56 if [ -d /etc/$webserver/conf.d -a ! -f /etc/$webserver/conf.d/backuppc.conf -a ! -h /etc/$webserver/conf.d/backuppc.conf ]; then69 if [ -d /etc/$webserver/conf.d -a ! -f /etc/$webserver/conf.d/backuppc.conf -a ! -h /etc/$webserver/conf.d/backuppc.conf ]; then
57 ln -s /etc/backuppc/apache.conf /etc/$webserver/conf.d/backuppc.conf70 ln -s /etc/backuppc/apache.conf /etc/$webserver/conf.d/backuppc.conf
@@ -59,10 +72,10 @@
59 if [ "$webservers_rst" = "true" ]; then72 if [ "$webservers_rst" = "true" ]; then
60 # restart73 # restart
61 if [ -x /usr/sbin/invoke-rc.d ]; then74 if [ -x /usr/sbin/invoke-rc.d ]; then
62 invoke-rc.d $webserver restart75 invoke-rc.d $webserver reload
63 else76 else
64 /etc/init.d/$webserver restart77 /etc/init.d/$webserver reload
65 fi 78 fi
66 fi79 fi
67 fi80 fi
68 ;;81 ;;
6982
=== modified file 'debian/postrm'
--- debian/postrm 2011-06-15 16:28:41 +0000
+++ debian/postrm 2014-01-06 14:04:46 +0000
@@ -43,9 +43,9 @@
43 if [ "$webservers_rst" = "true" ]; then43 if [ "$webservers_rst" = "true" ]; then
44 # restart44 # restart
45 if [ -x /usr/sbin/invoke-rc.d ]; then45 if [ -x /usr/sbin/invoke-rc.d ]; then
46 invoke-rc.d $webserver restart46 invoke-rc.d $webserver reload
47 else47 else
48 /etc/init.d/$webserver restart48 /etc/init.d/$webserver reload
49 fi 49 fi
50 fi50 fi
51 fi51 fi
@@ -54,6 +54,14 @@
54 done54 done
55 fi55 fi
5656
57 if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
58 . /usr/share/apache2/apache2-maintscript-helper
59 apache2_invoke disconf backuppc.conf
60 fi
61
62 if [ -h /etc/apache2/conf-available/backuppc.conf ]; then
63 rm -f /etc/apache2/conf-available/backuppc.conf
64 fi
5765
58 dpkg-statoverride --remove --force /usr/share/backuppc/cgi-bin/index.cgi66 dpkg-statoverride --remove --force /usr/share/backuppc/cgi-bin/index.cgi
59 dpkg-statoverride --remove --force /usr/lib/backuppc/cgi-bin/index.cgi67 dpkg-statoverride --remove --force /usr/lib/backuppc/cgi-bin/index.cgi
@@ -61,6 +69,7 @@
61 if [ -x "/usr/bin/ucf" ]; then69 if [ -x "/usr/bin/ucf" ]; then
62 ucf --purge /etc/backuppc/config.pl70 ucf --purge /etc/backuppc/config.pl
63 fi71 fi
72 rmdir --ignore-fail-on-non-empty /var/lib/backuppc/pc/localhost/
6473
65 ;;74 ;;
66 remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)75 remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
6776
=== modified file 'debian/rules'
--- debian/rules 2011-06-15 16:28:41 +0000
+++ debian/rules 2014-01-06 14:04:46 +0000
@@ -51,6 +51,7 @@
51 dh_installdirs51 dh_installdirs
5252
53 # Add here commands to install the package into debian/backuppc.53 # Add here commands to install the package into debian/backuppc.
54 chmod 755 ./configure.pl
54 ./configure.pl --batch --no-fhs --hostname XXXXXX --uid-ignore \55 ./configure.pl --batch --no-fhs --hostname XXXXXX --uid-ignore \
55 --install-dir /usr/share/backuppc --dest-dir $(CURDIR)/debian/backuppc/ \56 --install-dir /usr/share/backuppc --dest-dir $(CURDIR)/debian/backuppc/ \
56 --data-dir /var/lib/backuppc --cgi-dir /usr/share/backuppc/cgi-bin \57 --data-dir /var/lib/backuppc --cgi-dir /usr/share/backuppc/cgi-bin \
@@ -73,6 +74,7 @@
73 (cd debian/backuppc/usr/share/backuppc/cgi-bin; ln -s ../image; ln -s /usr/lib/backuppc/cgi-bin/index.cgi )74 (cd debian/backuppc/usr/share/backuppc/cgi-bin; ln -s ../image; ln -s /usr/lib/backuppc/cgi-bin/index.cgi )
74 patch --no-backup-if-mismatch -p0 < debian/patches/config.pl.diff75 patch --no-backup-if-mismatch -p0 < debian/patches/config.pl.diff
75 install --mode=644 debian/backuppc/etc/backuppc/config.pl debian/backuppc/usr/share/backuppc/conf76 install --mode=644 debian/backuppc/etc/backuppc/config.pl debian/backuppc/usr/share/backuppc/conf
77 rm -rf debian/backuppc/etc/backuppc/config.pl
7678
77# Build architecture-independent files here.79# Build architecture-independent files here.
78binary-indep: build install80binary-indep: build install
7981
=== modified file 'doc/BackupPC.html'
--- doc/BackupPC.html 2011-09-19 00:55:51 +0000
+++ doc/BackupPC.html 2014-01-06 14:04:46 +0000
@@ -4,1267 +4,854 @@
4<head>4<head>
5<title>BackupPC</title>5<title>BackupPC</title>
6<meta http-equiv="content-type" content="text/html; charset=utf-8" />6<meta http-equiv="content-type" content="text/html; charset=utf-8" />
7<link rev="made" href="mailto:rurban@x-ray.at" />7<link rev="made" href="mailto:craig@craigs-macbook-pro.local" />
8</head>8</head>
99
10<body style="background-color: white">10<body style="background-color: white">
11<table border="0" width="100%" cellspacing="0" cellpadding="3">11<table border="0" width="100%" cellspacing="0" cellpadding="3">
12<tr><td class="block" style="background-color: #cccccc" valign="middle">12<tr><td class="_podblock_" style="background-color: #cccccc" valign="middle">
13<big><strong><span class="block">&nbsp;BackupPC</span></strong></big>13<big><strong><span class="_podblock_">&nbsp;BackupPC</span></strong></big>
14</td></tr>14</td></tr>
15</table>15</table>
1616
1717
18<!-- INDEX BEGIN -->18
19<div name="index">19<ul id="index">
20<p><a name="__index__"></a></p>20 <li><a href="#BackupPC-Introduction">BackupPC Introduction</a>
2121 <ul>
22<ul>22 <li><a href="#Overview">Overview</a></li>
2323 <li><a href="#Backup-basics">Backup basics</a></li>
24 <li><a href="#backuppc_introduction">BackupPC Introduction</a></li>24 <li><a href="#Resources">Resources</a></li>
25 <ul>25 <li><a href="#Road-map">Road map</a></li>
2626 <li><a href="#You-can-help">You can help</a></li>
27 <li><a href="#overview">Overview</a></li>27 </ul>
28 <li><a href="#backup_basics">Backup basics</a></li>28 </li>
29 <li><a href="#resources">Resources</a></li>29 <li><a href="#Installing-BackupPC">Installing BackupPC</a>
30 <li><a href="#road_map">Road map</a></li>30 <ul>
31 <li><a href="#you_can_help">You can help</a></li>31 <li><a href="#Requirements">Requirements</a></li>
32 </ul>32 <li><a href="#What-type-of-storage-space-do-I-need-">What type of storage space do I need?</a></li>
3333 <li><a href="#How-much-disk-space-do-I-need-">How much disk space do I need?</a></li>
34 <li><a href="#installing_backuppc">Installing BackupPC</a></li>34 <li><a href="#Step-1:-Getting-BackupPC">Step 1: Getting BackupPC</a></li>
35 <ul>35 <li><a href="#Step-2:-Installing-the-distribution">Step 2: Installing the distribution</a></li>
3636 <li><a href="#Step-3:-Setting-up-config.pl">Step 3: Setting up config.pl</a></li>
37 <li><a href="#requirements">Requirements</a></li>37 <li><a href="#Step-4:-Setting-up-the-hosts-file">Step 4: Setting up the hosts file</a></li>
38 <li><a href="#what_type_of_storage_space_do_i_need">What type of storage space do I need?</a></li>38 <li><a href="#Step-5:-Client-Setup">Step 5: Client Setup</a></li>
39 <li><a href="#how_much_disk_space_do_i_need">How much disk space do I need?</a></li>39 <li><a href="#Step-6:-Running-BackupPC">Step 6: Running BackupPC</a></li>
40 <li><a href="#step_1__getting_backuppc">Step 1: Getting BackupPC</a></li>40 <li><a href="#Step-7:-Talking-to-BackupPC">Step 7: Talking to BackupPC</a></li>
41 <li><a href="#step_2__installing_the_distribution">Step 2: Installing the distribution</a></li>41 <li><a href="#Step-8:-Checking-email-delivery">Step 8: Checking email delivery</a></li>
42 <li><a href="#step_3__setting_up_config_pl">Step 3: Setting up config.pl</a></li>42 <li><a href="#Step-9:-CGI-interface">Step 9: CGI interface</a></li>
43 <li><a href="#step_4__setting_up_the_hosts_file">Step 4: Setting up the hosts file</a></li>43 <li><a href="#How-BackupPC-Finds-Hosts">How BackupPC Finds Hosts</a></li>
44 <li><a href="#step_5__client_setup">Step 5: Client Setup</a></li>44 <li><a href="#Other-installation-topics">Other installation topics</a></li>
45 <li><a href="#step_6__running_backuppc">Step 6: Running BackupPC</a></li>45 <li><a href="#Fixing-installation-problems">Fixing installation problems</a></li>
46 <li><a href="#step_7__talking_to_backuppc">Step 7: Talking to BackupPC</a></li>46 </ul>
47 <li><a href="#step_8__checking_email_delivery">Step 8: Checking email delivery</a></li>47 </li>
48 <li><a href="#step_9__cgi_interface">Step 9: CGI interface</a></li>48 <li><a href="#Restore-functions">Restore functions</a>
49 <li><a href="#how_backuppc_finds_hosts">How BackupPC Finds Hosts</a></li>49 <ul>
50 <li><a href="#other_installation_topics">Other installation topics</a></li>50 <li><a href="#CGI-restore-options">CGI restore options</a></li>
51 <li><a href="#fixing_installation_problems">Fixing installation problems</a></li>51 <li><a href="#Command-line-restore-options">Command-line restore options</a></li>
52 </ul>52 </ul>
5353 </li>
54 <li><a href="#restore_functions">Restore functions</a></li>54 <li><a href="#Archive-functions">Archive functions</a>
55 <ul>55 <ul>
5656 <li><a href="#Configuring-an-Archive-Host">Configuring an Archive Host</a></li>
57 <li><a href="#cgi_restore_options">CGI restore options</a></li>57 <li><a href="#Starting-an-Archive">Starting an Archive</a></li>
58 <li><a href="#command_line_restore_options">Command-line restore options</a></li>58 <li><a href="#Starting-an-Archive-from-the-command-line">Starting an Archive from the command line</a></li>
59 </ul>59 </ul>
6060 </li>
61 <li><a href="#archive_functions">Archive functions</a></li>61 <li><a href="#Other-CGI-Functions">Other CGI Functions</a>
62 <ul>62 <ul>
6363 <li><a href="#Configuration-and-Host-Editor">Configuration and Host Editor</a></li>
64 <li><a href="#configuring_an_archive_host">Configuring an Archive Host</a></li>64 <li><a href="#RSS">RSS</a></li>
65 <li><a href="#starting_an_archive">Starting an Archive</a></li>65 </ul>
66 <li><a href="#starting_an_archive_from_the_command_line">Starting an Archive from the command line</a></li>66 </li>
67 </ul>67 <li><a href="#BackupPC-Design">BackupPC Design</a>
6868 <ul>
69 <li><a href="#other_cgi_functions">Other CGI Functions</a></li>69 <li><a href="#Some-design-issues">Some design issues</a></li>
70 <ul>70 <li><a href="#BackupPC-operation">BackupPC operation</a></li>
7171 <li><a href="#Storage-layout">Storage layout</a></li>
72 <li><a href="#configuration_and_host_editor">Configuration and Host Editor</a></li>72 <li><a href="#Compressed-file-format">Compressed file format</a></li>
73 <li><a href="#rss">RSS</a></li>73 <li><a href="#Rsync-checksum-caching">Rsync checksum caching</a></li>
74 </ul>74 <li><a href="#File-name-mangling">File name mangling</a></li>
7575 <li><a href="#Special-files">Special files</a></li>
76 <li><a href="#backuppc_design">BackupPC Design</a></li>76 <li><a href="#Attribute-file-format">Attribute file format</a></li>
77 <ul>77 <li><a href="#Optimizations">Optimizations</a></li>
7878 <li><a href="#Limitations">Limitations</a></li>
79 <li><a href="#some_design_issues">Some design issues</a></li>79 <li><a href="#Security-issues">Security issues</a></li>
80 <li><a href="#backuppc_operation">BackupPC operation</a></li>80 </ul>
81 <li><a href="#storage_layout">Storage layout</a></li>81 </li>
82 <li><a href="#compressed_file_format">Compressed file format</a></li>82 <li><a href="#Configuration-File">Configuration File</a>
83 <li><a href="#rsync_checksum_caching">Rsync checksum caching</a></li>83 <ul>
84 <li><a href="#file_name_mangling">File name mangling</a></li>84 <li><a href="#Modifying-the-main-configuration-file">Modifying the main configuration file</a></li>
85 <li><a href="#special_files">Special files</a></li>85 </ul>
86 <li><a href="#attribute_file_format">Attribute file format</a></li>86 </li>
87 <li><a href="#optimizations">Optimizations</a></li>87 <li><a href="#Configuration-Parameters">Configuration Parameters</a>
88 <li><a href="#limitations">Limitations</a></li>88 <ul>
89 <li><a href="#security_issues">Security issues</a></li>89 <li><a href="#General-server-configuration">General server configuration</a></li>
90 </ul>90 <li><a href="#What-to-backup-and-when-to-do-it">What to backup and when to do it</a></li>
9191 <li><a href="#How-to-backup-a-client">How to backup a client</a></li>
92 <li><a href="#configuration_file">Configuration File</a></li>92 <li><a href="#Samba-Configuration">Samba Configuration</a></li>
93 <ul>93 <li><a href="#Tar-Configuration">Tar Configuration</a></li>
9494 <li><a href="#Rsync-Rsyncd-Configuration">Rsync/Rsyncd Configuration</a></li>
95 <li><a href="#modifying_the_main_configuration_file">Modifying the main configuration file</a></li>95 <li><a href="#FTP-Configuration">FTP Configuration</a></li>
96 </ul>96 <li><a href="#Archive-Configuration">Archive Configuration</a></li>
9797 <li><a href="#Email-reminders-status-and-messages">Email reminders, status and messages</a></li>
98 <li><a href="#configuration_parameters">Configuration Parameters</a></li>98 <li><a href="#CGI-user-interface-configuration-settings">CGI user interface configuration settings</a></li>
99 <ul>99 </ul>
100100 </li>
101 <li><a href="#general_server_configuration">General server configuration</a></li>101 <li><a href="#Version-Numbers">Version Numbers</a></li>
102 <li><a href="#what_to_backup_and_when_to_do_it">What to backup and when to do it</a></li>102 <li><a href="#Author">Author</a></li>
103 <li><a href="#how_to_backup_a_client">How to backup a client</a></li>103 <li><a href="#Copyright">Copyright</a></li>
104 <li><a href="#samba_configuration">Samba Configuration</a></li>104 <li><a href="#Credits">Credits</a></li>
105 <li><a href="#tar_configuration">Tar Configuration</a></li>105 <li><a href="#License">License</a></li>
106 <li><a href="#rsync_rsyncd_configuration">Rsync/Rsyncd Configuration</a></li>
107 <li><a href="#ftp_configuration">FTP Configuration</a></li>
108 <li><a href="#archive_configuration">Archive Configuration</a></li>
109 <li><a href="#email_reminders__status_and_messages">Email reminders, status and messages</a></li>
110 <li><a href="#cgi_user_interface_configuration_settings">CGI user interface configuration settings</a></li>
111 </ul>
112
113 <li><a href="#version_numbers">Version Numbers</a></li>
114 <li><a href="#author">Author</a></li>
115 <li><a href="#copyright">Copyright</a></li>
116 <li><a href="#credits">Credits</a></li>
117 <li><a href="#license">License</a></li>
118</ul>106</ul>
119107
120<hr name="index" />108<hr />
121</div>109<h1 id="BackupPC-Introduction">BackupPC Introduction</h1>
122<!-- INDEX END -->110
123111<p>This documentation describes BackupPC version 3.3.0, released on 14 Apr 2013.</p>
124<p>112
125</p>113<h2 id="Overview">Overview</h2>
126<h1><a name="backuppc_introduction">BackupPC Introduction</a></h1>114
127<p>This documentation describes BackupPC version 3.2.1,115<p>BackupPC is a high-performance, enterprise-grade system for backing up Unix, Linux, WinXX, and MacOSX PCs, desktops and laptops to a server&#39;s disk. BackupPC is highly configurable and easy to install and maintain.</p>
128released on 24 Apr 2011.</p>116
129<p>117<p>Given the ever decreasing cost of disks and raid systems, it is now practical and cost effective to backup a large number of machines onto a server&#39;s local disk or network storage. For some sites this might be the complete backup solution. For other sites additional permanent archives could be created by periodically backing up the server to tape.</p>
130</p>118
131<h2><a name="overview">Overview</a></h2>
132<p>BackupPC is a high-performance, enterprise-grade system for backing up
133Unix, Linux, WinXX, and MacOSX PCs, desktops and laptops to a server's
134disk. BackupPC is highly configurable and easy to install and maintain.</p>
135<p>Given the ever decreasing cost of disks and raid systems, it is now
136practical and cost effective to backup a large number of machines onto
137a server's local disk or network storage. For some sites this might be
138the complete backup solution. For other sites additional permanent
139archives could be created by periodically backing up the server to tape.</p>
140<p>Features include:</p>119<p>Features include:</p>
120
141<ul>121<ul>
142<li>122
143<p>A clever pooling scheme minimizes disk storage and disk I/O.123<li><p>A clever pooling scheme minimizes disk storage and disk I/O. Identical files across multiple backups of the same or different PC are stored only once (using hard links), resulting in substantial savings in disk storage and disk writes.</p>
144Identical files across multiple backups of the same or different PC124
145are stored only once (using hard links), resulting in substantial125</li>
146savings in disk storage and disk writes.</p>126<li><p>Optional compression provides additional reductions in storage (around 40%). The CPU impact of compression is low since only new files (those not already in the pool) need to be compressed.</p>
147</li>127
148<li>128</li>
149<p>Optional compression provides additional reductions in storage129<li><p>A powerful http/cgi user interface allows administrators to view the current status, edit configuration, add/delete hosts, view log files, and allows users to initiate and cancel backups and browse and restore files from backups.</p>
150(around 40%). The CPU impact of compression is low since only130
151new files (those not already in the pool) need to be compressed.</p>131</li>
152</li>132<li><p>The http/cgi user interface has internationalization (i18n) support, currently providing English, French, German, Spanish, Italian, Dutch, Polish, Portuguese-Brazilian and Chinese</p>
153<li>133
154<p>A powerful http/cgi user interface allows administrators to view134</li>
155the current status, edit configuration, add/delete hosts, view log135<li><p>No client-side software is needed. On WinXX the standard smb protocol is used to extract backup data. On linux, unix or MacOSX clients, rsync, tar (over ssh/rsh/nfs) or ftp is used to extract backup data. Alternatively, rsync can also be used on WinXX (using cygwin), and Samba could be installed on the linux or unix client to provide smb shares).</p>
156files, and allows users to initiate and cancel backups and browse136
157and restore files from backups.</p>137</li>
158</li>138<li><p>Flexible restore options. Single files can be downloaded from any backup directly from the CGI interface. Zip or Tar archives for selected files or directories from any backup can also be downloaded from the CGI interface. Finally, direct restore to the client machine (using smb or tar) for selected files or directories is also supported from the CGI interface.</p>
159<li>139
160<p>The http/cgi user interface has internationalization (i18n) support,140</li>
161currently providing English, French, German, Spanish, Italian,141<li><p>BackupPC supports mobile environments where laptops are only intermittently connected to the network and have dynamic IP addresses (DHCP). Configuration settings allow machines connected via slower WAN connections (eg: dial up, DSL, cable) to not be backed up, even if they use the same fixed or dynamic IP address as when they are connected directly to the LAN.</p>
162Dutch, Polish, Portuguese-Brazilian and Chinese</p>142
163</li>143</li>
164<li>144<li><p>Flexible configuration parameters allow multiple backups to be performed in parallel, specification of which shares to backup, which directories to backup or not backup, various schedules for full and incremental backups, schedules for email reminders to users and so on. Configuration parameters can be set system-wide or also on a per-PC basis.</p>
165<p>No client-side software is needed. On WinXX the standard smb145
166protocol is used to extract backup data. On linux, unix or MacOSX146</li>
167clients, rsync, tar (over ssh/rsh/nfs) or ftp is used to extract147<li><p>Users are sent periodic email reminders if their PC has not recently been backed up. Email content, timing and policies are configurable.</p>
168backup data. Alternatively, rsync can also be used on WinXX (using148
169cygwin), and Samba could be installed on the linux or unix client149</li>
170to provide smb shares).</p>150<li><p>BackupPC is Open Source software hosted by SourceForge.</p>
171</li>151
172<li>
173<p>Flexible restore options. Single files can be downloaded from
174any backup directly from the CGI interface. Zip or Tar archives
175for selected files or directories from any backup can also be
176downloaded from the CGI interface. Finally, direct restore to
177the client machine (using smb or tar) for selected files or
178directories is also supported from the CGI interface.</p>
179</li>
180<li>
181<p>BackupPC supports mobile environments where laptops are only
182intermittently connected to the network and have dynamic IP addresses
183(DHCP). Configuration settings allow machines connected via slower WAN
184connections (eg: dial up, DSL, cable) to not be backed up, even if they
185use the same fixed or dynamic IP address as when they are connected
186directly to the LAN.</p>
187</li>
188<li>
189<p>Flexible configuration parameters allow multiple backups to be performed
190in parallel, specification of which shares to backup, which directories
191to backup or not backup, various schedules for full and incremental
192backups, schedules for email reminders to users and so on. Configuration
193parameters can be set system-wide or also on a per-PC basis.</p>
194</li>
195<li>
196<p>Users are sent periodic email reminders if their PC has not
197recently been backed up. Email content, timing and policies
198are configurable.</p>
199</li>
200<li>
201<p>BackupPC is Open Source software hosted by SourceForge.</p>
202</li>152</li>
203</ul>153</ul>
204<p>154
205</p>155<h2 id="Backup-basics">Backup basics</h2>
206<h2><a name="backup_basics">Backup basics</a></h2>156
207<dl>157<dl>
208<dt><strong><a name="full_backup" class="item">Full Backup</a></strong></dt>158
209159<dt id="Full-Backup">Full Backup</dt>
210<dd>160<dd>
211<p>A full backup is a complete backup of a share. BackupPC can be161
212configured to do a full backup at a regular interval (typically162<p>A full backup is a complete backup of a share. BackupPC can be configured to do a full backup at a regular interval (typically weekly). BackupPC can be configured to keep a certain number of full backups. Exponential expiry is also supported, allowing full backups with various vintages to be kept (for example, a settable number of most recent weekly fulls, plus a settable number of older fulls that are 2, 4, 8, or 16 weeks apart).</p>
213weekly). BackupPC can be configured to keep a certain number163
214of full backups. Exponential expiry is also supported, allowing164</dd>
215full backups with various vintages to be kept (for example, a165<dt id="Incremental-Backup">Incremental Backup</dt>
216settable number of most recent weekly fulls, plus a settable166<dd>
217number of older fulls that are 2, 4, 8, or 16 weeks apart).</p>167
218</dd>168<p>An incremental backup is a backup of files that have changed since the last successful full or incremental backup. Starting in BackupPC 3.0 multi-level incrementals are supported. A full backup has level 0. A new incremental of level N will backup all files that have changed since the most recent backup of a lower level. <a href="#_conf_incrlevels_">$Conf{IncrLevels}</a> is used to specify the level of each successive incremental. The default value is all level 1, which makes the behavior the same as earlier versions of BackupPC: each incremental will back up all the files that changed since the last full (level 0).</p>
219<dt><strong><a name="incremental_backup" class="item">Incremental Backup</a></strong></dt>169
220170<p>For SMB and tar, BackupPC uses the modification time (mtime) to determine which files have changed since the last lower-level backup. That means SMB and tar incrementals are not able to detect deleted files, renamed files or new files whose modification time is prior to the last lower-level backup.</p>
221<dd>171
222<p>An incremental backup is a backup of files that have changed172<p>Rsync is more clever: any files whose attributes have changed (ie: uid, gid, mtime, modes, size) since the last full are backed up. Deleted, new files and renamed files are detected by Rsync incrementals.</p>
223since the last successful full or incremental backup. Starting173
224in BackupPC 3.0 multi-level incrementals are supported.174<p>BackupPC can also be configured to keep a certain number of incremental backups, and to keep a smaller number of very old incremental backups. If multi-level incrementals are specified then it is likely that more incrementals will need to be kept since lower-level incrementals (and the full backup) are needed to reconstruct a higher-level incremental.</p>
225A full backup has level 0. A new incremental of level N will175
226backup all files that have changed since the most recent backup176<p>BackupPC &quot;fills-in&quot; incremental backups when browsing or restoring, based on the levels of each backup, giving every backup a &quot;full&quot; appearance. This makes browsing and restoring backups much easier: you can restore from any one backup independent of whether it was an incremental or full.</p>
227of a lower level. <a href="#_conf_incrlevels_">$Conf{IncrLevels}</a> is used to specify the177
228level of each successive incremental. The default value is178</dd>
229all level 1, which makes the behavior the same as earlier179<dt id="Partial-Backup">Partial Backup</dt>
230versions of BackupPC: each incremental will back up all the180<dd>
231files that changed since the last full (level 0).</p>181
232<p>For SMB and tar, BackupPC uses the modification time (mtime) to182<p>When a full backup fails or is canceled, and some files have already been backed up, BackupPC keeps a partial backup containing just the files that were backed up successfully. The partial backup is removed when the next successful backup completes, or if another full backup fails resulting in a newer partial backup. A failed full backup that has not backed up any files, or any failed incremental backup, is removed; no partial backup is saved in these cases.</p>
233determine which files have changed since the last lower-level183
234backup. That means SMB and tar incrementals are not able to detect184<p>The partial backup may be browsed or used to restore files just like a successful full or incremental backup.</p>
235deleted files, renamed files or new files whose modification time185
236is prior to the last lower-level backup.</p>186<p>With the rsync transfer method the partial backup is used to resume the next full backup, avoiding the need to retransfer the file data already in the partial backup.</p>
237<p>Rsync is more clever: any files whose attributes have changed (ie: uid,187
238gid, mtime, modes, size) since the last full are backed up. Deleted,188</dd>
239new files and renamed files are detected by Rsync incrementals.</p>189<dt id="Identical-Files">Identical Files</dt>
240<p>BackupPC can also be configured to keep a certain number of incremental190<dd>
241backups, and to keep a smaller number of very old incremental backups.191
242If multi-level incrementals are specified then it is likely that192<p>BackupPC pools identical files using hardlinks. By &quot;identical files&quot; we mean files with identical contents, not necessary the same permissions, ownership or modification time. Two files might have different permissions, ownership, or modification time but will still be pooled whenever the contents are identical. This is possible since BackupPC stores the file meta-data (permissions, ownership, and modification time) separately from the file contents.</p>
243more incrementals will need to be kept since lower-level incrementals193
244(and the full backup) are needed to reconstruct a higher-level194</dd>
245incremental.</p>195<dt id="Backup-Policy">Backup Policy</dt>
246<p>BackupPC &quot;fills-in&quot; incremental backups when browsing or restoring,196<dd>
247based on the levels of each backup, giving every backup a &quot;full&quot;197
248appearance. This makes browsing and restoring backups much easier:198<p>Based on your site&#39;s requirements you need to decide what your backup policy is. BackupPC is not designed to provide exact re-imaging of failed disks. See <a>Limitations</a> for more information. However, the addition of tar transport for linux/unix clients, plus full support for special file types and unix attributes in v1.4.0 likely means an exact image of a linux/unix file system can be made.</p>
249you can restore from any one backup independent of whether it was199
250an incremental or full.</p>200<p>BackupPC saves backups onto disk. Because of pooling you can relatively economically keep several weeks of old backups.</p>
251</dd>201
252<dt><strong><a name="partial_backup" class="item">Partial Backup</a></strong></dt>202<p>At some sites the disk-based backup will be adequate, without a secondary tape backup. This system is robust to any single failure: if a client disk fails or loses files, the BackupPC server can be used to restore files. If the server disk fails, BackupPC can be restarted on a fresh file system, and create new backups from the clients. The chance of the server disk failing can be made very small by spending more money on increasingly better RAID systems. However, there is still the risk of catastrophic events like fires or earthquakes that can destroy both the BackupPC server and the clients it is backing up if they are physically nearby.</p>
253203
254<dd>204<p>Some sites might choose to do periodic backups to tape or cd/dvd. This backup can be done perhaps weekly using the archive function of BackupPC.</p>
255<p>When a full backup fails or is canceled, and some files have already205
256been backed up, BackupPC keeps a partial backup containing just the206<p>Other users have reported success with removable disks to rotate the BackupPC data drives, or using rsync to mirror the BackupPC data pool offsite.</p>
257files that were backed up successfully. The partial backup is removed207
258when the next successful backup completes, or if another full backup
259fails resulting in a newer partial backup. A failed full backup
260that has not backed up any files, or any failed incremental backup,
261is removed; no partial backup is saved in these cases.</p>
262<p>The partial backup may be browsed or used to restore files just like
263a successful full or incremental backup.</p>
264<p>With the rsync transfer method the partial backup is used to resume
265the next full backup, avoiding the need to retransfer the file data
266already in the partial backup.</p>
267</dd>
268<dt><strong><a name="identical_files" class="item">Identical Files</a></strong></dt>
269
270<dd>
271<p>BackupPC pools identical files using hardlinks. By &quot;identical
272files&quot; we mean files with identical contents, not necessary the
273same permissions, ownership or modification time. Two files might
274have different permissions, ownership, or modification time but
275will still be pooled whenever the contents are identical. This
276is possible since BackupPC stores the file meta-data (permissions,
277ownership, and modification time) separately from the file contents.</p>
278</dd>
279<dt><strong><a name="backup_policy" class="item">Backup Policy</a></strong></dt>
280
281<dd>
282<p>Based on your site's requirements you need to decide what your backup
283policy is. BackupPC is not designed to provide exact re-imaging of
284failed disks. See <a href="#limitations">Limitations</a> for more information.
285However, the addition of tar transport for linux/unix clients, plus
286full support for special file types and unix attributes in v1.4.0
287likely means an exact image of a linux/unix file system can be made.</p>
288<p>BackupPC saves backups onto disk. Because of pooling you can relatively
289economically keep several weeks of old backups.</p>
290<p>At some sites the disk-based backup will be adequate, without a
291secondary tape backup. This system is robust to any single failure: if a
292client disk fails or loses files, the BackupPC server can be used to
293restore files. If the server disk fails, BackupPC can be restarted on a
294fresh file system, and create new backups from the clients. The chance
295of the server disk failing can be made very small by spending more money
296on increasingly better RAID systems. However, there is still the risk
297of catastrophic events like fires or earthquakes that can destroy
298both the BackupPC server and the clients it is backing up if they
299are physically nearby.</p>
300<p>Some sites might choose to do periodic backups to tape or cd/dvd.
301This backup can be done perhaps weekly using the archive function of
302BackupPC.</p>
303<p>Other users have reported success with removable disks to rotate the
304BackupPC data drives, or using rsync to mirror the BackupPC data pool
305offsite.</p>
306</dd>208</dd>
307</dl>209</dl>
308<p>210
309</p>211<h2 id="Resources">Resources</h2>
310<h2><a name="resources">Resources</a></h2>212
311<dl>213<dl>
312<dt><strong><a name="backuppc_home_page" class="item">BackupPC home page</a></strong></dt>
313214
215<dt id="BackupPC-home-page">BackupPC home page</dt>
314<dd>216<dd>
315<p>The BackupPC Open Source project is hosted on SourceForge. The217
316home page can be found at:</p>218<p>The BackupPC Open Source project is hosted on SourceForge. The home page can be found at:</p>
317<pre>219
318 <a href="http://backuppc.sourceforge.net">http://backuppc.sourceforge.net</a></pre>220<pre><code> http://backuppc.sourceforge.net</code></pre>
319<p>This page has links to the current documentation, the SourceForge221
320project page and general information.</p>222<p>This page has links to the current documentation, the SourceForge project page and general information.</p>
223
321</dd>224</dd>
322<dt><strong><a name="sourceforge_project" class="item">SourceForge project</a></strong></dt>225<dt id="SourceForge-project">SourceForge project</dt>
226<dd>
323227
324<dd>
325<p>The SourceForge project page is at:</p>228<p>The SourceForge project page is at:</p>
326<pre>229
327 <a href="http://sourceforge.net/projects/backuppc">http://sourceforge.net/projects/backuppc</a></pre>230<pre><code> http://sourceforge.net/projects/backuppc</code></pre>
231
328<p>This page has links to the current releases of BackupPC.</p>232<p>This page has links to the current releases of BackupPC.</p>
329</dd>233
330<dt><strong><a name="backuppc_wiki" class="item">BackupPC Wiki</a></strong></dt>234</dd>
331235<dt id="BackupPC-Wiki">BackupPC Wiki</dt>
332<dd>236<dd>
333<p>BackupPC has a Wiki at <a href="http://backuppc.wiki.sourceforge.net">http://backuppc.wiki.sourceforge.net</a>.237
334Everyone is encouraged to contribute to the Wiki. Anyone with238<p>BackupPC has a Wiki at <a href="http://backuppc.wiki.sourceforge.net">http://backuppc.wiki.sourceforge.net</a>. Everyone is encouraged to contribute to the Wiki. Anyone with a SourceForge account can edit the Wiki.</p>
335a SourceForge account can edit the Wiki.</p>239
336<p>The old FAQ is at <a href="http://backuppc.sourceforge.net/faq">http://backuppc.sourceforge.net/faq</a>, but240<p>The old FAQ is at <a href="http://backuppc.sourceforge.net/faq">http://backuppc.sourceforge.net/faq</a>, but is deprecated in favor of the Wiki.</p>
337is deprecated in favor of the Wiki.</p>241
338</dd>242</dd>
339<dt><strong><a name="mailing_lists" class="item">Mailing lists</a></strong></dt>243<dt id="Mailing-lists">Mailing lists</dt>
340244<dd>
341<dd>245
342<p>Three BackupPC mailing lists exist for announcements (backuppc-announce),246<p>Three BackupPC mailing lists exist for announcements (backuppc-announce), developers (backuppc-devel), and a general user list for support, asking questions or any other topic relevant to BackupPC (backuppc-users).</p>
343developers (backuppc-devel), and a general user list for support, asking247
344questions or any other topic relevant to BackupPC (backuppc-users).</p>248<p>The lists are archived on SourceForge and Gmane. The SourceForge lists are not always up to date and the searching is limited, so Gmane is a good alternative. See:</p>
345<p>The lists are archived on SourceForge and Gmane. The SourceForge lists249
346are not always up to date and the searching is limited, so Gmane is250<pre><code> http://news.gmane.org/index.php?prefix=gmane.comp.sysutils.backup.backuppc
347a good alternative. See:</p>251 http://sourceforge.net/mailarchive/forum.php?forum=backuppc-users</code></pre>
348<pre>252
349 <a href="http://news.gmane.org/index.php?prefix=gmane.comp.sysutils.backup.backuppc">http://news.gmane.org/index.php?prefix=gmane.comp.sysutils.backup.backuppc</a>
350 <a href="http://sourceforge.net/mailarchive/forum.php?forum=backuppc-users">http://sourceforge.net/mailarchive/forum.php?forum=backuppc-users</a></pre>
351<p>You can subscribe to these lists by visiting:</p>253<p>You can subscribe to these lists by visiting:</p>
352<pre>254
353 <a href="http://lists.sourceforge.net/lists/listinfo/backuppc-announce">http://lists.sourceforge.net/lists/listinfo/backuppc-announce</a>255<pre><code> http://lists.sourceforge.net/lists/listinfo/backuppc-announce
354 <a href="http://lists.sourceforge.net/lists/listinfo/backuppc-users">http://lists.sourceforge.net/lists/listinfo/backuppc-users</a>256 http://lists.sourceforge.net/lists/listinfo/backuppc-users
355 <a href="http://lists.sourceforge.net/lists/listinfo/backuppc-devel">http://lists.sourceforge.net/lists/listinfo/backuppc-devel</a></pre>257 http://lists.sourceforge.net/lists/listinfo/backuppc-devel</code></pre>
356<p>The backuppc-announce list is moderated and is used only for258
357important announcements (eg: new versions). It is low traffic.259<p>The backuppc-announce list is moderated and is used only for important announcements (eg: new versions). It is low traffic. You only need to subscribe to one of backuppc-announce and backuppc-users: backuppc-users also receives any messages on backuppc-announce.</p>
358You only need to subscribe to one of backuppc-announce and260
359backuppc-users: backuppc-users also receives any messages on261<p>The backuppc-devel list is only for developers who are working on BackupPC. Do not post questions or support requests there. But detailed technical discussions should happen on this list.</p>
360backuppc-announce.</p>262
361<p>The backuppc-devel list is only for developers who are working on BackupPC.
362Do not post questions or support requests there. But detailed technical
363discussions should happen on this list.</p>
364<p>To post a message to the backuppc-users list, send an email to</p>263<p>To post a message to the backuppc-users list, send an email to</p>
365<pre>264
366 backuppc-users@lists.sourceforge.net</pre>265<pre><code> backuppc-users@lists.sourceforge.net</code></pre>
266
367<p>Do not send subscription requests to this address!</p>267<p>Do not send subscription requests to this address!</p>
268
368</dd>269</dd>
369<dt><strong><a name="other_programs_of_interest" class="item">Other Programs of Interest</a></strong></dt>270<dt id="Other-Programs-of-Interest">Other Programs of Interest</dt>
370
371<dd>271<dd>
372<p>If you want to mirror linux or unix files or directories to a remote server272
373you should use rsync, <a href="http://rsync.samba.org">http://rsync.samba.org</a>. BackupPC uses273<p>If you want to mirror linux or unix files or directories to a remote server you should use rsync, <a href="http://rsync.samba.org">http://rsync.samba.org</a>. BackupPC uses rsync as a transport mechanism; if you are already an rsync user you can think of BackupPC as adding efficient storage (compression and pooling) and a convenient user interface to rsync.</p>
374rsync as a transport mechanism; if you are already an rsync user you274
375can think of BackupPC as adding efficient storage (compression and275<p>Two popular open source packages that do tape backup are Amanda (<a href="http://www.amanda.org">http://www.amanda.org</a>) and Bacula (<a href="http://www.bacula.org">http://www.bacula.org</a>). These packages can be used as complete solutions, or also as back ends to BackupPC to backup the BackupPC server data to tape.</p>
376pooling) and a convenient user interface to rsync.</p>276
377<p>Two popular open source packages that do tape backup are277<p>Various programs and scripts use rsync to provide hardlinked backups. See, for example, Mike Rubel&#39;s site (<a href="http://www.mikerubel.org/computers/rsync_snapshots">http://www.mikerubel.org/computers/rsync_snapshots</a>), JW Schultz&#39;s dirvish (<a href="http://www.dirvish.org/">http://www.dirvish.org/</a>), Ben Escoto&#39;s rdiff-backup (<a href="http://www.nongnu.org/rdiff-backup">http://www.nongnu.org/rdiff-backup</a>), and John Bowman&#39;s rlbackup (<a href="http://www.math.ualberta.ca/imaging/rlbackup">http://www.math.ualberta.ca/imaging/rlbackup</a>).</p>
378Amanda (<a href="http://www.amanda.org">http://www.amanda.org</a>)278
379and Bacula (<a href="http://www.bacula.org">http://www.bacula.org</a>).279<p>Unison is a utility that can do two-way, interactive, synchronization. See <a href="http://freshmeat.net/projects/unison">http://freshmeat.net/projects/unison</a>. An external wrapper around rsync that maintains transfer data to enable two-way synchronization is drsync; see <a href="http://freshmeat.net/projects/drsync">http://freshmeat.net/projects/drsync</a>.</p>
380These packages can be used as complete solutions, or also as back280
381ends to BackupPC to backup the BackupPC server data to tape.</p>281<p>BackupPC provides many additional features, such as compressed storage, hardlinking any matching files (rather than just files with the same name), and storing special files without root privileges. But these other programs provide simple, effective and fast solutions and are definitely worthy of consideration.</p>
382<p>Various programs and scripts use rsync to provide hardlinked backups.282
383See, for example, Mike Rubel's site (<a href="http://www.mikerubel.org/computers/rsync_snapshots">http://www.mikerubel.org/computers/rsync_snapshots</a>),
384JW Schultz's dirvish (<a href="http://www.dirvish.org/">http://www.dirvish.org/</a>),
385Ben Escoto's rdiff-backup (<a href="http://www.nongnu.org/rdiff-backup">http://www.nongnu.org/rdiff-backup</a>),
386and John Bowman's rlbackup (<a href="http://www.math.ualberta.ca/imaging/rlbackup">http://www.math.ualberta.ca/imaging/rlbackup</a>).</p>
387<p>Unison is a utility that can do two-way, interactive, synchronization.
388See <a href="http://freshmeat.net/projects/unison">http://freshmeat.net/projects/unison</a>. An external wrapper around
389rsync that maintains transfer data to enable two-way synchronization is
390drsync; see <a href="http://freshmeat.net/projects/drsync">http://freshmeat.net/projects/drsync</a>.</p>
391<p>BackupPC provides many additional features, such as compressed storage,
392hardlinking any matching files (rather than just files with the same name),
393and storing special files without root privileges. But these other programs
394provide simple, effective and fast solutions and are definitely worthy of
395consideration.</p>
396</dd>283</dd>
397</dl>284</dl>
398<p>285
399</p>286<h2 id="Road-map">Road map</h2>
400<h2><a name="road_map">Road map</a></h2>287
401<p>The new features planned for future releases of BackupPC288<p>The new features planned for future releases of BackupPC are on the Wiki at <a href="http://backuppc.wiki.sourceforge.net">http://backuppc.wiki.sourceforge.net</a>.</p>
402are on the Wiki at <a href="http://backuppc.wiki.sourceforge.net">http://backuppc.wiki.sourceforge.net</a>.</p>289
403<p>Comments and suggestions are welcome.</p>290<p>Comments and suggestions are welcome.</p>
404<p>291
405</p>292<h2 id="You-can-help">You can help</h2>
406<h2><a name="you_can_help">You can help</a></h2>293
407<p>BackupPC is free. I work on BackupPC because I enjoy doing it and I like294<p>BackupPC is free. I work on BackupPC because I enjoy doing it and I like to contribute to the open source community.</p>
408to contribute to the open source community.</p>295
409<p>BackupPC already has more than enough features for my own needs. The296<p>BackupPC already has more than enough features for my own needs. The main compensation for continuing to work on BackupPC is knowing that more and more people find it useful. So feedback is certainly appreciated, both positive and negative.</p>
410main compensation for continuing to work on BackupPC is knowing that297
411more and more people find it useful. So feedback is certainly298<p>Beyond being a satisfied user and telling other people about it, everyone is encouraged to add links to <a href="http://backuppc.sourceforge.net">http://backuppc.sourceforge.net</a> (I&#39;ll see them via Google) or otherwise publicize BackupPC. Unlike the commercial products in this space, I have a zero budget (in both time and money) for marketing, PR and advertising, so it&#39;s up to all of you! Feel free to vote for BackupPC at <a href="http://freshmeat.net/projects/backuppc">http://freshmeat.net/projects/backuppc</a>.</p>
412appreciated, both positive and negative.</p>299
413<p>Beyond being a satisfied user and telling other people about it, everyone300<p>Also, everyone is encouraged to contribute patches, bug reports, feature and design suggestions, new code, Wiki additions (you can do those directly) and documentation corrections or improvements. Answering questions on the mailing list is a big help too.</p>
414is encouraged to add links to <a href="http://backuppc.sourceforge.net">http://backuppc.sourceforge.net</a>301
415(I'll see them via Google) or otherwise publicize BackupPC. Unlike
416the commercial products in this space, I have a zero budget (in both
417time and money) for marketing, PR and advertising, so it's up to
418all of you! Feel free to vote for BackupPC at
419<a href="http://freshmeat.net/projects/backuppc">http://freshmeat.net/projects/backuppc</a>.</p>
420<p>Also, everyone is encouraged to contribute patches, bug reports,
421feature and design suggestions, new code, Wiki additions (you can
422do those directly) and documentation corrections or improvements.
423Answering questions on the mailing list is a big help too.</p>
424<p>
425<a href="#__index__"><small>Back to Top</small></a>
426</p>
427<hr />302<hr />
428<h1><a name="installing_backuppc">Installing BackupPC</a></h1>303<h1 id="Installing-BackupPC">Installing BackupPC</h1>
429<p>304
430</p>305<h2 id="Requirements">Requirements</h2>
431<h2><a name="requirements">Requirements</a></h2>306
432<p>BackupPC requires:</p>307<p>BackupPC requires:</p>
308
433<ul>309<ul>
434<li>310
435<p>A linux, solaris, or unix based server with a substantial amount of free311<li><p>A linux, solaris, or unix based server with a substantial amount of free disk space (see the next section for what that means). The CPU and disk performance on this server will determine how many simultaneous backups you can run. You should be able to run 4-8 simultaneous backups on a moderately configured server.</p>
436disk space (see the next section for what that means). The CPU and disk312
437performance on this server will determine how many simultaneous backups313<p>Several users have reported significantly better performance using reiserfs compared to ext3 for the BackupPC data file system. It is also recommended you consider either an LVM or RAID setup (either in HW or SW; eg: 3Ware RAID10 or RAID5) so that you can expand the file system as necessary.</p>
438you can run. You should be able to run 4-8 simultaneous backups on a314
439moderately configured server.</p>315<p>When BackupPC starts with an empty pool, all the backup data will be written to the pool on disk. After more backups are done, a higher percentage of incoming files will already be in the pool. BackupPC is able to avoid writing to disk new files that are already in the pool. So over time disk writes will reduce significantly (by perhaps a factor of 20 or more), since eventually 95% or more of incoming backup files are typically in the pool. Disk reads from the pool are still needed to do file compares to verify files are an exact match. So, with a mature pool, if a relatively fast client generates data at say 1MB/sec, and you run 4 simultaneous backups, there will be an average server disk load of about 4MB/sec reads and 0.2MB/sec writes (assuming 95% of the incoming files are in the pool). These rates will be perhaps 40% lower if compression is on.</p>
440<p>Several users have reported significantly better performance using316
441reiserfs compared to ext3 for the BackupPC data file system. It is317</li>
442also recommended you consider either an LVM or RAID setup (either318<li><p>Perl version 5.8.0 or later. If you don&#39;t have perl, please see <a href="http://www.cpan.org">http://www.cpan.org</a>.</p>
443in HW or SW; eg: 3Ware RAID10 or RAID5) so that you can expand the319
444file system as necessary.</p>320</li>
445<p>When BackupPC starts with an empty pool, all the backup data will be321<li><p>Perl modules Compress::Zlib, Archive::Zip and File::RsyncP. Try &quot;perldoc Compress::Zlib&quot; and &quot;perldoc Archive::Zip&quot; to see if you have these modules. If not, fetch them from <a href="http://www.cpan.org">http://www.cpan.org</a> and see the instructions below for how to build and install them.</p>
446written to the pool on disk. After more backups are done, a higher322
447percentage of incoming files will already be in the pool. BackupPC is323<p>The File::RsyncP module is available from <a href="http://perlrsync.sourceforge.net">http://perlrsync.sourceforge.net</a> or CPAN. You&#39;ll need to install the File::RsyncP module if you want to use Rsync as a transport method.</p>
448able to avoid writing to disk new files that are already in the pool.324
449So over time disk writes will reduce significantly (by perhaps a factor325</li>
450of 20 or more), since eventually 95% or more of incoming backup files326<li><p>If you are using smb to backup WinXX machines you need smbclient and nmblookup from the samba package. You will also need nmblookup if you are backing up linux/unix DHCP machines. See <a href="http://www.samba.org">http://www.samba.org</a>. Samba versions 3.x are stable and now recommended instead of 2.x.</p>
451are typically in the pool. Disk reads from the pool are still needed to327
452do file compares to verify files are an exact match. So, with a mature328<p>See <a href="http://www.samba.org">http://www.samba.org</a> for source and binaries. It&#39;s pretty easy to fetch and compile samba, and just grab smbclient and nmblookup, without doing the installation. Alternatively, <a href="http://www.samba.org">http://www.samba.org</a> has binary distributions for most platforms.</p>
453pool, if a relatively fast client generates data at say 1MB/sec, and you329
454run 4 simultaneous backups, there will be an average server disk load of330</li>
455about 4MB/sec reads and 0.2MB/sec writes (assuming 95% of the incoming331<li><p>If you are using tar to backup linux/unix machines, those machines should have version 1.13.7 at a minimum, with version 1.13.20 or higher recommended. Use &quot;tar --version&quot; to check your version. Various GNU mirrors have the newest versions of tar; see <a href="http://www.gnu.org/software/tar/">http://www.gnu.org/software/tar/</a>.</p>
456files are in the pool). These rates will be perhaps 40% lower if332
457compression is on.</p>333</li>
458</li>334<li><p>If you are using rsync to backup linux/unix machines you should have version 2.6.3 or higher on each client machine. See <a href="http://rsync.samba.org">http://rsync.samba.org</a>. Use &quot;rsync --version&quot; to check your version.</p>
459<li>335
460<p>Perl version 5.8.0 or later. If you don't have perl, please336<p>For BackupPC to use Rsync you will also need to install the perl File::RsyncP module, which is available from <a href="http://perlrsync.sourceforge.net">http://perlrsync.sourceforge.net</a>. Version 0.68 or later is required.</p>
461see <a href="http://www.cpan.org">http://www.cpan.org</a>.</p>337
462</li>338</li>
463<li>339<li><p>The Apache web server, see <a href="http://www.apache.org">http://www.apache.org</a>, preferably built with mod_perl support.</p>
464<p>Perl modules Compress::Zlib, Archive::Zip and File::RsyncP. Try &quot;perldoc340
465Compress::Zlib&quot; and &quot;perldoc Archive::Zip&quot; to see if you have these
466modules. If not, fetch them from <a href="http://www.cpan.org">http://www.cpan.org</a> and see the
467instructions below for how to build and install them.</p>
468<p>The File::RsyncP module is available from <a href="http://perlrsync.sourceforge.net">http://perlrsync.sourceforge.net</a>
469or CPAN. You'll need to install the File::RsyncP module if you want to use
470Rsync as a transport method.</p>
471</li>
472<li>
473<p>If you are using smb to backup WinXX machines you need smbclient and
474nmblookup from the samba package. You will also need nmblookup if
475you are backing up linux/unix DHCP machines. See <a href="http://www.samba.org">http://www.samba.org</a>.
476Samba versions 3.x are stable and now recommended instead of 2.x.</p>
477<p>See <a href="http://www.samba.org">http://www.samba.org</a> for source and binaries. It's pretty easy to
478fetch and compile samba, and just grab smbclient and nmblookup, without
479doing the installation. Alternatively, <a href="http://www.samba.org">http://www.samba.org</a> has binary
480distributions for most platforms.</p>
481</li>
482<li>
483<p>If you are using tar to backup linux/unix machines, those machines should have
484version 1.13.7 at a minimum, with version 1.13.20 or higher recommended. Use
485&quot;tar --version&quot; to check your version. Various GNU mirrors have the newest
486versions of tar; see <a href="http://www.gnu.org/software/tar/">http://www.gnu.org/software/tar/</a>.</p>
487</li>
488<li>
489<p>If you are using rsync to backup linux/unix machines you should have
490version 2.6.3 or higher on each client machine. See
491<a href="http://rsync.samba.org">http://rsync.samba.org</a>. Use &quot;rsync --version&quot; to check your version.</p>
492<p>For BackupPC to use Rsync you will also need to install the perl
493File::RsyncP module, which is available from
494<a href="http://perlrsync.sourceforge.net">http://perlrsync.sourceforge.net</a>.
495Version 0.68 or later is required.</p>
496</li>
497<li>
498<p>The Apache web server, see <a href="http://www.apache.org">http://www.apache.org</a>, preferably built
499with mod_perl support.</p>
500</li>341</li>
501</ul>342</ul>
502<p>343
503</p>344<h2 id="What-type-of-storage-space-do-I-need-">What type of storage space do I need?</h2>
504<h2><a name="what_type_of_storage_space_do_i_need">What type of storage space do I need?</a></h2>345
505<p>BackupPC uses hardlinks to pool files common to different backups.346<p>BackupPC uses hardlinks to pool files common to different backups. Therefore BackupPC&#39;s data store (__TOPDIR__) must point to a single file system that supports hardlinks. You cannot split this file system with multiple mount points or using symbolic links to point a sub-directory to a different file system (it is ok to use a single symbolic link at the top-level directory (__TOPDIR__) to point the entire data store somewhere else). You can of course use any kind of RAID system or logical volume manager that combines the capacity of multiple disks into a single, larger, file system. Such approaches have the advantage that the file system can be expanded without having to copy it.</p>
506Therefore BackupPC's data store (__TOPDIR__) must point to a single347
507file system that supports hardlinks. You cannot split this file348<p>Any standard linux or unix file system supports hardlinks. NFS mounted file systems work too (provided the underlying file system supports hardlinks). But windows based FAT and NTFS file systems will not work.</p>
508system with multiple mount points or using symbolic links to point a349
509sub-directory to a different file system (it is ok to use a single350<p>Starting with BackupPC 3.1.0, run-time checks are done at startup and at the start of each backup to ensure that the file system can support hardlinks, since this is a common area of configuration problems.</p>
510symbolic link at the top-level directory (__TOPDIR__) to point the351
511entire data store somewhere else). You can of course use any kind of352<h2 id="How-much-disk-space-do-I-need-">How much disk space do I need?</h2>
512RAID system or logical volume manager that combines the capacity of353
513multiple disks into a single, larger, file system. Such approaches354<p>Here&#39;s one real example for an environment that is backing up 65 laptops with compression off. Each full backup averages 3.2GB. Each incremental backup averages about 0.2GB. Storing one full backup and two incremental backups per laptop is around 240GB of raw data. But because of the pooling of identical files, only 87GB is used. This is without compression.</p>
514have the advantage that the file system can be expanded without having355
515to copy it.</p>356<p>Another example, with compression on: backing up 95 laptops, where each backup averages 3.6GB and each incremental averages about 0.3GB. Keeping three weekly full backups, and six incrementals is around 1200GB of raw data. Because of pooling and compression, only 150GB is needed.</p>
516<p>Any standard linux or unix file system supports hardlinks. NFS mounted357
517file systems work too (provided the underlying file system supports358<p>Here&#39;s a rule of thumb. Add up the disk usage of all the machines you want to backup (210GB in the first example above). This is a rough minimum space estimate that should allow a couple of full backups and at least half a dozen incremental backups per machine. If compression is on you can reduce the storage requirements by maybe 30-40%. Add some margin in case you add more machines or decide to keep more old backups.</p>
518hardlinks). But windows based FAT and NTFS file systems will not work.</p>359
519<p>Starting with BackupPC 3.1.0, run-time checks are done at startup and360<p>Your actual mileage will depend upon the types of clients, operating systems and applications you have. The more uniform the clients and applications the bigger the benefit from pooling common files.</p>
520at the start of each backup to ensure that the file system can support361
521hardlinks, since this is a common area of configuration problems.</p>362<p>For example, the Eudora email tool stores each mail folder in a separate file, and attachments are extracted as separate files. So in the sadly common case of a large attachment emailed to many recipients, Eudora will extract the attachment into a new file. When these machines are backed up, only one copy of the file will be stored on the server, even though the file appears in many different full or incremental backups. In this sense Eudora is a &quot;friendly&quot; application from the point of view of backup storage requirements.</p>
522<p>363
523</p>364<p>An example at the other end of the spectrum is Outlook. Everything (email bodies, attachments, calendar, contact lists) is stored in a single file, which often becomes huge. Any change to this file requires a separate copy of the file to be saved during backup. Outlook is even more troublesome, since it keeps this file locked all the time, so it cannot be read by smbclient whenever Outlook is running. See the <a>Limitations</a> section for more discussion of this problem.</p>
524<h2><a name="how_much_disk_space_do_i_need">How much disk space do I need?</a></h2>365
525<p>Here's one real example for an environment that is backing up 65 laptops366<p>In addition to total disk space, you should make sure you have plenty of inodes on your BackupPC data partition. Some users have reported running out of inodes on their BackupPC data partition. So even if you have plenty of disk space, BackupPC will report failures when the inodes are exhausted. This is a particular problem with ext2/ext3 file systems that have a fixed number of inodes when the file system is built. Use &quot;df -i&quot; to see your inode usage.</p>
526with compression off. Each full backup averages 3.2GB. Each incremental367
527backup averages about 0.2GB. Storing one full backup and two incremental368<h2 id="Step-1:-Getting-BackupPC">Step 1: Getting BackupPC</h2>
528backups per laptop is around 240GB of raw data. But because of the369
529pooling of identical files, only 87GB is used. This is without370<p>Some linux distributions now include BackupPC. The Debian distribution, supported by Ludovic Drolez, can be found at <a href="http://packages.debian.org/backuppc">http://packages.debian.org/backuppc</a> and is included in the current stable Debian release. On Debian, BackupPC can be installed with the command:</p>
530compression.</p>371
531<p>Another example, with compression on: backing up 95 laptops, where372<pre><code> apt-get install backuppc</code></pre>
532each backup averages 3.6GB and each incremental averages about 0.3GB.373
533Keeping three weekly full backups, and six incrementals is around374<p>In the future there might be packages for Gentoo and other linux flavors. If the packaged version is older than the released version then you may want to install the latest version as described below.</p>
5341200GB of raw data. Because of pooling and compression, only 150GB375
535is needed.</p>376<p>Otherwise, manually fetching and installing BackupPC is easy. Start by downloading the latest version from <a href="http://backuppc.sourceforge.net">http://backuppc.sourceforge.net</a>. Hit the &quot;Code&quot; button, then select the &quot;backuppc&quot; or &quot;backuppc-beta&quot; package and download the latest version.</p>
536<p>Here's a rule of thumb. Add up the disk usage of all the machines you377
537want to backup (210GB in the first example above). This is a rough378<h2 id="Step-2:-Installing-the-distribution">Step 2: Installing the distribution</h2>
538minimum space estimate that should allow a couple of full backups and at379
539least half a dozen incremental backups per machine. If compression is on380<p>Note: most information in this step is only relevant if you build and install BackupPC yourself. If you use a package provided by a distribution, the package management system should take of installing any needed dependencies.</p>
540you can reduce the storage requirements by maybe 30-40%. Add some margin381
541in case you add more machines or decide to keep more old backups.</p>382<p>First off, there are five perl modules you should install. These are all optional, but highly recommended:</p>
542<p>Your actual mileage will depend upon the types of clients, operating383
543systems and applications you have. The more uniform the clients and
544applications the bigger the benefit from pooling common files.</p>
545<p>For example, the Eudora email tool stores each mail folder in a separate
546file, and attachments are extracted as separate files. So in the sadly
547common case of a large attachment emailed to many recipients, Eudora
548will extract the attachment into a new file. When these machines are
549backed up, only one copy of the file will be stored on the server, even
550though the file appears in many different full or incremental backups. In
551this sense Eudora is a &quot;friendly&quot; application from the point of view of
552backup storage requirements.</p>
553<p>An example at the other end of the spectrum is Outlook. Everything
554(email bodies, attachments, calendar, contact lists) is stored in a
555single file, which often becomes huge. Any change to this file requires
556a separate copy of the file to be saved during backup. Outlook is even
557more troublesome, since it keeps this file locked all the time, so it
558cannot be read by smbclient whenever Outlook is running. See the
559<a href="#limitations">Limitations</a> section for more discussion of this problem.</p>
560<p>In addition to total disk space, you should make sure you have
561plenty of inodes on your BackupPC data partition. Some users have
562reported running out of inodes on their BackupPC data partition.
563So even if you have plenty of disk space, BackupPC will report
564failures when the inodes are exhausted. This is a particular
565problem with ext2/ext3 file systems that have a fixed number of
566inodes when the file system is built. Use &quot;df -i&quot; to see your
567inode usage.</p>
568<p>
569</p>
570<h2><a name="step_1__getting_backuppc">Step 1: Getting BackupPC</a></h2>
571<p>Some linux distributions now include BackupPC. The Debian
572distribution, supported by Ludovic Drolez, can be found at
573<a href="http://packages.debian.org/backuppc">http://packages.debian.org/backuppc</a> and is included
574in the current stable Debian release. On Debian, BackupPC can
575be installed with the command:</p>
576<pre>
577 apt-get install backuppc</pre>
578<p>In the future there might be packages for Gentoo and other
579linux flavors. If the packaged version is older than the
580released version then you may want to install the
581latest version as described below.</p>
582<p>Otherwise, manually fetching and installing BackupPC is easy.
583Start by downloading the latest version from
584<a href="http://backuppc.sourceforge.net">http://backuppc.sourceforge.net</a>. Hit the &quot;Code&quot; button,
585then select the &quot;backuppc&quot; or &quot;backuppc-beta&quot; package and
586download the latest version.</p>
587<p>
588</p>
589<h2><a name="step_2__installing_the_distribution">Step 2: Installing the distribution</a></h2>
590<p>Note: most information in this step is only relevant if you build
591and install BackupPC yourself. If you use a package provided by a
592distribution, the package management system should take of installing
593any needed dependencies.</p>
594<p>First off, there are five perl modules you should install.
595These are all optional, but highly recommended:</p>
596<dl>384<dl>
597<dt><strong><a name="compress_zlib" class="item">Compress::Zlib</a></strong></dt>385
598386<dt id="Compress::Zlib">Compress::Zlib</dt>
599<dd>387<dd>
600<p>To enable compression, you will need to install Compress::Zlib388
601from <a href="http://www.cpan.org">http://www.cpan.org</a>.389<p>To enable compression, you will need to install Compress::Zlib from <a href="http://www.cpan.org">http://www.cpan.org</a>. You can run &quot;perldoc Compress::Zlib&quot; to see if this module is installed.</p>
602You can run &quot;perldoc Compress::Zlib&quot; to see if this module is installed.</p>390
603</dd>391</dd>
604<dt><strong><a name="archive_zip" class="item">Archive::Zip</a></strong></dt>392<dt id="Archive::Zip">Archive::Zip</dt>
605393<dd>
606<dd>394
607<p>To support restore via Zip archives you will need to install395<p>To support restore via Zip archives you will need to install Archive::Zip, also from <a href="http://www.cpan.org">http://www.cpan.org</a>. You can run &quot;perldoc Archive::Zip&quot; to see if this module is installed.</p>
608Archive::Zip, also from <a href="http://www.cpan.org">http://www.cpan.org</a>.396
609You can run &quot;perldoc Archive::Zip&quot; to see if this module is installed.</p>397</dd>
610</dd>398<dt id="XML::RSS">XML::RSS</dt>
611<dt><strong><a name="xml_rss" class="item">XML::RSS</a></strong></dt>399<dd>
612400
613<dd>401<p>To support the RSS feature you will need to install XML::RSS, also from <a href="http://www.cpan.org">http://www.cpan.org</a>. There is not need to install this module if you don&#39;t plan on using RSS. You can run &quot;perldoc XML::RSS&quot; to see if this module is installed.</p>
614<p>To support the RSS feature you will need to install XML::RSS, also from402
615<a href="http://www.cpan.org">http://www.cpan.org</a>. There is not need to install this module if you403</dd>
616don't plan on using RSS. You can run &quot;perldoc XML::RSS&quot; to see if this404<dt id="File::RsyncP">File::RsyncP</dt>
617module is installed.</p>405<dd>
618</dd>406
619<dt><strong><a name="file_rsyncp" class="item">File::RsyncP</a></strong></dt>407<p>To use rsync and rsyncd with BackupPC you will need to install File::RsyncP. You can run &quot;perldoc File::RsyncP&quot; to see if this module is installed. File::RsyncP is available from <a href="http://perlrsync.sourceforge.net">http://perlrsync.sourceforge.net</a>. Version 0.68 or later is required.</p>
620408
621<dd>409</dd>
622<p>To use rsync and rsyncd with BackupPC you will need to install File::RsyncP.410<dt id="File::Listing-Net::FTP-Net::FTP::RetrHandle-Net::FTP::AutoReconnect">File::Listing, Net::FTP, Net::FTP::RetrHandle, Net::FTP::AutoReconnect</dt>
623You can run &quot;perldoc File::RsyncP&quot; to see if this module is installed.411<dd>
624File::RsyncP is available from <a href="http://perlrsync.sourceforge.net">http://perlrsync.sourceforge.net</a>.412
625Version 0.68 or later is required.</p>413<p>To use ftp with BackupPC you will need four libraries, but actually need to install only File::Listing from <a href="http://www.cpan.org">http://www.cpan.org</a>. You can run &quot;perldoc File::Listing&quot; to see if this module is installed. Net::FTP is a standard module. Net::FTP::RetrHandle and Net::FTP::AutoReconnect included in BackupPC distribution.</p>
626</dd>414
627<dt><strong><a name="file_listing_net_ftp_net_ftp_retrhandle_net_ftp_autoreconnect" class="item">File::Listing, Net::FTP, Net::FTP::RetrHandle, Net::FTP::AutoReconnect</a></strong></dt>
628
629<dd>
630<p>To use ftp with BackupPC you will need four libraries, but actually
631need to install only File::Listing from <a href="http://www.cpan.org">http://www.cpan.org</a>.
632You can run &quot;perldoc File::Listing&quot; to see if this module is installed.
633Net::FTP is a standard module. Net::FTP::RetrHandle and
634Net::FTP::AutoReconnect included in BackupPC distribution.</p>
635</dd>415</dd>
636</dl>416</dl>
637<p>To build and install these packages you should use the cpan program.417
638Alternatively, you can fetch the tar.gz file from <a href="http://www.cpan.org">http://www.cpan.org</a>418<p>To build and install these packages you should use the cpan program. Alternatively, you can fetch the tar.gz file from <a href="http://www.cpan.org">http://www.cpan.org</a> and then run these commands:</p>
639and then run these commands:</p>419
640<pre>420<pre><code> tar zxvf Archive-Zip-1.26.tar.gz
641 tar zxvf Archive-Zip-1.26.tar.gz
642 cd Archive-Zip-1.26421 cd Archive-Zip-1.26
643 perl Makefile.PL422 perl Makefile.PL
644 make423 make
645 make test424 make test
646 make install</pre>425 make install</code></pre>
426
647<p>The same sequence of commands can be used for each module.</p>427<p>The same sequence of commands can be used for each module.</p>
648<p>Now let's move onto BackupPC itself. After fetching428
649BackupPC-3.2.1.tar.gz, run these commands as root:</p>429<p>Now let&#39;s move onto BackupPC itself. After fetching BackupPC-3.3.0.tar.gz, run these commands as root:</p>
650<pre>430
651 tar zxf BackupPC-3.2.1.tar.gz431<pre><code> tar zxf BackupPC-3.3.0.tar.gz
652 cd BackupPC-3.2.1432 cd BackupPC-3.3.0
653 perl configure.pl</pre>433 perl configure.pl</code></pre>
654<p>In the future this release might also have patches available on the434
655SourceForge site. These patch files are text files, with a name of435<p>In the future this release might also have patches available on the SourceForge site. These patch files are text files, with a name of the form</p>
656the form</p>436
657<pre>437<pre><code> BackupPC-3.3.0plN.diff</code></pre>
658 BackupPC-3.2.1plN.diff</pre>438
659<p>where N is the patch level, eg: pl2 is patch-level 2. These439<p>where N is the patch level, eg: pl2 is patch-level 2. These patch files are cumulative: you only need apply the last patch file, not all the earlier patch files. If a patch file is available, eg: BackupPC-3.3.0pl2.diff, you should apply the patch after extracting the tar file:</p>
660patch files are cumulative: you only need apply the last patch440
661file, not all the earlier patch files. If a patch file is441<pre><code> # fetch BackupPC-3.3.0.tar.gz
662available, eg: BackupPC-3.2.1pl2.diff, you should apply442 # fetch BackupPC-3.3.0pl2.diff
663the patch after extracting the tar file:</p>443 tar zxf BackupPC-3.3.0.tar.gz
664<pre>444 cd BackupPC-3.3.0
665 # fetch BackupPC-3.2.1.tar.gz445 patch -p0 &lt; ../BackupPC-3.3.0pl2.diff
666 # fetch BackupPC-3.2.1pl2.diff446 perl configure.pl</code></pre>
667 tar zxf BackupPC-3.2.1.tar.gz447
668 cd BackupPC-3.2.1448<p>A patch file includes comments that describe that bug fixes and changes. Feel free to review it before you apply the patch.</p>
669 patch -p0 &lt; ../BackupPC-3.2.1pl2.diff449
670 perl configure.pl</pre>450<p>The configure.pl script also accepts command-line options if you wish to run it in a non-interactive manner. It has self-contained documentation for all the command-line options, which you can read with perldoc:</p>
671<p>A patch file includes comments that describe that bug fixes451
672and changes. Feel free to review it before you apply the patch.</p>452<pre><code> perldoc configure.pl</code></pre>
673<p>The configure.pl script also accepts command-line options if you453
674wish to run it in a non-interactive manner. It has self-contained454<p>Starting with BackupPC 3.0.0, the configure.pl script by default complies with the file system hierarchy (FHS) conventions. The major difference compared to earlier versions is that by default configuration files will be stored in /etc/BackupPC rather than below the data directory, __TOPDIR__/conf, and the log files will be stored in /var/log/BackupPC rather than below the data directory, __TOPDIR__/log.</p>
675documentation for all the command-line options, which you can455
676read with perldoc:</p>456<p>Note that distributions may choose to use different locations for BackupPC files than these defaults.</p>
677<pre>457
678 perldoc configure.pl</pre>458<p>If you are upgrading from an earlier version the configure.pl script will keep the configuration files and log files in their original location.</p>
679<p>Starting with BackupPC 3.0.0, the configure.pl script by default459
680complies with the file system hierarchy (FHS) conventions. The460<p>When you run configure.pl you will be prompted for the full paths of various executables, and you will be prompted for the following information.</p>
681major difference compared to earlier versions is that by default461
682configuration files will be stored in /etc/BackupPC
683rather than below the data directory, __TOPDIR__/conf,
684and the log files will be stored in /var/log/BackupPC
685rather than below the data directory, __TOPDIR__/log.</p>
686<p>Note that distributions may choose to use different locations for
687BackupPC files than these defaults.</p>
688<p>If you are upgrading from an earlier version the configure.pl script
689will keep the configuration files and log files in their original
690location.</p>
691<p>When you run configure.pl you will be prompted for the full paths
692of various executables, and you will be prompted for the following
693information.</p>
694<dl>462<dl>
695<dt><strong><a name="backuppc_user" class="item">BackupPC User</a></strong></dt>
696463
464<dt id="BackupPC-User">BackupPC User</dt>
697<dd>465<dd>
698<p>It is best if BackupPC runs as a special user, eg backuppc, that has466
699limited privileges. It is preferred that backuppc belongs to a system467<p>It is best if BackupPC runs as a special user, eg backuppc, that has limited privileges. It is preferred that backuppc belongs to a system administrator group so that sys admin members can browse BackupPC files, edit the configuration files and so on. Although configurable, the default settings leave group read permission on pool files, so make sure the BackupPC user&#39;s group is chosen restrictively.</p>
700administrator group so that sys admin members can browse BackupPC files,468
701edit the configuration files and so on. Although configurable, the
702default settings leave group read permission on pool files, so make
703sure the BackupPC user's group is chosen restrictively.</p>
704<p>On this installation, this is __BACKUPPCUSER__.</p>469<p>On this installation, this is __BACKUPPCUSER__.</p>
705<p>For security purposes you might choose to configure the BackupPC470
706user with the shell set to /bin/false. Since you might need to471<p>For security purposes you might choose to configure the BackupPC user with the shell set to /bin/false. Since you might need to run some BackupPC programs as the BackupPC user for testing purposes, you can use the -s option to su to explicitly run a shell, eg:</p>
707run some BackupPC programs as the BackupPC user for testing472
708purposes, you can use the -s option to su to explicitly run473<pre><code> su -s /bin/bash __BACKUPPCUSER__</code></pre>
709a shell, eg:</p>474
710<pre>
711 su -s /bin/bash __BACKUPPCUSER__</pre>
712<p>Depending upon your configuration you might also need the -l option.</p>475<p>Depending upon your configuration you might also need the -l option.</p>
476
713</dd>477</dd>
714<dt><strong><a name="data_directory" class="item">Data Directory</a></strong></dt>478<dt id="Data-Directory">Data Directory</dt>
715
716<dd>479<dd>
717<p>You need to decide where to put the data directory, below which480
718all the BackupPC data is stored. This needs to be a big file system.</p>481<p>You need to decide where to put the data directory, below which all the BackupPC data is stored. This needs to be a big file system.</p>
482
719<p>On this installation, this is __TOPDIR__.</p>483<p>On this installation, this is __TOPDIR__.</p>
484
720</dd>485</dd>
721<dt><strong><a name="install_directory" class="item">Install Directory</a></strong></dt>486<dt id="Install-Directory">Install Directory</dt>
722
723<dd>487<dd>
724<p>You should decide where the BackupPC scripts, libraries and documentation488
725should be installed, eg: /usr/local/BackupPC.</p>489<p>You should decide where the BackupPC scripts, libraries and documentation should be installed, eg: /usr/local/BackupPC.</p>
490
726<p>On this installation, this is __INSTALLDIR__.</p>491<p>On this installation, this is __INSTALLDIR__.</p>
492
727</dd>493</dd>
728<dt><strong><a name="cgi_bin_directory" class="item">CGI bin Directory</a></strong></dt>494<dt id="CGI-bin-Directory">CGI bin Directory</dt>
729
730<dd>495<dd>
731<p>You should decide where the BackupPC CGI script resides. This will496
732usually be below Apache's cgi-bin directory.</p>497<p>You should decide where the BackupPC CGI script resides. This will usually be below Apache&#39;s cgi-bin directory.</p>
733<p>It is also possible to use a different directory and use Apache's498
734``&lt;Directory&gt;'' directive to specifiy that location. See the Apache499<p>It is also possible to use a different directory and use Apache&#39;s ``&lt;Directory&gt;&#39;&#39; directive to specifiy that location. See the Apache HTTP Server documentation for additional information.</p>
735HTTP Server documentation for additional information.</p>500
736<p>On this installation, this is __CGIDIR__.</p>501<p>On this installation, this is __CGIDIR__.</p>
737</dd>502
738<dt><strong><a name="apache_image_directory" class="item">Apache image Directory</a></strong></dt>503</dd>
739504<dt id="Apache-image-Directory">Apache image Directory</dt>
740<dd>505<dd>
741<p>A directory where BackupPC's images are stored so that Apache can506
742serve them. You should ensure this directory is readable by Apache and507<p>A directory where BackupPC&#39;s images are stored so that Apache can serve them. You should ensure this directory is readable by Apache and create a symlink to this directory from the BackupPC CGI bin Directory.</p>
743create a symlink to this directory from the BackupPC CGI bin Directory.</p>508
744</dd>509</dd>
745<dt><strong><a name="config_and_log_directories" class="item">Config and Log Directories</a></strong></dt>510<dt id="Config-and-Log-Directories">Config and Log Directories</dt>
746511<dd>
747<dd>512
748<p>In this installation the configuration and log directories are513<p>In this installation the configuration and log directories are located in the following locations:</p>
749located in the following locations:</p>514
750<pre>515<pre><code> __CONFDIR__/config.pl main config file
751 __CONFDIR__/config.pl main config file
752 __CONFDIR__/hosts hosts file516 __CONFDIR__/hosts hosts file
753 __CONFDIR__/pc/HOST.pl per-pc config file517 __CONFDIR__/pc/HOST.pl per-pc config file
754 __LOGDIR__/BackupPC log files, pid, status</pre>518 __LOGDIR__/BackupPC log files, pid, status</code></pre>
755<p>The configure.pl script doesn't prompt for these locations but519
756they can be set for new installations using command-line options.</p>520<p>The configure.pl script doesn&#39;t prompt for these locations but they can be set for new installations using command-line options.</p>
521
757</dd>522</dd>
758</dl>523</dl>
759<p>524
760</p>525<h2 id="Step-3:-Setting-up-config.pl">Step 3: Setting up config.pl</h2>
761<h2><a name="step_3__setting_up_config_pl">Step 3: Setting up config.pl</a></h2>526
762<p>After running configure.pl, browse through the config file,527<p>After running configure.pl, browse through the config file, __CONFDIR__/config.pl, and make sure all the default settings are correct. In particular, you will need to decide whether to use smb, tar,or rsync or ftp transport (or whether to set it on a per-PC basis) and set the relevant parameters for that transport method. See the section <a href="#Step-5:-Client-Setup">&quot;Step 5: Client Setup&quot;</a> for more details.</p>
763__CONFDIR__/config.pl, and make sure all the default settings are528
764correct. In particular, you will need to decide whether to use529<h2 id="Step-4:-Setting-up-the-hosts-file">Step 4: Setting up the hosts file</h2>
765smb, tar,or rsync or ftp transport (or whether to set it on a530
766per-PC basis) and set the relevant parameters for that transport531<p>The file __CONFDIR__/hosts contains the list of clients to backup. BackupPC reads this file in three cases:</p>
767method. See the section <a href="#step_5__client_setup">Client Setup</a> for532
768more details.</p>
769<p>
770</p>
771<h2><a name="step_4__setting_up_the_hosts_file">Step 4: Setting up the hosts file</a></h2>
772<p>The file __CONFDIR__/hosts contains the list of clients to backup.
773BackupPC reads this file in three cases:</p>
774<ul>533<ul>
775<li>534
776<p>Upon startup.</p>535<li><p>Upon startup.</p>
777</li>536
778<li>537</li>
779<p>When BackupPC is sent a HUP (-1) signal. Assuming you installed the538<li><p>When BackupPC is sent a HUP (-1) signal. Assuming you installed the init.d script, you can also do this with &quot;/etc/init.d/backuppc reload&quot;.</p>
780init.d script, you can also do this with &quot;/etc/init.d/backuppc reload&quot;.</p>539
781</li>540</li>
782<li>541<li><p>When the modification time of the hosts file changes. BackupPC checks the modification time once during each regular wakeup.</p>
783<p>When the modification time of the hosts file changes. BackupPC542
784checks the modification time once during each regular wakeup.</p>
785</li>543</li>
786</ul>544</ul>
787<p>Whenever you change the hosts file (to add or remove a host) you can545
788either do a kill -HUP BackupPC_pid or simply wait until the next regular546<p>Whenever you change the hosts file (to add or remove a host) you can either do a kill -HUP BackupPC_pid or simply wait until the next regular wakeup period.</p>
789wakeup period.</p>547
790<p>Each line in the hosts file contains three fields, separated548<p>Each line in the hosts file contains three fields, separated by white space:</p>
791by white space:</p>549
792<dl>550<dl>
793<dt><strong><a name="host_name" class="item">Host name</a></strong></dt>
794551
552<dt id="Host-name">Host name</dt>
795<dd>553<dd>
796<p>This is typically the host name or NetBios name of the client machine554
797and should be in lower case. The host name can contain spaces (escape555<p>This is typically the host name or NetBios name of the client machine and should be in lower case. The host name can contain spaces (escape with a backslash), but it is not recommended.</p>
798with a backslash), but it is not recommended.</p>556
799<p>Please read the section <a href="#how_backuppc_finds_hosts">How BackupPC Finds Hosts</a>.</p>557<p>Please read the section <a href="#How-BackupPC-Finds-Hosts">&quot;How BackupPC Finds Hosts&quot;</a>.</p>
800<p>In certain cases you might want several distinct clients to refer558
801to the same physical machine. For example, you might have a database559<p>In certain cases you might want several distinct clients to refer to the same physical machine. For example, you might have a database you want to backup, and you want to bracket the backup of the database with shutdown/restart using <a href="#_conf_dumppreusercmd_">$Conf{DumpPreUserCmd}</a> and <a href="#_conf_dumppostusercmd_">$Conf{DumpPostUserCmd}</a>. But you also want to backup the rest of the machine while the database is still running. In the case you can specify two different clients in the host file, using any mnemonic name (eg: myhost_mysql and myhost), and use <a href="#_conf_clientnamealias_">$Conf{ClientNameAlias}</a> in myhost_mysql&#39;s config.pl to specify the real host name of the machine.</p>
802you want to backup, and you want to bracket the backup of the database560
803with shutdown/restart using <a href="#_conf_dumppreusercmd_">$Conf{DumpPreUserCmd}</a> and <a href="#_conf_dumppostusercmd_">$Conf{DumpPostUserCmd}</a>.
804But you also want to backup the rest of the machine while the database
805is still running. In the case you can specify two different clients in
806the host file, using any mnemonic name (eg: myhost_mysql and myhost), and
807use <a href="#_conf_clientnamealias_">$Conf{ClientNameAlias}</a> in myhost_mysql's config.pl to specify the
808real host name of the machine.</p>
809</dd>561</dd>
810<dt><strong><a name="dhcp_flag" class="item">DHCP flag</a></strong></dt>562<dt id="DHCP-flag">DHCP flag</dt>
811
812<dd>563<dd>
813<p>Starting with v2.0.0 the way hosts are discovered has changed and now564
814in most cases you should specify 0 for the DHCP flag, even if the host565<p>Starting with v2.0.0 the way hosts are discovered has changed and now in most cases you should specify 0 for the DHCP flag, even if the host has a dynamically assigned IP address. Please read the section <a href="#How-BackupPC-Finds-Hosts">&quot;How BackupPC Finds Hosts&quot;</a> to understand whether you need to set the DHCP flag.</p>
815has a dynamically assigned IP address.566
816Please read the section <a href="#how_backuppc_finds_hosts">How BackupPC Finds Hosts</a>567<p>You only need to set DHCP to 1 if your client machine doesn&#39;t respond to the NetBios multicast request:</p>
817to understand whether you need to set the DHCP flag.</p>568
818<p>You only need to set DHCP to 1 if your client machine doesn't569<pre><code> nmblookup myHost</code></pre>
819respond to the NetBios multicast request:</p>570
820<pre>
821 nmblookup myHost</pre>
822<p>but does respond to a request directed to its IP address:</p>571<p>but does respond to a request directed to its IP address:</p>
823<pre>572
824 nmblookup -A W.X.Y.Z</pre>573<pre><code> nmblookup -A W.X.Y.Z</code></pre>
825<p>If you do set DHCP to 1 on any client you will need to specify the range of574
826DHCP addresses to search is specified in <a href="#_conf_dhcpaddressranges_">$Conf{DHCPAddressRanges}</a>.</p>575<p>If you do set DHCP to 1 on any client you will need to specify the range of DHCP addresses to search is specified in <a href="#_conf_dhcpaddressranges_">$Conf{DHCPAddressRanges}</a>.</p>
827<p>Note also that the <a href="#_conf_clientnamealias_">$Conf{ClientNameAlias}</a> feature does not work for576
828clients with DHCP set to 1.</p>577<p>Note also that the <a href="#_conf_clientnamealias_">$Conf{ClientNameAlias}</a> feature does not work for clients with DHCP set to 1.</p>
829</dd>578
830<dt><strong><a name="user_name" class="item">User name</a></strong></dt>579</dd>
831580<dt id="User-name">User name</dt>
832<dd>581<dd>
833<p>This should be the unix login/email name of the user who &quot;owns&quot; or uses582
834this machine. This is the user who will be sent email about this583<p>This should be the unix login/email name of the user who &quot;owns&quot; or uses this machine. This is the user who will be sent email about this machine, and this user will have permission to stop/start/browse/restore backups for this host. Leave this blank if no specific person should receive email or be allowed to stop/start/browse/restore backups for this host. Administrators will still have full permissions.</p>
835machine, and this user will have permission to stop/start/browse/restore584
836backups for this host. Leave this blank if no specific person should585</dd>
837receive email or be allowed to stop/start/browse/restore backups586<dt id="More-users">More users</dt>
838for this host. Administrators will still have full permissions.</p>587<dd>
839</dd>588
840<dt><strong><a name="more_users" class="item">More users</a></strong></dt>589<p>Additional user names, separate by commas and with no white space, can be specified. These users will also have full permission in the CGI interface to stop/start/browse/restore backups for this host. These users will not be sent email about this host.</p>
841590
842<dd>
843<p>Additional user names, separate by commas and with no white space,
844can be specified. These users will also have full permission in
845the CGI interface to stop/start/browse/restore backups for this host.
846These users will not be sent email about this host.</p>
847</dd>591</dd>
848</dl>592</dl>
849<p>The first non-comment line of the hosts file is special: it contains593
850the names of the columns and should not be edited.</p>594<p>The first non-comment line of the hosts file is special: it contains the names of the columns and should not be edited.</p>
851<p>Here's a simple example of a hosts file:</p>595
852<pre>596<p>Here&#39;s a simple example of a hosts file:</p>
853 host dhcp user moreUsers597
598<pre><code> host dhcp user moreUsers
854 farside 0 craig jim,dave599 farside 0 craig jim,dave
855 larson 1 gary andy</pre>600 larson 1 gary andy</code></pre>
856<p>601
857</p>602<h2 id="Step-5:-Client-Setup">Step 5: Client Setup</h2>
858<h2><a name="step_5__client_setup">Step 5: Client Setup</a></h2>603
859<p>Four methods for getting backup data from a client are supported:604<p>Four methods for getting backup data from a client are supported: smb, tar, rsync and ftp. Smb or rsync are the preferred methods for WinXX clients and rsync or tar are the preferred methods for linux/unix/MacOSX clients.</p>
860smb, tar, rsync and ftp. Smb or rsync are the preferred methods605
861for WinXX clients and rsync or tar are the preferred methods for606<p>The transfer method is set using the <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> configuration setting. If you have a mixed environment (ie: you will use smb for some clients and tar for others), you will need to pick the most common choice for <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> for the main config.pl file, and then override it in the per-PC config file for those hosts that will use the other method. (Or you could run two completely separate instances of BackupPC, with different data directories, one for WinXX and the other for linux/unix, but then common files between the different machine types will duplicated.)</p>
862linux/unix/MacOSX clients.</p>607
863<p>The transfer method is set using the <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> configuration
864setting. If you have a mixed environment (ie: you will use smb for some
865clients and tar for others), you will need to pick the most common
866choice for <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> for the main config.pl file, and then
867override it in the per-PC config file for those hosts that will use
868the other method. (Or you could run two completely separate instances
869of BackupPC, with different data directories, one for WinXX and the
870other for linux/unix, but then common files between the different
871machine types will duplicated.)</p>
872<p>Here are some brief client setup notes:</p>608<p>Here are some brief client setup notes:</p>
609
873<dl>610<dl>
874<dt><strong><a name="winxx" class="item">WinXX</a></strong></dt>
875611
612<dt id="WinXX">WinXX</dt>
876<dd>613<dd>
877<p>One setup for WinXX clients is to set <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> to &quot;smb&quot;.614
878Actually, rsyncd is the better method for WinXX if you are prepared to615<p>One setup for WinXX clients is to set <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> to &quot;smb&quot;. Actually, rsyncd is the better method for WinXX if you are prepared to run rsync/cygwin on your WinXX client.</p>
879run rsync/cygwin on your WinXX client.</p>616
880<p>If you want to use rsyncd for WinXX clients you can find a pre-packaged617<p>If you want to use rsyncd for WinXX clients you can find a pre-packaged zip file on <a href="http://backuppc.sourceforge.net">http://backuppc.sourceforge.net</a>. The package is called cygwin-rsync. It contains rsync.exe, template setup files and the minimal set of cygwin libraries for everything to run. The README file contains instructions for running rsync as a service, so it starts automatically everytime you boot your machine. If you use rsync to backup WinXX machines, be sure to set <a href="#_conf_clientcharset_">$Conf{ClientCharset}</a> correctly (eg: &#39;cp1252&#39;) so that the WinXX file name encoding is correctly converted to utf8.</p>
881zip file on <a href="http://backuppc.sourceforge.net">http://backuppc.sourceforge.net</a>. The package is called618
882cygwin-rsync. It contains rsync.exe, template setup files and the619<p>Otherwise, to use SMB, you can either create shares for the data you want to backup or your can use the existing C$ share. To create a new share, open &quot;My Computer&quot;, right click on the drive (eg: C), and select &quot;Sharing...&quot; (or select &quot;Properties&quot; and select the &quot;Sharing&quot; tab). In this dialog box you can enable sharing, select the share name and permissions.</p>
883minimal set of cygwin libraries for everything to run. The README file620
884contains instructions for running rsync as a service, so it starts621<p>All Windows NT based OS (NT, 2000, XP Pro), are configured by default to share the entire C drive as C$. This is a special share used for various administration functions, one of which is to grant access to backup operators. All you need to do is create a new domain user, specifically for backup. Then add the new backup user to the built in &quot;Backup Operators&quot; group. You now have backup capability for any directory on any computer in the domain in one easy step. This avoids using administrator accounts and only grants permission to do exactly what you want for the given user, i.e.: backup. Also, for additional security, you may wish to deny the ability for this user to logon to computers in the default domain policy.</p>
885automatically everytime you boot your machine. If you use rsync622
886to backup WinXX machines, be sure to set <a href="#_conf_clientcharset_">$Conf{ClientCharset}</a>623<p>If this machine uses DHCP you will also need to make sure the NetBios name is set. Go to Control Panel|System|Network Identification (on Win2K) or Control Panel|System|Computer Name (on WinXP). Also, you should go to Control Panel|Network Connections|Local Area Connection|Properties|Internet Protocol (TCP/IP)|Properties|Advanced|WINS and verify that NetBios is not disabled.</p>
887correctly (eg: 'cp1252') so that the WinXX file name encoding is624
888correctly converted to utf8.</p>625<p>The relevant configuration settings are <a href="#_conf_smbsharename_">$Conf{SmbShareName}</a>, <a href="#_conf_smbshareusername_">$Conf{SmbShareUserName}</a>, <a href="#_conf_smbsharepasswd_">$Conf{SmbSharePasswd}</a>, <a href="#_conf_smbclientpath_">$Conf{SmbClientPath}</a>, <a href="#_conf_smbclientfullcmd_">$Conf{SmbClientFullCmd}</a>, <a href="#_conf_smbclientincrcmd_">$Conf{SmbClientIncrCmd}</a> and <a href="#_conf_smbclientrestorecmd_">$Conf{SmbClientRestoreCmd}</a>.</p>
889<p>Otherwise, to use SMB, you can either create shares for the data you want626
890to backup or your can use the existing C$ share. To create a new 627<p>BackupPC needs to know the smb share user name and password for a client machine that uses smb. The user name is specified in <a href="#_conf_smbshareusername_">$Conf{SmbShareUserName}</a>. There are four ways to tell BackupPC the smb share password:</p>
891share, open &quot;My Computer&quot;, right click on the drive (eg: C), and628
892select &quot;Sharing...&quot; (or select &quot;Properties&quot; and select the &quot;Sharing&quot;
893tab). In this dialog box you can enable sharing, select the share name
894and permissions.</p>
895<p>All Windows NT based OS (NT, 2000, XP Pro), are configured by default
896to share the entire C drive as C$. This is a special share used for
897various administration functions, one of which is to grant access to backup
898operators. All you need to do is create a new domain user, specifically
899for backup. Then add the new backup user to the built in &quot;Backup
900Operators&quot; group. You now have backup capability for any directory on
901any computer in the domain in one easy step. This avoids using
902administrator accounts and only grants permission to do exactly what you
903want for the given user, i.e.: backup.
904Also, for additional security, you may wish to deny the ability for this
905user to logon to computers in the default domain policy.</p>
906<p>If this machine uses DHCP you will also need to make sure the
907NetBios name is set. Go to Control Panel|System|Network Identification
908(on Win2K) or Control Panel|System|Computer Name (on WinXP).
909Also, you should go to Control Panel|Network Connections|Local Area
910Connection|Properties|Internet Protocol (TCP/IP)|Properties|Advanced|WINS
911and verify that NetBios is not disabled.</p>
912<p>The relevant configuration settings are <a href="#_conf_smbsharename_">$Conf{SmbShareName}</a>,
913<a href="#_conf_smbshareusername_">$Conf{SmbShareUserName}</a>, <a href="#_conf_smbsharepasswd_">$Conf{SmbSharePasswd}</a>, <a href="#_conf_smbclientpath_">$Conf{SmbClientPath}</a>,
914<a href="#_conf_smbclientfullcmd_">$Conf{SmbClientFullCmd}</a>, <a href="#_conf_smbclientincrcmd_">$Conf{SmbClientIncrCmd}</a> and
915<a href="#_conf_smbclientrestorecmd_">$Conf{SmbClientRestoreCmd}</a>.</p>
916<p>BackupPC needs to know the smb share user name and password for a
917client machine that uses smb. The user name is specified in
918<a href="#_conf_smbshareusername_">$Conf{SmbShareUserName}</a>. There are four ways to tell BackupPC the
919smb share password:</p>
920<ul>629<ul>
921<li>630
922<p>As an environment variable BPC_SMB_PASSWD set before BackupPC starts.631<li><p>As an environment variable BPC_SMB_PASSWD set before BackupPC starts. If you start BackupPC manually the BPC_SMB_PASSWD variable must be set manually first. For backward compatibility for v1.5.0 and prior, the environment variable PASSWD can be used if BPC_SMB_PASSWD is not set. Warning: on some systems it is possible to see environment variables of running processes.</p>
923If you start BackupPC manually the BPC_SMB_PASSWD variable must be set632
924manually first. For backward compatibility for v1.5.0 and prior, the633</li>
925environment variable PASSWD can be used if BPC_SMB_PASSWD is not set.634<li><p>Alternatively the BPC_SMB_PASSWD setting can be included in /etc/init.d/backuppc, in which case you must make sure this file is not world (other) readable.</p>
926Warning: on some systems it is possible to see environment variables of635
927running processes.</p>636</li>
928</li>637<li><p>As a configuration variable <a href="#_conf_smbsharepasswd_">$Conf{SmbSharePasswd}</a> in __CONFDIR__/config.pl. If you put the password here you must make sure this file is not world (other) readable.</p>
929<li>638
930<p>Alternatively the BPC_SMB_PASSWD setting can be included in639</li>
931/etc/init.d/backuppc, in which case you must make sure this file640<li><p>As a configuration variable <a href="#_conf_smbsharepasswd_">$Conf{SmbSharePasswd}</a> in the per-PC configuration file (__CONFDIR__/pc/$host.pl or __TOPDIR__/pc/$host/config.pl in non-FHS versions of BackupPC). You will have to use this option if the smb share password is different for each host. If you put the password here you must make sure this file is not world (other) readable.</p>
932is not world (other) readable.</p>641
933</li>
934<li>
935<p>As a configuration variable <a href="#_conf_smbsharepasswd_">$Conf{SmbSharePasswd}</a> in
936__CONFDIR__/config.pl. If you put the password
937here you must make sure this file is not world (other) readable.</p>
938</li>
939<li>
940<p>As a configuration variable <a href="#_conf_smbsharepasswd_">$Conf{SmbSharePasswd}</a> in the per-PC
941configuration file (__CONFDIR__/pc/$host.pl or
942__TOPDIR__/pc/$host/config.pl in non-FHS versions of BackupPC).
943You will have to use this option if the smb share password is different
944for each host. If you put the password here you must make sure this file
945is not world (other) readable.</p>
946</li>642</li>
947</ul>643</ul>
948<p>Placement and protection of the smb share password is a possible644
949security risk, so please double-check the file and directory645<p>Placement and protection of the smb share password is a possible security risk, so please double-check the file and directory permissions. In a future version there might be support for encryption of this password, but a private key will still have to be stored in a protected place. Suggestions are welcome.</p>
950permissions. In a future version there might be support for646
951encryption of this password, but a private key will still have to647<p>As an alternative to setting <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> to &quot;smb&quot; (using smbclient) for WinXX clients, you can use an smb network filesystem (eg: ksmbfs or similar) on your linux/unix server to mount the share, and then set <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> to &quot;tar&quot; (use tar on the network mounted file system).</p>
952be stored in a protected place. Suggestions are welcome.</p>648
953<p>As an alternative to setting <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> to &quot;smb&quot; (using649<p>Also, to make sure that file names with special characters are correctly transferred by smbclient you should make sure that the smb.conf file has (for samba 3.x):</p>
954smbclient) for WinXX clients, you can use an smb network filesystem (eg:650
955ksmbfs or similar) on your linux/unix server to mount the share,651<pre><code> [global]
956and then set <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> to &quot;tar&quot; (use tar on the network652 unix charset = UTF8</code></pre>
957mounted file system).</p>653
958<p>Also, to make sure that file names with special characters are correctly654<p>UTF8 is the default setting, so if the parameter is missing then it is ok. With this setting <a href="#_conf_clientcharset_">$Conf{ClientCharset}</a> should be emtpy, since smbclient has already converted the file names to utf8.</p>
959transferred by smbclient you should make sure that the smb.conf file655
960has (for samba 3.x):</p>
961<pre>
962 [global]
963 unix charset = UTF8</pre>
964<p>UTF8 is the default setting, so if the parameter is missing then it
965is ok. With this setting <a href="#_conf_clientcharset_">$Conf{ClientCharset}</a> should be emtpy,
966since smbclient has already converted the file names to utf8.</p>
967</dd>656</dd>
968<dt><strong><a name="linux_unix" class="item">Linux/Unix</a></strong></dt>657<dt id="Linux-Unix">Linux/Unix</dt>
969
970<dd>658<dd>
971<p>The preferred setup for linux/unix clients is to set <a href="#_conf_xfermethod_">$Conf{XferMethod}</a>659
972to &quot;rsync&quot;, &quot;rsyncd&quot; or &quot;tar&quot;.</p>660<p>The preferred setup for linux/unix clients is to set <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> to &quot;rsync&quot;, &quot;rsyncd&quot; or &quot;tar&quot;.</p>
973<p>You can use either rsync, smb, or tar for linux/unix machines. Smb requires661
974that the Samba server (smbd) be run to provide the shares. Since the smb662<p>You can use either rsync, smb, or tar for linux/unix machines. Smb requires that the Samba server (smbd) be run to provide the shares. Since the smb protocol can&#39;t represent special files like symbolic links and fifos, tar and rsync are the better transport methods for linux/unix machines. (In fact, by default samba makes symbolic links look like the file or directory that they point to, so you could get an infinite loop if a symbolic link points to the current or parent directory. If you really need to use Samba shares for linux/unix backups you should turn off the &quot;follow symlinks&quot; samba config setting. See the smb.conf manual page.)</p>
975protocol can't represent special files like symbolic links and fifos,663
976tar and rsync are the better transport methods for linux/unix machines.
977(In fact, by default samba makes symbolic links look like the file or
978directory that they point to, so you could get an infinite loop if a
979symbolic link points to the current or parent directory. If you really
980need to use Samba shares for linux/unix backups you should turn off the
981&quot;follow symlinks&quot; samba config setting. See the smb.conf manual page.)</p>
982<p>The requirements for each Xfer Method are:</p>664<p>The requirements for each Xfer Method are:</p>
665
983<dl>666<dl>
984<dt><strong><a name="tar" class="item">tar</a></strong></dt>667
985668<dt id="tar">tar</dt>
986<dd>669<dd>
987<p>You must have GNU tar on the client machine. Use &quot;tar --version&quot;670
988or &quot;gtar --version&quot; to verify. The version should be at least671<p>You must have GNU tar on the client machine. Use &quot;tar --version&quot; or &quot;gtar --version&quot; to verify. The version should be at least 1.13.7, and 1.13.20 or greater is recommended. Tar is run on the client machine via rsh or ssh.</p>
9891.13.7, and 1.13.20 or greater is recommended. Tar is run on672
990the client machine via rsh or ssh.</p>673<p>The relevant configuration settings are <a href="#_conf_tarclientpath_">$Conf{TarClientPath}</a>, <a href="#_conf_tarsharename_">$Conf{TarShareName}</a>, <a href="#_conf_tarclientcmd_">$Conf{TarClientCmd}</a>, <a href="#_conf_tarfullargs_">$Conf{TarFullArgs}</a>, <a href="#_conf_tarincrargs_">$Conf{TarIncrArgs}</a>, and <a href="#_conf_tarclientrestorecmd_">$Conf{TarClientRestoreCmd}</a>.</p>
991<p>The relevant configuration settings are <a href="#_conf_tarclientpath_">$Conf{TarClientPath}</a>,674
992<a href="#_conf_tarsharename_">$Conf{TarShareName}</a>, <a href="#_conf_tarclientcmd_">$Conf{TarClientCmd}</a>, <a href="#_conf_tarfullargs_">$Conf{TarFullArgs}</a>,675</dd>
993<a href="#_conf_tarincrargs_">$Conf{TarIncrArgs}</a>, and <a href="#_conf_tarclientrestorecmd_">$Conf{TarClientRestoreCmd}</a>.</p>676<dt id="rsync">rsync</dt>
994</dd>677<dd>
995<dt><strong><a name="rsync" class="item">rsync</a></strong></dt>678
996679<p>You should have at least rsync 2.6.3, and the latest version is recommended. Rsync is run on the remote client via rsh or ssh.</p>
997<dd>680
998<p>You should have at least rsync 2.6.3, and the latest version is681<p>The relevant configuration settings are <a href="#_conf_rsyncclientpath_">$Conf{RsyncClientPath}</a>, <a href="#_conf_rsyncclientcmd_">$Conf{RsyncClientCmd}</a>, <a href="#_conf_rsyncclientrestorecmd_">$Conf{RsyncClientRestoreCmd}</a>, <a href="#_conf_rsyncsharename_">$Conf{RsyncShareName}</a>, <a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a>, and <a href="#_conf_rsyncrestoreargs_">$Conf{RsyncRestoreArgs}</a>.</p>
999recommended. Rsync is run on the remote client via rsh or ssh.</p>682
1000<p>The relevant configuration settings are <a href="#_conf_rsyncclientpath_">$Conf{RsyncClientPath}</a>,683</dd>
1001<a href="#_conf_rsyncclientcmd_">$Conf{RsyncClientCmd}</a>, <a href="#_conf_rsyncclientrestorecmd_">$Conf{RsyncClientRestoreCmd}</a>, <a href="#_conf_rsyncsharename_">$Conf{RsyncShareName}</a>,684<dt id="rsyncd">rsyncd</dt>
1002<a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a>, and <a href="#_conf_rsyncrestoreargs_">$Conf{RsyncRestoreArgs}</a>.</p>685<dd>
1003</dd>686
1004<dt><strong><a name="rsyncd" class="item">rsyncd</a></strong></dt>687<p>You should have at least rsync 2.6.3, and the latest version is recommended. In this case the rsync daemon should be running on the client machine and BackupPC connects directly to it.</p>
1005688
1006<dd>689<p>The relevant configuration settings are <a href="#_conf_rsyncdclientport_">$Conf{RsyncdClientPort}</a>, <a href="#_conf_rsyncdusername_">$Conf{RsyncdUserName}</a>, <a href="#_conf_rsyncdpasswd_">$Conf{RsyncdPasswd}</a>, <a href="#_conf_rsyncdauthrequired_">$Conf{RsyncdAuthRequired}</a>, <a href="#_conf_rsyncsharename_">$Conf{RsyncShareName}</a>, <a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a>, <a href="#_conf_rsyncargsextra_">$Conf{RsyncArgsExtra}</a>, and <a href="#_conf_rsyncrestoreargs_">$Conf{RsyncRestoreArgs}</a>. <a href="#_conf_rsyncsharename_">$Conf{RsyncShareName}</a> is the name of an rsync module (ie: the thing in square brackets in rsyncd&#39;s conf file -- see rsyncd.conf), not a file system path.</p>
1007<p>You should have at least rsync 2.6.3, and the latest version is690
1008recommended. In this case the rsync daemon should be running on691<p>Be aware that rsyncd will remove the leading &#39;/&#39; from path names in symbolic links if you specify &quot;use chroot = no&quot; in the rsynd.conf file. See the rsyncd.conf manual page for more information.</p>
1009the client machine and BackupPC connects directly to it.</p>692
1010<p>The relevant configuration settings are <a href="#_conf_rsyncdclientport_">$Conf{RsyncdClientPort}</a>,693</dd>
1011<a href="#_conf_rsyncdusername_">$Conf{RsyncdUserName}</a>, <a href="#_conf_rsyncdpasswd_">$Conf{RsyncdPasswd}</a>, <a href="#_conf_rsyncdauthrequired_">$Conf{RsyncdAuthRequired}</a>,694<dt id="ftp">ftp</dt>
1012<a href="#_conf_rsyncsharename_">$Conf{RsyncShareName}</a>, <a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a>, <a href="#_conf_rsyncargsextra_">$Conf{RsyncArgsExtra}</a>, and695<dd>
1013<a href="#_conf_rsyncrestoreargs_">$Conf{RsyncRestoreArgs}</a>. <a href="#_conf_rsyncsharename_">$Conf{RsyncShareName}</a> is the name of an rsync696
1014module (ie: the thing in square brackets in rsyncd's conf file -- see697<p>You need to be running an ftp server on the client machine. The relevant configuration settings are <a href="#_conf_ftpsharename_">$Conf{FtpShareName}</a>, <a href="#_conf_ftpusername_">$Conf{FtpUserName}</a>, <a href="#_conf_ftppasswd_">$Conf{FtpPasswd}</a>, <a href="#_conf_ftpblocksize_">$Conf{FtpBlockSize}</a>, <a href="#_conf_ftpport_">$Conf{FtpPort}</a>, <a href="#_conf_ftptimeout_">$Conf{FtpTimeout}</a>, and <a href="#_conf_ftpfollowsymlinks_">$Conf{FtpFollowSymlinks}</a>.</p>
1015rsyncd.conf), not a file system path.</p>698
1016<p>Be aware that rsyncd will remove the leading '/' from path names in699</dd>
1017symbolic links if you specify &quot;use chroot = no&quot; in the rsynd.conf file.700</dl>
1018See the rsyncd.conf manual page for more information.</p>701
1019</dd>702<p>You need to set <a href="#_conf_clientcharset_">$Conf{ClientCharset}</a> to the client&#39;s charset so that file names are correctly converted to utf8. Use &quot;locale charmap&quot; on the client to see its charset.</p>
1020<dt><strong><a name="ftp" class="item">ftp</a></strong></dt>703
1021704<p>For linux/unix machines you should not backup &quot;/proc&quot;. This directory contains a variety of files that look like regular files but they are special files that don&#39;t need to be backed up (eg: /proc/kcore is a regular file that contains physical memory). See <a href="#_conf_backupfilesexclude_">$Conf{BackupFilesExclude}</a>. It is safe to back up /dev since it contains mostly character-special and block-special files, which are correctly handed by BackupPC (eg: backing up /dev/hda5 just saves the block-special file information, not the contents of the disk).</p>
1022<dd>705
1023<p>You need to be running an ftp server on the client machine.706<p>Alternatively, rather than backup all the file systems as a single share (&quot;/&quot;), it is easier to restore a single file system if you backup each file system separately. To do this you should list each file system mount point in <a href="#_conf_tarsharename_">$Conf{TarShareName}</a> or <a href="#_conf_rsyncsharename_">$Conf{RsyncShareName}</a>, and add the --one-file-system option to <a href="#_conf_tarclientcmd_">$Conf{TarClientCmd}</a> or <a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a>. In this case there is no need to exclude /proc explicitly since it looks like a different file system.</p>
1024The relevant configuration settings are <a href="#_conf_ftpsharename_">$Conf{FtpShareName}</a>,707
1025<a href="#_conf_ftpusername_">$Conf{FtpUserName}</a>, <a href="#_conf_ftppasswd_">$Conf{FtpPasswd}</a>, <a href="#_conf_ftpblocksize_">$Conf{FtpBlockSize}</a>,708<p>Next you should decide whether to run tar over ssh, rsh or nfs. Ssh is the preferred method. Rsh is not secure and therefore not recommended. Nfs will work, but you need to make sure that the BackupPC user (running on the server) has sufficient permissions to read all the files below the nfs mount.</p>
1026<a href="#_conf_ftpport_">$Conf{FtpPort}</a>, <a href="#_conf_ftptimeout_">$Conf{FtpTimeout}</a>, and <a href="#_conf_ftpfollowsymlinks_">$Conf{FtpFollowSymlinks}</a>.</p>709
1027</dd>710<p>Ssh allows BackupPC to run as a privileged user on the client (eg: root), since it needs sufficient permissions to read all the backup files. Ssh is setup so that BackupPC on the server (an otherwise low privileged user) can ssh as root on the client, without being prompted for a password. There are two common versions of ssh: v1 and v2. Here are some instructions for one way to setup ssh. (Check which version of SSH you have by typing &quot;ssh&quot; or &quot;man ssh&quot;.)</p>
1028</dl>711
1029<p>You need to set <a href="#_conf_clientcharset_">$Conf{ClientCharset}</a> to the client's charset so that712</dd>
1030file names are correctly converted to utf8. Use &quot;locale charmap&quot;713<dt id="MacOSX">MacOSX</dt>
1031on the client to see its charset.</p>714<dd>
1032<p>For linux/unix machines you should not backup &quot;/proc&quot;. This directory715
1033contains a variety of files that look like regular files but they are716<p>In general this should be similar to Linux/Unix machines. In versions 10.4 and later, the native MacOSX tar works, and also supports resource forks. xtar is another option, and rsync works too (although the MacOSX-supplied rsync has an extension for extended attributes that is not compatible with standard rsync).</p>
1034special files that don't need to be backed up (eg: /proc/kcore is a717
1035regular file that contains physical memory). See <a href="#_conf_backupfilesexclude_">$Conf{BackupFilesExclude}</a>.718</dd>
1036It is safe to back up /dev since it contains mostly character-special719<dt id="SSH-Setup">SSH Setup</dt>
1037and block-special files, which are correctly handed by BackupPC720<dd>
1038(eg: backing up /dev/hda5 just saves the block-special file information,721
1039not the contents of the disk).</p>722<p>SSH is a secure way to run tar or rsync on a backup client to extract the data. SSH provides strong authentication and encryption of the network data.</p>
1040<p>Alternatively, rather than backup all the file systems as a single723
1041share (&quot;/&quot;), it is easier to restore a single file system if you backup724<p>Note that if you run rsyncd (rsync daemon), ssh is not used. In this case, rsyncd provides its own authentication, but there is no encryption of network data. If you want encryption of network data you can use ssh to create a tunnel, or use a program like stunnel.</p>
1042each file system separately. To do this you should list each file system725
1043mount point in <a href="#_conf_tarsharename_">$Conf{TarShareName}</a> or <a href="#_conf_rsyncsharename_">$Conf{RsyncShareName}</a>, and add the726<p>Setup instructions for ssh can be found at <a href="http://backuppc.sourceforge.net/faq/ssh.html">http://backuppc.sourceforge.net/faq/ssh.html</a> or on the Wiki.</p>
1044--one-file-system option to <a href="#_conf_tarclientcmd_">$Conf{TarClientCmd}</a> or <a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a>.727
1045In this case there is no need to exclude /proc explicitly since it looks728</dd>
1046like a different file system.</p>729<dt id="Clients-that-use-DHCP">Clients that use DHCP</dt>
1047<p>Next you should decide whether to run tar over ssh, rsh or nfs. Ssh is730<dd>
1048the preferred method. Rsh is not secure and therefore not recommended.731
1049Nfs will work, but you need to make sure that the BackupPC user (running732<p>If a client machine uses DHCP BackupPC needs some way to find the IP address given the host name. One alternative is to set dhcp to 1 in the hosts file, and BackupPC will search a pool of IP addresses looking for hosts. More efficiently, it is better to set dhcp = 0 and provide a mechanism for BackupPC to find the IP address given the host name.</p>
1050on the server) has sufficient permissions to read all the files below733
1051the nfs mount.</p>734<p>For WinXX machines BackupPC uses the NetBios name server to determine the IP address given the host name. For unix machines you can run nmbd (the NetBios name server) from the Samba distribution so that the machine responds to a NetBios name request. See the manual page and Samba documentation for more information.</p>
1052<p>Ssh allows BackupPC to run as a privileged user on the client (eg:735
1053root), since it needs sufficient permissions to read all the backup736<p>Alternatively, you can set <a href="#_conf_nmblookupfindhostcmd_">$Conf{NmbLookupFindHostCmd}</a> to any command that returns the IP address given the host name.</p>
1054files. Ssh is setup so that BackupPC on the server (an otherwise low737
1055privileged user) can ssh as root on the client, without being prompted738<p>Please read the section <a href="#How-BackupPC-Finds-Hosts">&quot;How BackupPC Finds Hosts&quot;</a> for more details.</p>
1056for a password. There are two common versions of ssh: v1 and v2. Here739
1057are some instructions for one way to setup ssh. (Check which version740</dd>
1058of SSH you have by typing &quot;ssh&quot; or &quot;man ssh&quot;.)</p>741</dl>
1059</dd>742
1060<dt><strong><a name="macosx" class="item">MacOSX</a></strong></dt>743<h2 id="Step-6:-Running-BackupPC">Step 6: Running BackupPC</h2>
1061744
1062<dd>745<p>The installation contains an init.d backuppc script that can be copied to /etc/init.d so that BackupPC can auto-start on boot. See init.d/README for further instructions.</p>
1063<p>In general this should be similar to Linux/Unix machines.746
1064In versions 10.4 and later, the native MacOSX tar works,747<p>BackupPC should be ready to start. If you installed the init.d script, then you should be able to run BackupPC with:</p>
1065and also supports resource forks. xtar is another option,748
1066and rsync works too (although the MacOSX-supplied rsync749<pre><code> /etc/init.d/backuppc start</code></pre>
1067has an extension for extended attributes that is not750
1068compatible with standard rsync).</p>751<p>(This script can also be invoked with &quot;stop&quot; to stop BackupPC and &quot;reload&quot; to tell BackupPC to reload config.pl and the hosts file.)</p>
1069</dd>752
1070<dt><strong><a name="ssh_setup" class="item">SSH Setup</a></strong></dt>
1071
1072<dd>
1073<p>SSH is a secure way to run tar or rsync on a backup client to extract
1074the data. SSH provides strong authentication and encryption of
1075the network data.</p>
1076<p>Note that if you run rsyncd (rsync daemon), ssh is not used.
1077In this case, rsyncd provides its own authentication, but there
1078is no encryption of network data. If you want encryption of
1079network data you can use ssh to create a tunnel, or use a
1080program like stunnel.</p>
1081<p>Setup instructions for ssh can be found at
1082<a href="http://backuppc.sourceforge.net/faq/ssh.html">http://backuppc.sourceforge.net/faq/ssh.html</a> or on the Wiki.</p>
1083</dd>
1084<dt><strong><a name="clients_that_use_dhcp" class="item">Clients that use DHCP</a></strong></dt>
1085
1086<dd>
1087<p>If a client machine uses DHCP BackupPC needs some way to find the
1088IP address given the host name. One alternative is to set dhcp
1089to 1 in the hosts file, and BackupPC will search a pool of IP
1090addresses looking for hosts. More efficiently, it is better to
1091set dhcp = 0 and provide a mechanism for BackupPC to find the
1092IP address given the host name.</p>
1093<p>For WinXX machines BackupPC uses the NetBios name server to determine
1094the IP address given the host name.
1095For unix machines you can run nmbd (the NetBios name server) from
1096the Samba distribution so that the machine responds to a NetBios
1097name request. See the manual page and Samba documentation for more
1098information.</p>
1099<p>Alternatively, you can set <a href="#_conf_nmblookupfindhostcmd_">$Conf{NmbLookupFindHostCmd}</a> to any command
1100that returns the IP address given the host name.</p>
1101<p>Please read the section <a href="#how_backuppc_finds_hosts">How BackupPC Finds Hosts</a>
1102for more details.</p>
1103</dd>
1104</dl>
1105<p>
1106</p>
1107<h2><a name="step_6__running_backuppc">Step 6: Running BackupPC</a></h2>
1108<p>The installation contains an init.d backuppc script that can be copied
1109to /etc/init.d so that BackupPC can auto-start on boot.
1110See init.d/README for further instructions.</p>
1111<p>BackupPC should be ready to start. If you installed the init.d script,
1112then you should be able to run BackupPC with:</p>
1113<pre>
1114 /etc/init.d/backuppc start</pre>
1115<p>(This script can also be invoked with &quot;stop&quot; to stop BackupPC and &quot;reload&quot;
1116to tell BackupPC to reload config.pl and the hosts file.)</p>
1117<p>Otherwise, just run</p>753<p>Otherwise, just run</p>
1118<pre>754
1119 __INSTALLDIR__/bin/BackupPC -d</pre>755<pre><code> __INSTALLDIR__/bin/BackupPC -d</code></pre>
1120<p>as user __BACKUPPCUSER__. The -d option tells BackupPC to run as a daemon756
1121(ie: it does an additional fork).</p>757<p>as user __BACKUPPCUSER__. The -d option tells BackupPC to run as a daemon (ie: it does an additional fork).</p>
1122<p>Any immediate errors will be printed to stderr and BackupPC will quit.758
1123Otherwise, look in __LOGDIR__/LOG and verify that BackupPC reports759<p>Any immediate errors will be printed to stderr and BackupPC will quit. Otherwise, look in __LOGDIR__/LOG and verify that BackupPC reports it has started and all is ok.</p>
1124it has started and all is ok.</p>760
1125<p>761<h2 id="Step-7:-Talking-to-BackupPC">Step 7: Talking to BackupPC</h2>
1126</p>762
1127<h2><a name="step_7__talking_to_backuppc">Step 7: Talking to BackupPC</a></h2>763<p>You should verify that BackupPC is running by using BackupPC_serverMesg. This sends a message to BackupPC via the unix (or TCP) socket and prints the response. Like all BackupPC programs, BackupPC_serverMesg should be run as the BackupPC user (__BACKUPPCUSER__), so you should</p>
1128<p>You should verify that BackupPC is running by using BackupPC_serverMesg.764
1129This sends a message to BackupPC via the unix (or TCP) socket and prints765<pre><code> su __BACKUPPCUSER__</code></pre>
1130the response. Like all BackupPC programs, BackupPC_serverMesg766
1131should be run as the BackupPC user (__BACKUPPCUSER__), so you767<p>before running BackupPC_serverMesg. If the BackupPC user is configured with /bin/false as the shell, you can use the -s option to su to explicitly run a shell, eg:</p>
1132should</p>768
1133<pre>769<pre><code> su -s /bin/bash __BACKUPPCUSER__</code></pre>
1134 su __BACKUPPCUSER__</pre>770
1135<p>before running BackupPC_serverMesg. If the BackupPC user is771<p>Depending upon your configuration you might also need the -l option.</p>
1136configured with /bin/false as the shell, you can use the -s772
1137option to su to explicitly run a shell, eg:</p>773<p>You can request status information and start and stop backups using this interface. This socket interface is mainly provided for the CGI interface (and some of the BackupPC sub-programs use it too). But right now we just want to make sure BackupPC is happy. Each of these commands should produce some status output:</p>
1138<pre>774
1139 su -s /bin/bash __BACKUPPCUSER__</pre>775<pre><code> __INSTALLDIR__/bin/BackupPC_serverMesg status info
1140<p>Depending upon your configuration you might also need
1141the -l option.</p>
1142<p>You can request status information and start and stop backups using this
1143interface. This socket interface is mainly provided for the CGI interface
1144(and some of the BackupPC sub-programs use it too). But right now we just
1145want to make sure BackupPC is happy. Each of these commands should
1146produce some status output:</p>
1147<pre>
1148 __INSTALLDIR__/bin/BackupPC_serverMesg status info
1149 __INSTALLDIR__/bin/BackupPC_serverMesg status jobs776 __INSTALLDIR__/bin/BackupPC_serverMesg status jobs
1150 __INSTALLDIR__/bin/BackupPC_serverMesg status hosts</pre>777 __INSTALLDIR__/bin/BackupPC_serverMesg status hosts</code></pre>
1151<p>The output should be some hashes printed with Data::Dumper. If it778
1152looks cryptic and confusing, and doesn't look like an error message,779<p>The output should be some hashes printed with Data::Dumper. If it looks cryptic and confusing, and doesn&#39;t look like an error message, then all is ok.</p>
1153then all is ok.</p>780
1154<p>The jobs status should initially show just BackupPC_trashClean.781<p>The jobs status should initially show just BackupPC_trashClean. The hosts status should produce a list of every host you have listed in __CONFDIR__/hosts as part of a big cryptic output line.</p>
1155The hosts status should produce a list of every host you have listed782
1156in __CONFDIR__/hosts as part of a big cryptic output line.</p>
1157<p>You can also request that all hosts be queued:</p>783<p>You can also request that all hosts be queued:</p>
1158<pre>784
1159 __INSTALLDIR__/bin/BackupPC_serverMesg backup all</pre>785<pre><code> __INSTALLDIR__/bin/BackupPC_serverMesg backup all</code></pre>
1160<p>At this point you should make sure the CGI interface works since786
1161it will be much easier to see what is going on. That's our787<p>At this point you should make sure the CGI interface works since it will be much easier to see what is going on. That&#39;s our next subject.</p>
1162next subject.</p>788
1163<p>789<h2 id="Step-8:-Checking-email-delivery">Step 8: Checking email delivery</h2>
1164</p>790
1165<h2><a name="step_8__checking_email_delivery">Step 8: Checking email delivery</a></h2>791<p>The script BackupPC_sendEmail sends status and error emails to the administrator and users. It is usually run each night by BackupPC_nightly.</p>
1166<p>The script BackupPC_sendEmail sends status and error emails to792
1167the administrator and users. It is usually run each night793<p>To verify that it can run sendmail and deliver email correctly you should ask it to send a test email to you:</p>
1168by BackupPC_nightly.</p>794
1169<p>To verify that it can run sendmail and deliver email correctly795<pre><code> su __BACKUPPCUSER__
1170you should ask it to send a test email to you:</p>796 __INSTALLDIR__/bin/BackupPC_sendEmail -u MYNAME@MYDOMAIN.COM</code></pre>
1171<pre>797
1172 su __BACKUPPCUSER__798<p>BackupPC_sendEmail also takes a -c option that checks if BackupPC is running, and it sends an email to <a href="#_conf_emailadminusername_">$Conf{EMailAdminUserName}</a> if it is not. That can be used as a keep-alive check by adding</p>
1173 __INSTALLDIR__/bin/BackupPC_sendEmail -u MYNAME@MYDOMAIN.COM</pre>799
1174<p>BackupPC_sendEmail also takes a -c option that checks if BackupPC800<pre><code> __INSTALLDIR__/bin/BackupPC_sendEmail -c</code></pre>
1175is running, and it sends an email to <a href="#_conf_emailadminusername_">$Conf{EMailAdminUserName}</a>801
1176if it is not. That can be used as a keep-alive check by adding</p>802<p>to __BACKUPPCUSER__&#39;s cron.</p>
1177<pre>803
1178 __INSTALLDIR__/bin/BackupPC_sendEmail -c</pre>804<p>The -t option to BackupPC_sendEmail causes it to print the email message instead of invoking sendmail to deliver the message.</p>
1179<p>to __BACKUPPCUSER__'s cron.</p>805
1180<p>The -t option to BackupPC_sendEmail causes it to print the email806<h2 id="Step-9:-CGI-interface">Step 9: CGI interface</h2>
1181message instead of invoking sendmail to deliver the message.</p>807
1182<p>808<p>The CGI interface script, BackupPC_Admin, is a powerful and flexible way to see and control what BackupPC is doing. It is written for an Apache server. If you don&#39;t have Apache, see <a href="http://www.apache.org">http://www.apache.org</a>.</p>
1183</p>809
1184<h2><a name="step_9__cgi_interface">Step 9: CGI interface</a></h2>810<p>There are two options for setting up the CGI interface: standard mode and using mod_perl. Mod_perl provides much higher performance (around 15x) and is the best choice if your Apache was built with mod_perl support. To see if your apache was built with mod_perl run this command:</p>
1185<p>The CGI interface script, BackupPC_Admin, is a powerful and flexible811
1186way to see and control what BackupPC is doing. It is written for an812<pre><code> httpd -l | egrep mod_perl</code></pre>
1187Apache server. If you don't have Apache, see <a href="http://www.apache.org">http://www.apache.org</a>.</p>813
1188<p>There are two options for setting up the CGI interface: standard
1189mode and using mod_perl. Mod_perl provides much higher performance
1190(around 15x) and is the best choice if your Apache was built with
1191mod_perl support. To see if your apache was built with mod_perl
1192run this command:</p>
1193<pre>
1194 httpd -l | egrep mod_perl</pre>
1195<p>If this prints mod_perl.c then your Apache supports mod_perl.</p>814<p>If this prints mod_perl.c then your Apache supports mod_perl.</p>
1196<p>Note: on some distributions (like Debian) the command is not ``httpd'',815
1197but ``apache'' or ``apache2''. Those distributions will generally also816<p>Note: on some distributions (like Debian) the command is not ``httpd&#39;&#39;, but ``apache&#39;&#39; or ``apache2&#39;&#39;. Those distributions will generally also use ``apache&#39;&#39; for the Apache user account and configuration files.</p>
1198use ``apache'' for the Apache user account and configuration files.</p>817
1199<p>Using mod_perl with BackupPC_Admin requires a dedicated Apache818<p>Using mod_perl with BackupPC_Admin requires a dedicated Apache to be run as the BackupPC user (__BACKUPPCUSER__). This is because BackupPC_Admin needs permission to access various files in BackupPC&#39;s data directories. In contrast, the standard installation (without mod_perl) solves this problem by having BackupPC_Admin installed as setuid to the BackupPC user, so that BackupPC_Admin runs as the BackupPC user.</p>
1200to be run as the BackupPC user (__BACKUPPCUSER__). This is819
1201because BackupPC_Admin needs permission to access various files
1202in BackupPC's data directories. In contrast, the standard
1203installation (without mod_perl) solves this problem by having
1204BackupPC_Admin installed as setuid to the BackupPC user, so that
1205BackupPC_Admin runs as the BackupPC user.</p>
1206<p>Here are some specifics for each setup:</p>820<p>Here are some specifics for each setup:</p>
821
1207<dl>822<dl>
1208<dt><strong><a name="standard_setup" class="item">Standard Setup</a></strong></dt>
1209823
824<dt id="Standard-Setup">Standard Setup</dt>
1210<dd>825<dd>
1211<p>The CGI interface should have been installed by the configure.pl script826
1212in __CGIDIR__/BackupPC_Admin. BackupPC_Admin should have been installed827<p>The CGI interface should have been installed by the configure.pl script in __CGIDIR__/BackupPC_Admin. BackupPC_Admin should have been installed as setuid to the BackupPC user (__BACKUPPCUSER__), in addition to user and group execute permission.</p>
1213as setuid to the BackupPC user (__BACKUPPCUSER__), in addition to user828
1214and group execute permission.</p>829<p>You should be very careful about permissions on BackupPC_Admin and the directory __CGIDIR__: it is important that normal users cannot directly execute or change BackupPC_Admin, otherwise they can access backup files for any PC. You might need to change the group ownership of BackupPC_Admin to a group that Apache belongs to so that Apache can execute it (don&#39;t add &quot;other&quot; execute permission!). The permissions should look like this:</p>
1215<p>You should be very careful about permissions on BackupPC_Admin and830
1216the directory __CGIDIR__: it is important that normal users cannot831<pre><code> ls -l __CGIDIR__/BackupPC_Admin
1217directly execute or change BackupPC_Admin, otherwise they can access832 -swxr-x--- 1 __BACKUPPCUSER__ web 82406 Jun 17 22:58 __CGIDIR__/BackupPC_Admin</code></pre>
1218backup files for any PC. You might need to change the group ownership833
1219of BackupPC_Admin to a group that Apache belongs to so that Apache834<p>The setuid script won&#39;t work unless perl on your machine was installed with setuid emulation. This is likely the problem if you get an error saying such as &quot;Wrong user: my userid is 25, instead of 150&quot;, meaning the script is running as the httpd user, not the BackupPC user. This is because setuid scripts are disabled by the kernel in most flavors of unix and linux.</p>
1220can execute it (don't add &quot;other&quot; execute permission!).835
1221The permissions should look like this:</p>836<p>To see if your perl has setuid emulation, see if there is a program called sperl5.8.0 (or sperl5.8.2 etc, based on your perl version) in the place where perl is installed. If you can&#39;t find this program, then you have two options: rebuild and reinstall perl with the setuid emulation turned on (answer &quot;y&quot; to the question &quot;Do you want to do setuid/setgid emulation?&quot; when you run perl&#39;s configure script), or switch to the mod_perl alternative for the CGI script (which doesn&#39;t need setuid to work).</p>
1222<pre>837
1223 ls -l __CGIDIR__/BackupPC_Admin
1224 -swxr-x--- 1 __BACKUPPCUSER__ web 82406 Jun 17 22:58 __CGIDIR__/BackupPC_Admin</pre>
1225<p>The setuid script won't work unless perl on your machine was installed
1226with setuid emulation. This is likely the problem if you get an error
1227saying such as &quot;Wrong user: my userid is 25, instead of 150&quot;, meaning
1228the script is running as the httpd user, not the BackupPC user.
1229This is because setuid scripts are disabled by the kernel in most
1230flavors of unix and linux.</p>
1231<p>To see if your perl has setuid emulation, see if there is a program
1232called sperl5.8.0 (or sperl5.8.2 etc, based on your perl version)
1233in the place where perl is installed. If you can't find this program,
1234then you have two options: rebuild and reinstall perl with the setuid
1235emulation turned on (answer &quot;y&quot; to the question &quot;Do you want to do
1236setuid/setgid emulation?&quot; when you run perl's configure script), or
1237switch to the mod_perl alternative for the CGI script (which doesn't
1238need setuid to work).</p>
1239</dd>838</dd>
1240<dt><strong><a name="mod_perl_setup" class="item">Mod_perl Setup</a></strong></dt>839<dt id="Mod_perl-Setup">Mod_perl Setup</dt>
1241
1242<dd>840<dd>
1243<p>The advantage of the mod_perl setup is that no setuid script is needed,841
1244and there is a huge performance advantage. Not only does all the perl842<p>The advantage of the mod_perl setup is that no setuid script is needed, and there is a huge performance advantage. Not only does all the perl code need to be parsed just once, the config.pl and hosts files, plus the connection to the BackupPC server are cached between requests. The typical speedup is around 15 times.</p>
1245code need to be parsed just once, the config.pl and hosts files, plus843
1246the connection to the BackupPC server are cached between requests. The844<p>To use mod_perl you need to run Apache as user __BACKUPPCUSER__. If you need to run multiple Apache&#39;s for different services then you need to create multiple top-level Apache directories, each with their own config file. You can make copies of /etc/init.d/httpd and use the -d option to httpd to point each http to a different top-level directory. Or you can use the -f option to explicitly point to the config file. Multiple Apache&#39;s will run on different Ports (eg: 80 is standard, 8080 is a typical alternative port accessed via http://yourhost.com:8080).</p>
1247typical speedup is around 15 times.</p>845
1248<p>To use mod_perl you need to run Apache as user __BACKUPPCUSER__.846<p>Inside BackupPC&#39;s Apache http.conf file you should check the settings for ServerRoot, DocumentRoot, User, Group, and Port. See <a href="http://httpd.apache.org/docs/server-wide.html">http://httpd.apache.org/docs/server-wide.html</a> for more details.</p>
1249If you need to run multiple Apache's for different services then847
1250you need to create multiple top-level Apache directories, each848<p>For mod_perl, BackupPC_Admin should not have setuid permission, so you should turn it off:</p>
1251with their own config file. You can make copies of /etc/init.d/httpd849
1252and use the -d option to httpd to point each http to a different850<pre><code> chmod u-s __CGIDIR__/BackupPC_Admin</code></pre>
1253top-level directory. Or you can use the -f option to explicitly851
1254point to the config file. Multiple Apache's will run on different852<p>To tell Apache to use mod_perl to execute BackupPC_Admin, add this to Apache&#39;s 1.x httpd.conf file:</p>
1255Ports (eg: 80 is standard, 8080 is a typical alternative port accessed853
1256via <a href="http://yourhost.com:8080).">http://yourhost.com:8080).</a></p>854<pre><code> &lt;IfModule mod_perl.c&gt;
1257<p>Inside BackupPC's Apache http.conf file you should check the
1258settings for ServerRoot, DocumentRoot, User, Group, and Port. See
1259<a href="http://httpd.apache.org/docs/server-wide.html">http://httpd.apache.org/docs/server-wide.html</a> for more details.</p>
1260<p>For mod_perl, BackupPC_Admin should not have setuid permission, so
1261you should turn it off:</p>
1262<pre>
1263 chmod u-s __CGIDIR__/BackupPC_Admin</pre>
1264<p>To tell Apache to use mod_perl to execute BackupPC_Admin, add this
1265to Apache's 1.x httpd.conf file:</p>
1266<pre>
1267 &lt;IfModule mod_perl.c&gt;
1268 PerlModule Apache::Registry855 PerlModule Apache::Registry
1269 PerlTaintCheck On856 PerlTaintCheck On
1270 &lt;Location /cgi-bin/BackupPC/BackupPC_Admin&gt; # &lt;--- change path as needed857 &lt;Location /cgi-bin/BackupPC/BackupPC_Admin&gt; # &lt;--- change path as needed
@@ -1273,13 +860,13 @@
1273 Options ExecCGI860 Options ExecCGI
1274 PerlSendHeader On861 PerlSendHeader On
1275 &lt;/Location&gt;862 &lt;/Location&gt;
1276 &lt;/IfModule&gt;</pre>863 &lt;/IfModule&gt;</code></pre>
1277<p>Apache 2.0.44 with Perl 5.8.0 on RedHat 7.1, Don Silvia reports that864
1278this works (with tweaks from Michael Tuzi):</p>865<p>Apache 2.0.44 with Perl 5.8.0 on RedHat 7.1, Don Silvia reports that this works (with tweaks from Michael Tuzi):</p>
1279<pre>866
1280 LoadModule perl_module modules/mod_perl.so867<pre><code> LoadModule perl_module modules/mod_perl.so
1281 PerlModule Apache2</pre>868 PerlModule Apache2
1282<pre>869
1283 &lt;Directory /path/to/cgi/&gt;870 &lt;Directory /path/to/cgi/&gt;
1284 SetHandler perl-script871 SetHandler perl-script
1285 PerlResponseHandler ModPerl::Registry872 PerlResponseHandler ModPerl::Registry
@@ -1292,34 +879,28 @@
1292 AuthType Basic879 AuthType Basic
1293 AuthUserFile /path/to/user_file880 AuthUserFile /path/to/user_file
1294 Require valid-user881 Require valid-user
1295 &lt;/Directory&gt;</pre>882 &lt;/Directory&gt;</code></pre>
1296<p>There are other optimizations and options with mod_perl. For883
1297example, you can tell mod_perl to preload various perl modules,884<p>There are other optimizations and options with mod_perl. For example, you can tell mod_perl to preload various perl modules, which saves memory compared to loading separate copies in every Apache process after they are forked. See Stas&#39;s definitive mod_perl guide at <a href="http://perl.apache.org/guide">http://perl.apache.org/guide</a>.</p>
1298which saves memory compared to loading separate copies in every885
1299Apache process after they are forked. See Stas's definitive
1300mod_perl guide at <a href="http://perl.apache.org/guide">http://perl.apache.org/guide</a>.</p>
1301</dd>886</dd>
1302</dl>887</dl>
1303<p>BackupPC_Admin requires that users are authenticated by Apache.888
1304Specifically, it expects that Apache sets the REMOTE_USER environment889<p>BackupPC_Admin requires that users are authenticated by Apache. Specifically, it expects that Apache sets the REMOTE_USER environment variable when it runs. There are several ways to do this. One way is to create a .htaccess file in the cgi-bin directory that looks like:</p>
1305variable when it runs. There are several ways to do this. One way890
1306is to create a .htaccess file in the cgi-bin directory that looks like:</p>891<pre><code> AuthGroupFile /etc/httpd/conf/group # &lt;--- change path as needed
1307<pre>
1308 AuthGroupFile /etc/httpd/conf/group # &lt;--- change path as needed
1309 AuthUserFile /etc/http/conf/passwd # &lt;--- change path as needed892 AuthUserFile /etc/http/conf/passwd # &lt;--- change path as needed
1310 AuthType basic893 AuthType basic
1311 AuthName &quot;access&quot;894 AuthName &quot;access&quot;
1312 require valid-user</pre>895 require valid-user</code></pre>
1313<p>You will also need &quot;AllowOverride Indexes AuthConfig&quot; in the Apache896
1314httpd.conf file to enable the .htaccess file. Alternatively, everything897<p>You will also need &quot;AllowOverride Indexes AuthConfig&quot; in the Apache httpd.conf file to enable the .htaccess file. Alternatively, everything can go in the Apache httpd.conf file inside a Location directive. The list of users and password file above can be extracted from the NIS passwd file.</p>
1315can go in the Apache httpd.conf file inside a Location directive. The898
1316list of users and password file above can be extracted from the NIS899<p>One alternative is to use LDAP. In Apache&#39;s http.conf add these lines:</p>
1317passwd file.</p>900
1318<p>One alternative is to use LDAP. In Apache's http.conf add these lines:</p>901<pre><code> LoadModule auth_ldap_module modules/auth_ldap.so
1319<pre>902 AddModule auth_ldap.c
1320 LoadModule auth_ldap_module modules/auth_ldap.so903
1321 AddModule auth_ldap.c</pre>
1322<pre>
1323 # cgi-bin - auth via LDAP (for BackupPC)904 # cgi-bin - auth via LDAP (for BackupPC)
1324 &lt;Location /cgi-binBackupPC/BackupPC_Admin&gt; # &lt;--- change path as needed905 &lt;Location /cgi-binBackupPC/BackupPC_Admin&gt; # &lt;--- change path as needed
1325 AuthType Basic906 AuthType Basic
@@ -1327,297 +908,220 @@
1327 # replace MYDOMAIN, PORT, ORG and CO as needed908 # replace MYDOMAIN, PORT, ORG and CO as needed
1328 AuthLDAPURL ldap://ldap.MYDOMAIN.com:PORT/o=ORG,c=CO?uid?sub?(objectClass=*)909 AuthLDAPURL ldap://ldap.MYDOMAIN.com:PORT/o=ORG,c=CO?uid?sub?(objectClass=*)
1329 require valid-user910 require valid-user
1330 &lt;/Location&gt;</pre>911 &lt;/Location&gt;</code></pre>
1331<p>If you want to disable the user authentication you can set912
1332<a href="#_conf_cgiadminusers_">$Conf{CgiAdminUsers}</a> to '*', which allows any user to have913<p>If you want to disable the user authentication you can set <a href="#_conf_cgiadminusers_">$Conf{CgiAdminUsers}</a> to &#39;*&#39;, which allows any user to have full access to all hosts and backups. In this case the REMOTE_USER environment variable does not have to be set by Apache.</p>
1333full access to all hosts and backups. In this case the REMOTE_USER914
1334environment variable does not have to be set by Apache.</p>915<p>Alternatively, you can force a particular user name by getting Apache to set REMOTE_USER, eg, to hardcode the user to www you could add this to Apache&#39;s httpd.conf:</p>
1335<p>Alternatively, you can force a particular user name by getting Apache916
1336to set REMOTE_USER, eg, to hardcode the user to www you could add917<pre><code> &lt;Location /cgi-bin/BackupPC/BackupPC_Admin&gt; # &lt;--- change path as needed
1337this to Apache's httpd.conf:</p>
1338<pre>
1339 &lt;Location /cgi-bin/BackupPC/BackupPC_Admin&gt; # &lt;--- change path as needed
1340 Setenv REMOTE_USER www918 Setenv REMOTE_USER www
1341 &lt;/Location&gt;</pre>919 &lt;/Location&gt;</code></pre>
1342<p>Finally, you should also edit the config.pl file and adjust, as necessary,920
1343the CGI-specific settings. They're near the end of the config file. In921<p>Finally, you should also edit the config.pl file and adjust, as necessary, the CGI-specific settings. They&#39;re near the end of the config file. In particular, you should specify which users or groups have administrator (privileged) access: see the config settings <a href="#_conf_cgiadminusergroup_">$Conf{CgiAdminUserGroup}</a> and <a href="#_conf_cgiadminusers_">$Conf{CgiAdminUsers}</a>. Also, the configure.pl script placed various images into <a href="#_conf_cgiimagedir_">$Conf{CgiImageDir}</a> that BackupPC_Admin needs to serve up. You should make sure that <a href="#_conf_cgiimagedirurl_">$Conf{CgiImageDirURL}</a> is the correct URL for the image directory.</p>
1344particular, you should specify which users or groups have administrator922
1345(privileged) access: see the config settings <a href="#_conf_cgiadminusergroup_">$Conf{CgiAdminUserGroup}</a>923<p>See the section <a href="#Fixing-installation-problems">&quot;Fixing installation problems&quot;</a> for suggestions on debugging the Apache authentication setup.</p>
1346and <a href="#_conf_cgiadminusers_">$Conf{CgiAdminUsers}</a>. Also, the configure.pl script placed various924
1347images into <a href="#_conf_cgiimagedir_">$Conf{CgiImageDir}</a> that BackupPC_Admin needs to serve925<h2 id="How-BackupPC-Finds-Hosts">How BackupPC Finds Hosts</h2>
1348up. You should make sure that <a href="#_conf_cgiimagedirurl_">$Conf{CgiImageDirURL}</a> is the correct926
1349URL for the image directory.</p>927<p>Starting with v2.0.0 the way hosts are discovered has changed. In most cases you should specify 0 for the DHCP flag in the conf/hosts file, even if the host has a dynamically assigned IP address.</p>
1350<p>See the section <a href="#fixing_installation_problems">Fixing installation problems</a> for suggestions on debugging the Apache authentication setup.</p>928
1351<p>
1352</p>
1353<h2><a name="how_backuppc_finds_hosts">How BackupPC Finds Hosts</a></h2>
1354<p>Starting with v2.0.0 the way hosts are discovered has changed. In most
1355cases you should specify 0 for the DHCP flag in the conf/hosts file,
1356even if the host has a dynamically assigned IP address.</p>
1357<p>BackupPC (starting with v2.0.0) looks up hosts with DHCP = 0 in this manner:</p>929<p>BackupPC (starting with v2.0.0) looks up hosts with DHCP = 0 in this manner:</p>
930
1358<ul>931<ul>
1359<li>932
1360<p>First DNS is used to lookup the IP address given the client's name933<li><p>First DNS is used to lookup the IP address given the client&#39;s name using perl&#39;s gethostbyname() function. This should succeed for machines that have fixed IP addresses that are known via DNS. You can manually see whether a given host have a DNS entry according to perl&#39;s gethostbyname function with this command:</p>
1361using perl's <code>gethostbyname()</code> function. This should succeed for machines934
1362that have fixed IP addresses that are known via DNS. You can manually935<pre><code> perl -e &#39;print(gethostbyname(&quot;myhost&quot;) ? &quot;ok\n&quot; : &quot;not found\n&quot;);&#39;</code></pre>
1363see whether a given host have a DNS entry according to perl's936
1364gethostbyname function with this command:</p>
1365<pre>
1366 perl -e 'print(gethostbyname(&quot;myhost&quot;) ? &quot;ok\n&quot; : &quot;not found\n&quot;);'</pre>
1367</li>937</li>
1368<li>938<li><p>If gethostbyname() fails, BackupPC then attempts a NetBios multicast to find the host. Provided your client machine is configured properly, it should respond to this NetBios multicast request. Specifically, BackupPC runs a command of this form:</p>
1369<p>If <code>gethostbyname()</code> fails, BackupPC then attempts a NetBios multicast to939
1370find the host. Provided your client machine is configured properly,940<pre><code> nmblookup myhost</code></pre>
1371it should respond to this NetBios multicast request. Specifically,941
1372BackupPC runs a command of this form:</p>
1373<pre>
1374 nmblookup myhost</pre>
1375<p>If this fails you will see output like:</p>942<p>If this fails you will see output like:</p>
1376<pre>943
1377 querying myhost on 10.10.255.255944<pre><code> querying myhost on 10.10.255.255
1378 name_query failed to find name myhost</pre>945 name_query failed to find name myhost</code></pre>
946
1379<p>If it is successful you will see output like:</p>947<p>If it is successful you will see output like:</p>
1380<pre>948
1381 querying myhost on 10.10.255.255949<pre><code> querying myhost on 10.10.255.255
1382 10.10.1.73 myhost&lt;00&gt;</pre>950 10.10.1.73 myhost&lt;00&gt;</code></pre>
1383<p>Depending on your netmask you might need to specify the -B option to951
1384nmblookup. For example:</p>952<p>Depending on your netmask you might need to specify the -B option to nmblookup. For example:</p>
1385<pre>953
1386 nmblookup -B 10.10.1.255 myhost</pre>954<pre><code> nmblookup -B 10.10.1.255 myhost</code></pre>
1387<p>If necessary, experiment with the nmblookup command which will return the955
1388IP address of the client given its name. Then update956<p>If necessary, experiment with the nmblookup command which will return the IP address of the client given its name. Then update <a href="#_conf_nmblookupfindhostcmd_">$Conf{NmbLookupFindHostCmd}</a> with any necessary options to nmblookup.</p>
1389<a href="#_conf_nmblookupfindhostcmd_">$Conf{NmbLookupFindHostCmd}</a> with any necessary options to nmblookup.</p>957
1390</li>958</li>
1391</ul>959</ul>
1392<p>For hosts that have the DHCP flag set to 1, these machines are960
1393discovered as follows:</p>961<p>For hosts that have the DHCP flag set to 1, these machines are discovered as follows:</p>
962
1394<ul>963<ul>
1395<li>964
1396<p>A DHCP address pool (<a href="#_conf_dhcpaddressranges_">$Conf{DHCPAddressRanges}</a>) needs to be specified.965<li><p>A DHCP address pool (<a href="#_conf_dhcpaddressranges_">$Conf{DHCPAddressRanges}</a>) needs to be specified. BackupPC will check the NetBIOS name of each machine in the range using a command of the form:</p>
1397BackupPC will check the NetBIOS name of each machine in the range using966
1398a command of the form:</p>967<pre><code> nmblookup -A W.X.Y.Z</code></pre>
1399<pre>968
1400 nmblookup -A W.X.Y.Z</pre>969<p>where W.X.Y.Z is each candidate address from <a href="#_conf_dhcpaddressranges_">$Conf{DHCPAddressRanges}</a>. Any host that has a valid NetBIOS name returned by this command (ie: matching an entry in the hosts file) will be backed up. You can modify the specific nmblookup command if necessary via <a href="#_conf_nmblookupcmd_">$Conf{NmbLookupCmd}</a>.</p>
1401<p>where W.X.Y.Z is each candidate address from <a href="#_conf_dhcpaddressranges_">$Conf{DHCPAddressRanges}</a>.970
1402Any host that has a valid NetBIOS name returned by this command (ie:
1403matching an entry in the hosts file) will be backed up. You can
1404modify the specific nmblookup command if necessary via <a href="#_conf_nmblookupcmd_">$Conf{NmbLookupCmd}</a>.</p>
1405</li>971</li>
1406<li>972<li><p>You only need to use this DHCP feature if your client machine doesn&#39;t respond to the NetBios multicast request:</p>
1407<p>You only need to use this DHCP feature if your client machine doesn't973
1408respond to the NetBios multicast request:</p>974<pre><code> nmblookup myHost</code></pre>
1409<pre>975
1410 nmblookup myHost</pre>
1411<p>but does respond to a request directed to its IP address:</p>976<p>but does respond to a request directed to its IP address:</p>
1412<pre>977
1413 nmblookup -A W.X.Y.Z</pre>978<pre><code> nmblookup -A W.X.Y.Z</code></pre>
979
1414</li>980</li>
1415</ul>981</ul>
1416<p>982
1417</p>983<h2 id="Other-installation-topics">Other installation topics</h2>
1418<h2><a name="other_installation_topics">Other installation topics</a></h2>984
1419<dl>985<dl>
1420<dt><strong><a name="removing_a_client" class="item">Removing a client</a></strong></dt>
1421986
987<dt id="Removing-a-client">Removing a client</dt>
1422<dd>988<dd>
1423<p>If there is a machine that no longer needs to be backed up (eg: a retired989
1424machine) you have two choices. First, you can keep the backups accessible990<p>If there is a machine that no longer needs to be backed up (eg: a retired machine) you have two choices. First, you can keep the backups accessible and browsable, but disable all new backups. Alternatively, you can completely remove the client and all its backups.</p>
1425and browsable, but disable all new backups. Alternatively, you can991
1426completely remove the client and all its backups.</p>992<p>To disable backups for a client <a href="#_conf_backupsdisable_">$Conf{BackupsDisable}</a> can be set to two different values in that client&#39;s per-PC config.pl file:</p>
1427<p>To disable backups for a client <a href="#_conf_backupsdisable_">$Conf{BackupsDisable}</a> can be993
1428set to two different values in that client's per-PC config.pl file:</p>
1429<ol>994<ol>
1430<li>995
1431<p>Don't do any regular backups on this machine. Manually996<li><p>Don&#39;t do any regular backups on this machine. Manually requested backups (via the CGI interface) will still occur.</p>
1432requested backups (via the CGI interface) will still occur.</p>997
1433</li>998</li>
1434<li>999<li><p>Don&#39;t do any backups on this machine. Manually requested backups (via the CGI interface) will be ignored.</p>
1435<p>Don't do any backups on this machine. Manually requested1000
1436backups (via the CGI interface) will be ignored.</p>
1437</li>1001</li>
1438</ol>1002</ol>
1439<p>This will still allow the client's old backups to be browsable1003
1440and restorable.</p>1004<p>This will still allow the client&#39;s old backups to be browsable and restorable.</p>
1441<p>To completely remove a client and all its backups, you should remove its1005
1442entry in the conf/hosts file, and then delete the __TOPDIR__/pc/$host1006<p>To completely remove a client and all its backups, you should remove its entry in the conf/hosts file, and then delete the __TOPDIR__/pc/$host directory. Whenever you change the hosts file, you should send BackupPC a HUP (-1) signal so that it re-reads the hosts file. If you don&#39;t do this, BackupPC will automatically re-read the hosts file at the next regular wakeup.</p>
1443directory. Whenever you change the hosts file, you should send1007
1444BackupPC a HUP (-1) signal so that it re-reads the hosts file.1008<p>Note that when you remove a client&#39;s backups you won&#39;t initially recover much disk space. That&#39;s because the client&#39;s files are still in the pool. Overnight, when BackupPC_nightly next runs, all the unused pool files will be deleted and this will recover the disk space used by the client&#39;s backups.</p>
1445If you don't do this, BackupPC will automatically re-read the1009
1446hosts file at the next regular wakeup.</p>
1447<p>Note that when you remove a client's backups you won't initially
1448recover much disk space. That's because the client's files are
1449still in the pool. Overnight, when BackupPC_nightly next runs,
1450all the unused pool files will be deleted and this will recover
1451the disk space used by the client's backups.</p>
1452</dd>1010</dd>
1453<dt><strong><a name="copying_the_pool" class="item">Copying the pool</a></strong></dt>1011<dt id="Copying-the-pool">Copying the pool</dt>
1454
1455<dd>1012<dd>
1456<p>If the pool disk requirements grow you might need to copy the entire1013
1457data directory to a new (bigger) file system. Hopefully you are lucky1014<p>If the pool disk requirements grow you might need to copy the entire data directory to a new (bigger) file system. Hopefully you are lucky enough to avoid this by having the data directory on a RAID file system or LVM that allows the capacity to be grown in place by adding disks.</p>
1458enough to avoid this by having the data directory on a RAID file system1015
1459or LVM that allows the capacity to be grown in place by adding disks.</p>1016<p>The backup data directories contain large numbers of hardlinks. If you try to copy the pool the target directory will occupy a lot more space if the hardlinks aren&#39;t re-established.</p>
1460<p>The backup data directories contain large numbers of hardlinks. If1017
1461you try to copy the pool the target directory will occupy a lot more1018<p>The best way to copy a pool file system, if possible, is by copying the raw device at the block level (eg: using dd). Application level programs that understand hardlinks include the GNU cp program with the -a option and rsync -H. However, the large number of hardlinks in the pool will make the memory usage large and the copy very slow. Don&#39;t forget to stop BackupPC while the copy runs.</p>
1462space if the hardlinks aren't re-established.</p>1019
1463<p>The best way to copy a pool file system, if possible, is by copying1020<p>Starting in 3.0.0 a new script bin/BackupPC_tarPCCopy can be used to assist the copy process. Given one or more pc paths (eg: TOPDIR/pc/HOST or TOPDIR/pc/HOST/nnn), BackupPC_tarPCCopy creates a tar archive with all the hardlinks pointing to ../cpool/.... Any files not hardlinked (eg: backups, LOG etc) are included verbatim.</p>
1464the raw device at the block level (eg: using dd). Application level1021
1465programs that understand hardlinks include the GNU cp program with1022<p>You will need to specify the -P option to tar when you extract the archive generated by BackupPC_tarPCCopy since the hardlink targets are outside of the directory being extracted.</p>
1466the -a option and rsync -H. However, the large number of hardlinks1023
1467in the pool will make the memory usage large and the copy very slow.1024<p>To copy a complete store (ie: __TOPDIR__) using BackupPC_tarPCCopy you should:</p>
1468Don't forget to stop BackupPC while the copy runs.</p>1025
1469<p>Starting in 3.0.0 a new script bin/BackupPC_tarPCCopy can be
1470used to assist the copy process. Given one or more pc paths
1471(eg: TOPDIR/pc/HOST or TOPDIR/pc/HOST/nnn), BackupPC_tarPCCopy
1472creates a tar archive with all the hardlinks pointing to ../cpool/....
1473Any files not hardlinked (eg: backups, LOG etc) are included
1474verbatim.</p>
1475<p>You will need to specify the -P option to tar when you extract
1476the archive generated by BackupPC_tarPCCopy since the hardlink
1477targets are outside of the directory being extracted.</p>
1478<p>To copy a complete store (ie: __TOPDIR__) using BackupPC_tarPCCopy
1479you should:</p>
1480<ul>1026<ul>
1481<li>1027
1482<p>stop BackupPC so that the store is static.</p>1028<li><p>stop BackupPC so that the store is static.</p>
1483</li>1029
1484<li>1030</li>
1485<p>copy the cpool, conf and log directory trees using any technique1031<li><p>copy the cpool, conf and log directory trees using any technique (like cp, rsync or tar) without the need to preserve hardlinks.</p>
1486(like cp, rsync or tar) without the need to preserve hardlinks.</p>1032
1487</li>1033</li>
1488<li>1034<li><p>copy the pc directory using BackupPC_tarPCCopy:</p>
1489<p>copy the pc directory using BackupPC_tarPCCopy:</p>1035
1490<pre>1036<pre><code> su __BACKUPPCUSER__
1491 su __BACKUPPCUSER__
1492 cd NEW_TOPDIR1037 cd NEW_TOPDIR
1493 mkdir pc1038 mkdir pc
1494 cd pc1039 cd pc
1495 __INSTALLDIR__/bin/BackupPC_tarPCCopy __TOPDIR__/pc | tar xvPf -</pre>1040 __INSTALLDIR__/bin/BackupPC_tarPCCopy __TOPDIR__/pc | tar xvPf -</code></pre>
1041
1496</li>1042</li>
1497</ul>1043</ul>
1044
1498</dd>1045</dd>
1499</dl>1046</dl>
1500<p>1047
1501</p>1048<h2 id="Fixing-installation-problems">Fixing installation problems</h2>
1502<h2><a name="fixing_installation_problems">Fixing installation problems</a></h2>1049
1503<p>Please see the Wiki at <a href="http://backuppc.wiki.sourceforge.net">http://backuppc.wiki.sourceforge.net</a> for1050<p>Please see the Wiki at <a href="http://backuppc.wiki.sourceforge.net">http://backuppc.wiki.sourceforge.net</a> for debugging suggestions. If you find a solution to your problem that could help other users please add it to the Wiki!</p>
1504debugging suggestions. If you find a solution to your problem that1051
1505could help other users please add it to the Wiki!</p>
1506<p>
1507<a href="#__index__"><small>Back to Top</small></a>
1508</p>
1509<hr />1052<hr />
1510<h1><a name="restore_functions">Restore functions</a></h1>1053<h1 id="Restore-functions">Restore functions</h1>
1511<p>BackupPC supports several different methods for restoring files. The1054
1512most convenient restore options are provided via the CGI interface.1055<p>BackupPC supports several different methods for restoring files. The most convenient restore options are provided via the CGI interface. Alternatively, backup files can be restored using manual commands.</p>
1513Alternatively, backup files can be restored using manual commands.</p>1056
1514<p>1057<h2 id="CGI-restore-options">CGI restore options</h2>
1515</p>1058
1516<h2><a name="cgi_restore_options">CGI restore options</a></h2>1059<p>By selecting a host in the CGI interface, a list of all the backups for that machine will be displayed. By selecting the backup number you can navigate the shares and directory tree for that backup.</p>
1517<p>By selecting a host in the CGI interface, a list of all the backups1060
1518for that machine will be displayed. By selecting the backup number1061<p>BackupPC&#39;s CGI interface automatically fills incremental backups with the corresponding full backup, which means each backup has a filled appearance. Therefore, there is no need to do multiple restores from the incremental and full backups: BackupPC does all the hard work for you. You simply select the files and directories you want from the correct backup vintage in one step.</p>
1519you can navigate the shares and directory tree for that backup.</p>1062
1520<p>BackupPC's CGI interface automatically fills incremental backups1063<p>You can download a single backup file at any time simply by selecting it. Your browser should prompt you with the file name and ask you whether to open the file or save it to disk.</p>
1521with the corresponding full backup, which means each backup has1064
1522a filled appearance. Therefore, there is no need to do multiple1065<p>Alternatively, you can select one or more files or directories in the currently selected directory and select &quot;Restore selected files&quot;. (If you need to restore selected files and directories from several different parent directories you will need to do that in multiple steps.)</p>
1523restores from the incremental and full backups: BackupPC does all1066
1524the hard work for you. You simply select the files and directories1067<p>If you select all the files in a directory, BackupPC will replace the list of files with the parent directory. You will be presented with a screen that has three options:</p>
1525you want from the correct backup vintage in one step.</p>1068
1526<p>You can download a single backup file at any time simply by selecting
1527it. Your browser should prompt you with the file name and ask you
1528whether to open the file or save it to disk.</p>
1529<p>Alternatively, you can select one or more files or directories in
1530the currently selected directory and select &quot;Restore selected files&quot;.
1531(If you need to restore selected files and directories from several
1532different parent directories you will need to do that in multiple
1533steps.)</p>
1534<p>If you select all the files in a directory, BackupPC will replace
1535the list of files with the parent directory. You will be presented
1536with a screen that has three options:</p>
1537<dl>1069<dl>
1538<dt><strong><a name="option_1_direct_restore" class="item">Option 1: Direct Restore</a></strong></dt>1070
15391071<dt id="Option-1:-Direct-Restore">Option 1: Direct Restore</dt>
1540<dd>1072<dd>
1541<p>With this option the selected files and directories are restored1073
1542directly back onto the host, by default in their original location.1074<p>With this option the selected files and directories are restored directly back onto the host, by default in their original location. Any old files with the same name will be overwritten, so use caution. You can optionally change the target host name, target share name, and target path prefix for the restore, allowing you to restore the files to a different location.</p>
1543Any old files with the same name will be overwritten, so use caution.1075
1544You can optionally change the target host name, target share name,1076<p>Once you select &quot;Start Restore&quot; you will be prompted one last time with a summary of the exact source and target files and directories before you commit. When you give the final go ahead the restore operation will be queued like a normal backup job, meaning that it will be deferred if there is a backup currently running for that host. When the restore job is run, smbclient, tar, rsync or rsyncd is used (depending upon <a href="#_conf_xfermethod_">$Conf{XferMethod}</a>) to actually restore the files. Sorry, there is currently no option to cancel a restore that has been started. Currently ftp restores are not fully implemented.</p>
1545and target path prefix for the restore, allowing you to restore the1077
1546files to a different location.</p>1078<p>A record of the restore request, including the result and list of files and directories, is kept. It can be browsed from the host&#39;s home page. <a href="#_conf_restoreinfokeepcnt_">$Conf{RestoreInfoKeepCnt}</a> specifies how many old restore status files to keep.</p>
1547<p>Once you select &quot;Start Restore&quot; you will be prompted one last time1079
1548with a summary of the exact source and target files and directories1080<p>Note that for direct restore to work, the <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> must be able to write to the client. For example, that means an SMB share for smbclient needs to be writable, and the rsyncd module needs &quot;read only&quot; set to &quot;false&quot;. This creates additional security risks. If you only create read-only SMB shares (which is a good idea), then the direct restore will fail. You can disable the direct restore option by setting <a href="#_conf_smbclientrestorecmd_">$Conf{SmbClientRestoreCmd}</a>, <a href="#_conf_tarclientrestorecmd_">$Conf{TarClientRestoreCmd}</a> and <a href="#_conf_rsyncrestoreargs_">$Conf{RsyncRestoreArgs}</a> to undef.</p>
1549before you commit. When you give the final go ahead the restore1081
1550operation will be queued like a normal backup job, meaning that it1082</dd>
1551will be deferred if there is a backup currently running for that host.1083<dt id="Option-2:-Download-Zip-archive">Option 2: Download Zip archive</dt>
1552When the restore job is run, smbclient, tar, rsync or rsyncd is used1084<dd>
1553(depending upon <a href="#_conf_xfermethod_">$Conf{XferMethod}</a>) to actually restore the files.1085
1554Sorry, there is currently no option to cancel a restore that has been1086<p>With this option a zip file containing the selected files and directories is downloaded. The zip file can then be unpacked or individual files extracted as necessary on the host machine. The compression level can be specified. A value of 0 turns off compression.</p>
1555started. Currently ftp restores are not fully implemented.</p>1087
1556<p>A record of the restore request, including the result and list of1088<p>When you select &quot;Download Zip File&quot; you should be prompted where to save the restore.zip file.</p>
1557files and directories, is kept. It can be browsed from the host's1089
1558home page. <a href="#_conf_restoreinfokeepcnt_">$Conf{RestoreInfoKeepCnt}</a> specifies how many old restore1090<p>BackupPC does not consider downloading a zip file as an actual restore operation, so the details are not saved for later browsing as in the first case. However, a mention that a zip file was downloaded by a particular user, and a list of the files, does appear in BackupPC&#39;s log file.</p>
1559status files to keep.</p>1091
1560<p>Note that for direct restore to work, the <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> must1092</dd>
1561be able to write to the client. For example, that means an SMB1093<dt id="Option-3:-Download-Tar-archive">Option 3: Download Tar archive</dt>
1562share for smbclient needs to be writable, and the rsyncd module1094<dd>
1563needs &quot;read only&quot; set to &quot;false&quot;. This creates additional security1095
1564risks. If you only create read-only SMB shares (which is a good1096<p>This is identical to the previous option, except a tar file is downloaded rather than a zip file (and there is currently no compression option).</p>
1565idea), then the direct restore will fail. You can disable the1097
1566direct restore option by setting <a href="#_conf_smbclientrestorecmd_">$Conf{SmbClientRestoreCmd}</a>,
1567<a href="#_conf_tarclientrestorecmd_">$Conf{TarClientRestoreCmd}</a> and <a href="#_conf_rsyncrestoreargs_">$Conf{RsyncRestoreArgs}</a> to undef.</p>
1568</dd>
1569<dt><strong><a name="option_2_download_zip_archive" class="item">Option 2: Download Zip archive</a></strong></dt>
1570
1571<dd>
1572<p>With this option a zip file containing the selected files and directories
1573is downloaded. The zip file can then be unpacked or individual files
1574extracted as necessary on the host machine. The compression level can be
1575specified. A value of 0 turns off compression.</p>
1576<p>When you select &quot;Download Zip File&quot; you should be prompted where to
1577save the restore.zip file.</p>
1578<p>BackupPC does not consider downloading a zip file as an actual
1579restore operation, so the details are not saved for later browsing
1580as in the first case. However, a mention that a zip file was
1581downloaded by a particular user, and a list of the files, does
1582appear in BackupPC's log file.</p>
1583</dd>
1584<dt><strong><a name="option_3_download_tar_archive" class="item">Option 3: Download Tar archive</a></strong></dt>
1585
1586<dd>
1587<p>This is identical to the previous option, except a tar file is downloaded
1588rather than a zip file (and there is currently no compression option).</p>
1589</dd>1098</dd>
1590</dl>1099</dl>
1591<p>1100
1592</p>1101<h2 id="Command-line-restore-options">Command-line restore options</h2>
1593<h2><a name="command_line_restore_options">Command-line restore options</a></h2>1102
1594<p>Apart from the CGI interface, BackupPC allows you to restore files1103<p>Apart from the CGI interface, BackupPC allows you to restore files and directories from the command line. The following programs can be used:</p>
1595and directories from the command line. The following programs can1104
1596be used:</p>
1597<dl>1105<dl>
1598<dt><strong><a name="backuppc_zcat" class="item">BackupPC_zcat</a></strong></dt>
15991106
1107<dt id="BackupPC_zcat">BackupPC_zcat</dt>
1600<dd>1108<dd>
1601<p>For each file name argument it inflates (uncompresses) the file and1109
1602writes it to stdout. To use BackupPC_zcat you could give it the1110<p>For each file name argument it inflates (uncompresses) the file and writes it to stdout. To use BackupPC_zcat you could give it the full file name, eg:</p>
1603full file name, eg:</p>1111
1604<pre>1112<pre><code> __INSTALLDIR__/bin/BackupPC_zcat __TOPDIR__/pc/host/5/fc/fcraig/fexample.txt &gt; example.txt</code></pre>
1605 __INSTALLDIR__/bin/BackupPC_zcat __TOPDIR__/pc/host/5/fc/fcraig/fexample.txt &gt; example.txt</pre>1113
1606<p>It's your responsibility to make sure the file is really compressed:1114<p>It&#39;s your responsibility to make sure the file is really compressed: BackupPC_zcat doesn&#39;t check which backup the requested file is from. BackupPC_zcat returns a non-zero status if it fails to uncompress a file.</p>
1607BackupPC_zcat doesn't check which backup the requested file is from.1115
1608BackupPC_zcat returns a non-zero status if it fails to uncompress
1609a file.</p>
1610</dd>1116</dd>
1611<dt><strong><a name="backuppc_tarcreate" class="item">BackupPC_tarCreate</a></strong></dt>1117<dt id="BackupPC_tarCreate">BackupPC_tarCreate</dt>
1612
1613<dd>1118<dd>
1614<p>BackupPC_tarCreate creates a tar file for any files or directories in1119
1615a particular backup. Merging of incrementals is done automatically,1120<p>BackupPC_tarCreate creates a tar file for any files or directories in a particular backup. Merging of incrementals is done automatically, so you don&#39;t need to worry about whether certain files appear in the incremental or full backup.</p>
1616so you don't need to worry about whether certain files appear in the1121
1617incremental or full backup.</p>
1618<p>The usage is:</p>1122<p>The usage is:</p>
1619<pre>1123
1620 BackupPC_tarCreate [options] files/directories...1124<pre><code> BackupPC_tarCreate [options] files/directories...
1621 Required options:1125 Required options:
1622 -h host host from which the tar archive is created1126 -h host host from which the tar archive is created
1623 -n dumpNum dump number from which the tar archive is created1127 -n dumpNum dump number from which the tar archive is created
@@ -1633,25 +1137,22 @@
1633 -w writeBufSz write buffer size (default 1048576 = 1MB)1137 -w writeBufSz write buffer size (default 1048576 = 1MB)
1634 -e charset charset for encoding file names (default: value of1138 -e charset charset for encoding file names (default: value of
1635 <a href="#_conf_clientcharset_">$Conf{ClientCharset}</a> when backup was done)1139 <a href="#_conf_clientcharset_">$Conf{ClientCharset}</a> when backup was done)
1636 -l just print a file listing; don't generate an archive1140 -l just print a file listing; don&#39;t generate an archive
1637 -L just print a detailed file listing; don't generate an archive</pre>1141 -L just print a detailed file listing; don&#39;t generate an archive</code></pre>
1638<p>The command-line files and directories are relative to the specified1142
1639shareName. The tar file is written to stdout.</p>1143<p>The command-line files and directories are relative to the specified shareName. The tar file is written to stdout.</p>
1640<p>The -h, -n and -s options specify which dump is used to generate1144
1641the tar archive. The -r and -p options can be used to relocate1145<p>The -h, -n and -s options specify which dump is used to generate the tar archive. The -r and -p options can be used to relocate the paths in the tar archive so extracted files can be placed in a location different from their original location.</p>
1642the paths in the tar archive so extracted files can be placed1146
1643in a location different from their original location.</p>
1644</dd>1147</dd>
1645<dt><strong><a name="backuppc_zipcreate" class="item">BackupPC_zipCreate</a></strong></dt>1148<dt id="BackupPC_zipCreate">BackupPC_zipCreate</dt>
1646
1647<dd>1149<dd>
1648<p>BackupPC_zipCreate creates a zip file for any files or directories in1150
1649a particular backup. Merging of incrementals is done automatically,1151<p>BackupPC_zipCreate creates a zip file for any files or directories in a particular backup. Merging of incrementals is done automatically, so you don&#39;t need to worry about whether certain files appear in the incremental or full backup.</p>
1650so you don't need to worry about whether certain files appear in the1152
1651incremental or full backup.</p>
1652<p>The usage is:</p>1153<p>The usage is:</p>
1653<pre>1154
1654 BackupPC_zipCreate [options] files/directories...1155<pre><code> BackupPC_zipCreate [options] files/directories...
1655 Required options:1156 Required options:
1656 -h host host from which the zip archive is created1157 -h host host from which the zip archive is created
1657 -n dumpNum dump number from which the tar archive is created1158 -n dumpNum dump number from which the tar archive is created
@@ -1664,1239 +1165,967 @@
1664 -r pathRemove path prefix that will be replaced with pathAdd1165 -r pathRemove path prefix that will be replaced with pathAdd
1665 -p pathAdd new path prefix1166 -p pathAdd new path prefix
1666 -c level compression level (default is 0, no compression)1167 -c level compression level (default is 0, no compression)
1667 -e charset charset for encoding file names (default: cp1252)</pre>1168 -e charset charset for encoding file names (default: utf8)</code></pre>
1668<p>The command-line files and directories are relative to the specified1169
1669shareName. The zip file is written to stdout. The -h, -n and -s1170<p>The command-line files and directories are relative to the specified shareName. The zip file is written to stdout. The -h, -n and -s options specify which dump is used to generate the zip archive. The -r and -p options can be used to relocate the paths in the zip archive so extracted files can be placed in a location different from their original location.</p>
1670options specify which dump is used to generate the zip archive. The1171
1671-r and -p options can be used to relocate the paths in the zip archive
1672so extracted files can be placed in a location different from their
1673original location.</p>
1674</dd>1172</dd>
1675</dl>1173</dl>
1174
1676<p>Each of these programs reside in __INSTALLDIR__/bin.</p>1175<p>Each of these programs reside in __INSTALLDIR__/bin.</p>
1677<p>1176
1678<a href="#__index__"><small>Back to Top</small></a>
1679</p>
1680<hr />1177<hr />
1681<h1><a name="archive_functions">Archive functions</a></h1>1178<h1 id="Archive-functions">Archive functions</h1>
1682<p>BackupPC supports archiving to removable media. For users that require1179
1683offsite backups, BackupPC can create archives that stream to tape1180<p>BackupPC supports archiving to removable media. For users that require offsite backups, BackupPC can create archives that stream to tape devices, or create files of specified sizes to fit onto cd or dvd media.</p>
1684devices, or create files of specified sizes to fit onto cd or dvd media.</p>1181
1685<p>Each archive type is specified by a BackupPC host with its XferMethod1182<p>Each archive type is specified by a BackupPC host with its XferMethod set to &#39;archive&#39;. This allows for multiple configurations at sites where there might be a combination of tape and cd/dvd backups being made.</p>
1686set to 'archive'. This allows for multiple configurations at sites where1183
1687there might be a combination of tape and cd/dvd backups being made.</p>1184<p>BackupPC provides a menu that allows one or more hosts to be archived. The most recent backup of each host is archived using BackupPC_tarCreate, and the output is optionally compressed and split into fixed-sized files (eg: 650MB).</p>
1688<p>BackupPC provides a menu that allows one or more hosts to be archived.1185
1689The most recent backup of each host is archived using BackupPC_tarCreate,1186<p>The archive for each host is done by default using __INSTALLDIR__/bin/BackupPC_archiveHost. This script can be copied and customized as needed.</p>
1690and the output is optionally compressed and split into fixed-sized1187
1691files (eg: 650MB).</p>1188<h2 id="Configuring-an-Archive-Host">Configuring an Archive Host</h2>
1692<p>The archive for each host is done by default using1189
1693__INSTALLDIR__/bin/BackupPC_archiveHost. This script can be copied1190<p>To create an Archive Host, add it to the hosts file just as any other host and call it a name that best describes the type of archive, e.g. ArchiveDLT</p>
1694and customized as needed.</p>1191
1695<p>1192<p>To tell BackupPC that the Host is for Archives, create a config.pl file in the Archive Hosts&#39;s pc directory, adding the following line:</p>
1696</p>1193
1697<h2><a name="configuring_an_archive_host">Configuring an Archive Host</a></h2>1194<p><a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = &#39;archive&#39;;</p>
1698<p>To create an Archive Host, add it to the hosts file just as any other host1195
1699and call it a name that best describes the type of archive, e.g. ArchiveDLT</p>1196<p>To further customise the archive&#39;s parameters you can adding the changed parameters in the host&#39;s config.pl file. The parameters are explained in the config.pl file. Parameters may be fixed or the user can be allowed to change them (eg: output device).</p>
1700<p>To tell BackupPC that the Host is for Archives, create a config.pl file in 1197
1701the Archive Hosts's pc directory, adding the following line:</p>1198<p>The per-host archive command is <a href="#_conf_archiveclientcmd_">$Conf{ArchiveClientCmd}</a>. By default this invokes</p>
1702<p><a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'archive';</p>1199
1703<p>To further customise the archive's parameters you can adding the changed1200<pre><code> __INSTALLDIR__/bin/BackupPC_archiveHost</code></pre>
1704parameters in the host's config.pl file. The parameters are explained in1201
1705the config.pl file. Parameters may be fixed or the user can be allowed
1706to change them (eg: output device).</p>
1707<p>The per-host archive command is <a href="#_conf_archiveclientcmd_">$Conf{ArchiveClientCmd}</a>. By default
1708this invokes</p>
1709<pre>
1710 __INSTALLDIR__/bin/BackupPC_archiveHost</pre>
1711<p>which you can copy and customize as necessary.</p>1202<p>which you can copy and customize as necessary.</p>
1712<p>1203
1713</p>1204<h2 id="Starting-an-Archive">Starting an Archive</h2>
1714<h2><a name="starting_an_archive">Starting an Archive</a></h2>1205
1715<p>In the web interface, click on the Archive Host you wish to use. You will see a1206<p>In the web interface, click on the Archive Host you wish to use. You will see a list of previous archives and a summary on each. By clicking the &quot;Start Archive&quot; button you are presented with the list of hosts and the approximate backup size (note this is raw size, not projected compressed size) Select the hosts you wish to archive and press the &quot;Archive Selected Hosts&quot; button.</p>
1716list of previous archives and a summary on each. By clicking the &quot;Start Archive&quot;1207
1717button you are presented with the list of hosts and the approximate backup size1208<p>The next screen allows you to adjust the parameters for this archive run. Press the &quot;Start the Archive&quot; to start archiving the selected hosts with the parameters displayed.</p>
1718(note this is raw size, not projected compressed size) Select the hosts you wish1209
1719to archive and press the &quot;Archive Selected Hosts&quot; button.</p>1210<h2 id="Starting-an-Archive-from-the-command-line">Starting an Archive from the command line</h2>
1720<p>The next screen allows you to adjust the parameters for this archive run.1211
1721Press the &quot;Start the Archive&quot; to start archiving the selected hosts with the1212<p>The script BackupPC_archiveStart can be used to start an archive from the command line (or cron etc). The usage is:</p>
1722parameters displayed.</p>1213
1723<p>1214<pre><code> BackupPC_archiveStart archiveHost userName hosts...</code></pre>
1724</p>1215
1725<h2><a name="starting_an_archive_from_the_command_line">Starting an Archive from the command line</a></h2>1216<p>This creates an archive of the most recent backup of each of the specified hosts. The first two arguments are the archive host and the user name making the request.</p>
1726<p>The script BackupPC_archiveStart can be used to start an archive from1217
1727the command line (or cron etc). The usage is:</p>1218<hr />
1728<pre>1219<h1 id="Other-CGI-Functions">Other CGI Functions</h1>
1729 BackupPC_archiveStart archiveHost userName hosts...</pre>1220
1730<p>This creates an archive of the most recent backup of each of1221<h2 id="Configuration-and-Host-Editor">Configuration and Host Editor</h2>
1731the specified hosts. The first two arguments are the archive1222
1732host and the user name making the request.</p>1223<p>The CGI interface has a complete configuration and host editor. Only the administrator can edit the main configuration settings and hosts. The edit links are in the left navigation bar.</p>
1733<p>1224
1734<a href="#__index__"><small>Back to Top</small></a>1225<p>When changes are made to any parameter a &quot;Save&quot; button appears at the top of the page. If you are editing a text box you will need to click outside of the text box to make the Save button appear. If you don&#39;t select Save then the changes won&#39;t be saved.</p>
1735</p>1226
1736<hr />1227<p>The host-specific configuration can be edited from the host summary page using the link in the left navigation bar. The administrator can edit any of the host-specific configuration settings.</p>
1737<h1><a name="other_cgi_functions">Other CGI Functions</a></h1>1228
1738<p>1229<p>When editing the host-specific configuration, each parameter has an &quot;override&quot; setting that denotes the value is host-specific, meaning that it overrides the setting in the main configuration. If you unselect &quot;override&quot; then the setting is removed from the host-specific configuration, and the main configuration file is displayed.</p>
1739</p>1230
1740<h2><a name="configuration_and_host_editor">Configuration and Host Editor</a></h2>1231<p>User&#39;s can edit their host-specific configuration if enabled via <a href="#_conf_cgiuserconfigeditenable_">$Conf{CgiUserConfigEditEnable}</a>. The specific subset of configuration settings that a user can edit is specified with <a href="#_conf_cgiuserconfigedit_">$Conf{CgiUserConfigEdit}</a>. It is recommended to make this list short as possible (you probably don&#39;t want your users saving dozens of backups) and it is essential that they can&#39;t edit any of the Cmd configuration settings, otherwise they can specify an arbitrary command that will be executed as the BackupPC user.</p>
1741<p>The CGI interface has a complete configuration and host editor.1232
1742Only the administrator can edit the main configuration settings1233<h2 id="RSS">RSS</h2>
1743and hosts. The edit links are in the left navigation bar.</p>1234
1744<p>When changes are made to any parameter a &quot;Save&quot; button appears1235<p>BackupPC supports a very basic RSS feed. Provided you have the XML::RSS perl module installed, a URL similar to this will provide RSS information:</p>
1745at the top of the page. If you are editing a text box you will1236
1746need to click outside of the text box to make the Save button1237<pre><code> http://localhost/cgi-bin/BackupPC/BackupPC_Admin?action=rss</code></pre>
1747appear. If you don't select Save then the changes won't be saved.</p>1238
1748<p>The host-specific configuration can be edited from the host1239<p>This feature is experimental. The information included will probably change.</p>
1749summary page using the link in the left navigation bar.1240
1750The administrator can edit any of the host-specific1241<hr />
1751configuration settings.</p>1242<h1 id="BackupPC-Design">BackupPC Design</h1>
1752<p>When editing the host-specific configuration, each parameter has1243
1753an &quot;override&quot; setting that denotes the value is host-specific,1244<h2 id="Some-design-issues">Some design issues</h2>
1754meaning that it overrides the setting in the main configuration.1245
1755If you unselect &quot;override&quot; then the setting is removed from
1756the host-specific configuration, and the main configuration
1757file is displayed.</p>
1758<p>User's can edit their host-specific configuration if enabled
1759via <a href="#_conf_cgiuserconfigeditenable_">$Conf{CgiUserConfigEditEnable}</a>. The specific subset
1760of configuration settings that a user can edit is specified
1761with <a href="#_conf_cgiuserconfigedit_">$Conf{CgiUserConfigEdit}</a>. It is recommended to make this
1762list short as possible (you probably don't want your users saving
1763dozens of backups) and it is essential that they can't edit any
1764of the Cmd configuration settings, otherwise they can specify
1765an arbitrary command that will be executed as the BackupPC
1766user.</p>
1767<p>
1768</p>
1769<h2><a name="rss">RSS</a></h2>
1770<p>BackupPC supports a very basic RSS feed. Provided you have the
1771XML::RSS perl module installed, a URL similar to this will
1772provide RSS information:</p>
1773<pre>
1774 <a href="http://localhost/cgi-bin/BackupPC/BackupPC_Admin?action=rss">http://localhost/cgi-bin/BackupPC/BackupPC_Admin?action=rss</a></pre>
1775<p>This feature is experimental. The information included will
1776probably change.</p>
1777<p>
1778<a href="#__index__"><small>Back to Top</small></a>
1779</p>
1780<hr />
1781<h1><a name="backuppc_design">BackupPC Design</a></h1>
1782<p>
1783</p>
1784<h2><a name="some_design_issues">Some design issues</a></h2>
1785<dl>1246<dl>
1786<dt><strong><a name="pooling_common_files" class="item">Pooling common files</a></strong></dt>1247
17871248<dt id="Pooling-common-files">Pooling common files</dt>
1788<dd>1249<dd>
1789<p>To quickly see if a file is already in the pool, an MD5 digest of the1250
1790file length and contents is used as the file name in the pool. This1251<p>To quickly see if a file is already in the pool, an MD5 digest of the file length and contents is used as the file name in the pool. This can&#39;t guarantee a file is identical: it just reduces the search to often a single file or handful of files. A complete file comparison is always done to verify if two files are really the same.</p>
1791can't guarantee a file is identical: it just reduces the search to1252
1792often a single file or handful of files. A complete file comparison1253<p>Identical files on multiples backups are represented by hard links. Hardlinks are used so that identical files all refer to the same physical file on the server&#39;s disk. Also, hard links maintain reference counts so that BackupPC knows when to delete unused files from the pool.</p>
1793is always done to verify if two files are really the same.</p>1254
1794<p>Identical files on multiples backups are represented by hard links.1255<p>For the computer-science majors among you, you can think of the pooling system used by BackupPC as just a chained hash table stored on a (big) file system.</p>
1795Hardlinks are used so that identical files all refer to the same1256
1796physical file on the server's disk. Also, hard links maintain1257</dd>
1797reference counts so that BackupPC knows when to delete unused files1258<dt id="The-hashing-function">The hashing function</dt>
1798from the pool.</p>1259<dd>
1799<p>For the computer-science majors among you, you can think of the pooling1260
1800system used by BackupPC as just a chained hash table stored on a (big)1261<p>There is a tradeoff between how much of file is used for the MD5 digest and the time taken comparing all the files that have the same hash.</p>
1801file system.</p>1262
1802</dd>1263<p>Using the file length and just the first 4096 bytes of the file for the MD5 digest produces some repetitions. One example: with 900,000 unique files in the pool, this hash gives about 7,000 repeated files, and in the worst case 500 files have the same hash. That&#39;s not bad: we only have to do a single file compare 99.2% of the time. But in the worst case we have to compare as many as 500 files checking for a match.</p>
1803<dt><strong><a name="the_hashing_function" class="item">The hashing function</a></strong></dt>1264
18041265<p>With a modest increase in CPU time, if we use the file length and the first 256K of the file we now only have 500 repeated files and in the worst case around 20 files have the same hash. Furthermore, if we instead use the first and last 128K of the file (more specifically, the first and eighth 128K chunks for files larger than 1MB) we get only 300 repeated files and in the worst case around 20 files have the same hash.</p>
1805<dd>1266
1806<p>There is a tradeoff between how much of file is used for the MD5 digest1267<p>Based on this experimentation, this is the hash function used by BackupPC. It is important that you don&#39;t change the hash function after files are already in the pool. Otherwise your pool will grow to twice the size until all the old backups (and all the old files with old hashes) eventually expire.</p>
1807and the time taken comparing all the files that have the same hash.</p>1268
1808<p>Using the file length and just the first 4096 bytes of the file for the1269</dd>
1809MD5 digest produces some repetitions. One example: with 900,000 unique1270<dt id="Compression">Compression</dt>
1810files in the pool, this hash gives about 7,000 repeated files, and in1271<dd>
1811the worst case 500 files have the same hash. That's not bad: we only1272
1812have to do a single file compare 99.2% of the time. But in the worst1273<p>BackupPC supports compression. It uses the deflate and inflate methods in the Compress::Zlib module, which is based on the zlib compression library (see <a href="http://www.gzip.org/zlib/">http://www.gzip.org/zlib/</a>).</p>
1813case we have to compare as many as 500 files checking for a match.</p>1274
1814<p>With a modest increase in CPU time, if we use the file length and the1275<p>The <a href="#_conf_compresslevel_">$Conf{CompressLevel}</a> setting specifies the compression level to use. Zero (0) means no compression. Compression levels can be from 1 (least cpu time, slightly worse compression) to 9 (most cpu time, slightly better compression). The recommended value is 3. Changing it to 5, for example, will take maybe 20% more cpu time and will get another 2-3% additional compression. Diminishing returns set in above 5. See the zlib documentation for more information about compression levels.</p>
1815first 256K of the file we now only have 500 repeated files and in the1276
1816worst case around 20 files have the same hash. Furthermore, if we1277<p>BackupPC implements compression with minimal CPU load. Rather than compressing every incoming backup file and then trying to match it against the pool, BackupPC computes the MD5 digest based on the uncompressed file, and matches against the candidate pool files by comparing each uncompressed pool file against the incoming backup file. Since inflating a file takes roughly a factor of 10 less CPU time than deflating there is a big saving in CPU time.</p>
1817instead use the first and last 128K of the file (more specifically, the1278
1818first and eighth 128K chunks for files larger than 1MB) we get only 3001279<p>The combination of pooling common files and compression can yield a factor of 8 or more overall saving in backup storage.</p>
1819repeated files and in the worst case around 20 files have the same hash.</p>1280
1820<p>Based on this experimentation, this is the hash function used by BackupPC.
1821It is important that you don't change the hash function after files
1822are already in the pool. Otherwise your pool will grow to twice the
1823size until all the old backups (and all the old files with old hashes)
1824eventually expire.</p>
1825</dd>
1826<dt><strong><a name="compression" class="item">Compression</a></strong></dt>
1827
1828<dd>
1829<p>BackupPC supports compression. It uses the deflate and inflate methods
1830in the Compress::Zlib module, which is based on the zlib compression
1831library (see <a href="http://www.gzip.org/zlib/">http://www.gzip.org/zlib/</a>).</p>
1832<p>The <a href="#_conf_compresslevel_">$Conf{CompressLevel}</a> setting specifies the compression level to use.
1833Zero (0) means no compression. Compression levels can be from 1 (least
1834cpu time, slightly worse compression) to 9 (most cpu time, slightly
1835better compression). The recommended value is 3. Changing it to 5, for
1836example, will take maybe 20% more cpu time and will get another 2-3%
1837additional compression. Diminishing returns set in above 5. See the zlib
1838documentation for more information about compression levels.</p>
1839<p>BackupPC implements compression with minimal CPU load. Rather than
1840compressing every incoming backup file and then trying to match it
1841against the pool, BackupPC computes the MD5 digest based on the
1842uncompressed file, and matches against the candidate pool files by
1843comparing each uncompressed pool file against the incoming backup file.
1844Since inflating a file takes roughly a factor of 10 less CPU time than
1845deflating there is a big saving in CPU time.</p>
1846<p>The combination of pooling common files and compression can yield
1847a factor of 8 or more overall saving in backup storage.</p>
1848</dd>1281</dd>
1849</dl>1282</dl>
1850<p>1283
1851</p>1284<h2 id="BackupPC-operation">BackupPC operation</h2>
1852<h2><a name="backuppc_operation">BackupPC operation</a></h2>1285
1853<p>BackupPC reads the configuration information from1286<p>BackupPC reads the configuration information from __CONFDIR__/config.pl. It then runs and manages all the backup activity. It maintains queues of pending backup requests, user backup requests and administrative commands. Based on the configuration various requests will be executed simultaneously.</p>
1854__CONFDIR__/config.pl. It then runs and manages all the backup1287
1855activity. It maintains queues of pending backup requests, user backup1288<p>As specified by <a href="#_conf_wakeupschedule_">$Conf{WakeupSchedule}</a>, BackupPC wakes up periodically to queue backups on all the PCs. This is a four step process:</p>
1856requests and administrative commands. Based on the configuration various1289
1857requests will be executed simultaneously.</p>
1858<p>As specified by <a href="#_conf_wakeupschedule_">$Conf{WakeupSchedule}</a>, BackupPC wakes up periodically
1859to queue backups on all the PCs. This is a four step process:</p>
1860<ol>1290<ol>
1861<li>1291
1862<p>For each host and DHCP address backup requests are queued on the1292<li><p>For each host and DHCP address backup requests are queued on the background command queue.</p>
1863background command queue.</p>1293
1864</li>1294</li>
1865<li>1295<li><p>For each PC, BackupPC_dump is forked. Several of these may be run in parallel, based on the configuration. First a ping is done to see if the machine is alive. If this is a DHCP address, nmblookup is run to get the netbios name, which is used as the host name. If DNS lookup fails, <a href="#_conf_nmblookupfindhostcmd_">$Conf{NmbLookupFindHostCmd}</a> is run to find the IP address from the host name. The file __TOPDIR__/pc/$host/backups is read to decide whether a full or incremental backup needs to be run. If no backup is scheduled, or the ping to $host fails, then BackupPC_dump exits.</p>
1866<p>For each PC, BackupPC_dump is forked. Several of these may be run in1296
1867parallel, based on the configuration. First a ping is done to see if1297<p>The backup is done using the specified XferMethod. Either samba&#39;s smbclient or tar over ssh/rsh/nfs piped into BackupPC_tarExtract, or rsync over ssh/rsh is run, or rsyncd is connected to, with the incoming data extracted to __TOPDIR__/pc/$host/new. The XferMethod output is put into __TOPDIR__/pc/$host/XferLOG.</p>
1868the machine is alive. If this is a DHCP address, nmblookup is run to1298
1869get the netbios name, which is used as the host name. If DNS lookup1299<p>The letter in the XferLOG file shows the type of object, similar to the first letter of the modes displayed by ls -l:</p>
1870fails, <a href="#_conf_nmblookupfindhostcmd_">$Conf{NmbLookupFindHostCmd}</a> is run to find the IP address from1300
1871the host name. The file __TOPDIR__/pc/$host/backups is read to decide1301<pre><code> d -&gt; directory
1872whether a full or incremental backup needs to be run. If no backup is
1873scheduled, or the ping to $host fails, then BackupPC_dump exits.</p>
1874<p>The backup is done using the specified XferMethod. Either samba's smbclient
1875or tar over ssh/rsh/nfs piped into BackupPC_tarExtract, or rsync over ssh/rsh
1876is run, or rsyncd is connected to, with the incoming data
1877extracted to __TOPDIR__/pc/$host/new. The XferMethod output is put
1878into __TOPDIR__/pc/$host/XferLOG.</p>
1879<p>The letter in the XferLOG file shows the type of object, similar to the
1880first letter of the modes displayed by ls -l:</p>
1881<pre>
1882 d -&gt; directory
1883 l -&gt; symbolic link1302 l -&gt; symbolic link
1884 b -&gt; block special file1303 b -&gt; block special file
1885 c -&gt; character special file1304 c -&gt; character special file
1886 p -&gt; pipe file (fifo)1305 p -&gt; pipe file (fifo)
1887 nothing -&gt; regular file</pre>1306 nothing -&gt; regular file</code></pre>
1307
1888<p>The words mean:</p>1308<p>The words mean:</p>
1309
1889<dl>1310<dl>
1890<dt><strong><a name="create" class="item">create</a></strong></dt>
18911311
1312<dt id="create">create</dt>
1892<dd>1313<dd>
1314
1893<p>new for this backup (ie: directory or file not in pool)</p>1315<p>new for this backup (ie: directory or file not in pool)</p>
1316
1894</dd>1317</dd>
1895<dt><strong><a name="pool" class="item">pool</a></strong></dt>1318<dt id="pool">pool</dt>
1896
1897<dd>1319<dd>
1320
1898<p>found a match in the pool</p>1321<p>found a match in the pool</p>
1899</dd>1322
1900<dt><strong><a name="same" class="item">same</a></strong></dt>1323</dd>
19011324<dt id="same">same</dt>
1902<dd>1325<dd>
1903<p>file is identical to previous backup (contents were1326
1904checksummed and verified during full dump).</p>1327<p>file is identical to previous backup (contents were checksummed and verified during full dump).</p>
1905</dd>1328
1906<dt><strong><a name="skip" class="item">skip</a></strong></dt>1329</dd>
19071330<dt id="skip">skip</dt>
1908<dd>1331<dd>
1909<p>file skipped in incremental because attributes are the1332
1910same (only displayed if <a href="#_conf_xferloglevel_">$Conf{XferLogLevel}</a> &gt;= 2).</p>1333<p>file skipped in incremental because attributes are the same (only displayed if <a href="#_conf_xferloglevel_">$Conf{XferLogLevel}</a> &gt;= 2).</p>
1334
1911</dd>1335</dd>
1912</dl>1336</dl>
1913<p>As BackupPC_tarExtract extracts the files from smbclient or tar, or as1337
1914rsync or ftp runs, it checks each file in the backup to see if it is1338<p>As BackupPC_tarExtract extracts the files from smbclient or tar, or as rsync or ftp runs, it checks each file in the backup to see if it is identical to an existing file from any previous backup of any PC. It does this without needed to write the file to disk. If the file matches an existing file, a hardlink is created to the existing file in the pool. If the file does not match any existing files, the file is written to disk and the file name is saved in __TOPDIR__/pc/$host/NewFileList for later processing by BackupPC_link. BackupPC_tarExtract and rsync can handle arbitrarily large files and multiple candidate matching files without needing to write the file to disk in the case of a match. This significantly reduces disk writes (and also reads, since the pool file comparison is done disk to memory, rather than disk to disk).</p>
1915identical to an existing file from any previous backup of any PC. It1339
1916does this without needed to write the file to disk. If the file matches1340<p>Based on the configuration settings, BackupPC_dump checks each old backup to see if any should be removed. Any expired backups are moved to __TOPDIR__/trash for later removal by BackupPC_trashClean.</p>
1917an existing file, a hardlink is created to the existing file in the1341
1918pool. If the file does not match any existing files, the file is written1342</li>
1919to disk and the file name is saved in __TOPDIR__/pc/$host/NewFileList1343<li><p>For each complete, good, backup, BackupPC_link is run. To avoid race conditions as new files are linked into the pool area, only a single BackupPC_link program runs at a time and the rest are queued.</p>
1920for later processing by BackupPC_link. BackupPC_tarExtract and rsync1344
1921can handle arbitrarily large files and multiple candidate matching files1345<p>BackupPC_link reads the NewFileList written by BackupPC_dump and inspects each new file in the backup. It re-checks if there is a matching file in the pool (another BackupPC_link could have added the file since BackupPC_dump checked). If so, the file is removed and replaced by a hard link to the existing file. If the file is new, a hard link to the file is made in the pool area, so that this file is available for checking against each new file and new backup.</p>
1922without needing to write the file to disk in the case of a match. This1346
1923significantly reduces disk writes (and also reads, since the pool file1347<p>Then, if <a href="#_conf_incrfill_">$Conf{IncrFill}</a> is set (note that the default setting is off), for each incremental backup, hard links are made in the new backup to all files that were not extracted during the incremental backups. The means the incremental backup looks like a complete image of the PC (with the exception that files that were removed on the PC since the last full backup will still appear in the backup directory tree).</p>
1924comparison is done disk to memory, rather than disk to disk).</p>1348
1925<p>Based on the configuration settings, BackupPC_dump checks each1349<p>The CGI interface knows how to merge unfilled incremental backups will the most recent prior filled (full) backup, giving the incremental backups a filled appearance. The default for <a href="#_conf_incrfill_">$Conf{IncrFill}</a> is off, since there is no need to fill incremental backups. This saves some level of disk activity, since lots of extra hardlinks are no longer needed (and don&#39;t have to be deleted when the backup expires).</p>
1926old backup to see if any should be removed. Any expired backups1350
1927are moved to __TOPDIR__/trash for later removal by BackupPC_trashClean.</p>1351</li>
1928</li>1352<li><p>BackupPC_trashClean is always run in the background to remove any expired backups. Every 5 minutes it wakes up and removes all the files in __TOPDIR__/trash.</p>
1929<li>1353
1930<p>For each complete, good, backup, BackupPC_link is run.1354<p>Also, once each night, BackupPC_nightly is run to complete some additional administrative tasks, such as cleaning the pool. This involves removing any files in the pool that only have a single hard link (meaning no backups are using that file). Again, to avoid race conditions, BackupPC_nightly is only run when there are no BackupPC_link processes running. When BackupPC_nightly is run no new BackupPC_link jobs are started. If BackupPC_nightly takes too long to run, the settings <a href="#_conf_maxbackuppcnightlyjobs_">$Conf{MaxBackupPCNightlyJobs}</a> and <a href="#_conf_backuppcnightlyperiod_">$Conf{BackupPCNightlyPeriod}</a> can be used to run several BackupPC_nightly processes in parallel, and to split its job over several nights.</p>
1931To avoid race conditions as new files are linked into the1355
1932pool area, only a single BackupPC_link program runs
1933at a time and the rest are queued.</p>
1934<p>BackupPC_link reads the NewFileList written by BackupPC_dump and
1935inspects each new file in the backup. It re-checks if there is a
1936matching file in the pool (another BackupPC_link
1937could have added the file since BackupPC_dump checked). If so, the file
1938is removed and replaced by a hard link to the existing file. If the file
1939is new, a hard link to the file is made in the pool area, so that this
1940file is available for checking against each new file and new backup.</p>
1941<p>Then, if <a href="#_conf_incrfill_">$Conf{IncrFill}</a> is set (note that the default setting is
1942off), for each incremental backup, hard links are made in the new
1943backup to all files that were not extracted during the incremental
1944backups. The means the incremental backup looks like a complete
1945image of the PC (with the exception that files that were removed on
1946the PC since the last full backup will still appear in the backup
1947directory tree).</p>
1948<p>The CGI interface knows how to merge unfilled incremental backups will
1949the most recent prior filled (full) backup, giving the incremental
1950backups a filled appearance. The default for <a href="#_conf_incrfill_">$Conf{IncrFill}</a> is off,
1951since there is no need to fill incremental backups. This saves
1952some level of disk activity, since lots of extra hardlinks are no
1953longer needed (and don't have to be deleted when the backup expires).</p>
1954</li>
1955<li>
1956<p>BackupPC_trashClean is always run in the background to remove any
1957expired backups. Every 5 minutes it wakes up and removes all the files
1958in __TOPDIR__/trash.</p>
1959<p>Also, once each night, BackupPC_nightly is run to complete some
1960additional administrative tasks, such as cleaning the pool. This
1961involves removing any files in the pool that only have a single
1962hard link (meaning no backups are using that file). Again, to
1963avoid race conditions, BackupPC_nightly is only run when there
1964are no BackupPC_link processes running. When BackupPC_nightly is
1965run no new BackupPC_link jobs are started. If BackupPC_nightly
1966takes too long to run, the settings <a href="#_conf_maxbackuppcnightlyjobs_">$Conf{MaxBackupPCNightlyJobs}</a>
1967and <a href="#_conf_backuppcnightlyperiod_">$Conf{BackupPCNightlyPeriod}</a> can be used to run several
1968BackupPC_nightly processes in parallel, and to split its job over
1969several nights.</p>
1970</li>1356</li>
1971</ol>1357</ol>
1972<p>BackupPC also listens for TCP connections on <a href="#_conf_serverport_">$Conf{ServerPort}</a>, which1358
1973is used by the CGI script BackupPC_Admin for status reporting and1359<p>BackupPC also listens for TCP connections on <a href="#_conf_serverport_">$Conf{ServerPort}</a>, which is used by the CGI script BackupPC_Admin for status reporting and user-initiated backup or backup cancel requests.</p>
1974user-initiated backup or backup cancel requests.</p>1360
1975<p>1361<h2 id="Storage-layout">Storage layout</h2>
1976</p>1362
1977<h2><a name="storage_layout">Storage layout</a></h2>
1978<p>BackupPC resides in several directories:</p>1363<p>BackupPC resides in several directories:</p>
1364
1979<dl>1365<dl>
1980<dt><strong><a name="installdir" class="item">__INSTALLDIR__</a></strong></dt>
19811366
1367<dt id="INSTALLDIR__">__INSTALLDIR__</dt>
1982<dd>1368<dd>
1983<p>Perl scripts comprising BackupPC reside in __INSTALLDIR__/bin,1369
1984libraries are in __INSTALLDIR__/lib and documentation1370<p>Perl scripts comprising BackupPC reside in __INSTALLDIR__/bin, libraries are in __INSTALLDIR__/lib and documentation is in __INSTALLDIR__/doc.</p>
1985is in __INSTALLDIR__/doc.</p>1371
1986</dd>1372</dd>
1987<dt><strong><a name="cgidir" class="item">__CGIDIR__</a></strong></dt>1373<dt id="CGIDIR__">__CGIDIR__</dt>
1374<dd>
19881375
1989<dd>
1990<p>The CGI script BackupPC_Admin resides in this cgi binary directory.</p>1376<p>The CGI script BackupPC_Admin resides in this cgi binary directory.</p>
1377
1991</dd>1378</dd>
1992<dt><strong><a name="confdir" class="item">__CONFDIR__</a></strong></dt>1379<dt id="CONFDIR__">__CONFDIR__</dt>
1993
1994<dd>1380<dd>
1995<p>All the configuration information resides below __CONFDIR__.1381
1996This directory contains:</p>1382<p>All the configuration information resides below __CONFDIR__. This directory contains:</p>
1383
1997<p>The directory __CONFDIR__ contains:</p>1384<p>The directory __CONFDIR__ contains:</p>
1385
1998<dl>1386<dl>
1999<dt><strong><a name="config_pl" class="item">config.pl</a></strong></dt>
20001387
1388<dt id="config.pl">config.pl</dt>
2001<dd>1389<dd>
2002<p>Configuration file. See <a href="#configuration_file">Configuration file</a>1390
2003below for more details.</p>1391<p>Configuration file. See <a href="#Configuration-File">&quot;Configuration File&quot;</a> below for more details.</p>
1392
2004</dd>1393</dd>
2005<dt><strong><a name="hosts" class="item">hosts</a></strong></dt>1394<dt id="hosts">hosts</dt>
1395<dd>
20061396
2007<dd>
2008<p>Hosts file, which lists all the PCs to backup.</p>1397<p>Hosts file, which lists all the PCs to backup.</p>
1398
2009</dd>1399</dd>
2010<dt><strong><a name="pc" class="item">pc</a></strong></dt>1400<dt id="pc">pc</dt>
2011
2012<dd>1401<dd>
2013<p>The directory __CONFDIR__/pc contains per-client configuration files1402
2014that override settings in the main configuration file. Each file1403<p>The directory __CONFDIR__/pc contains per-client configuration files that override settings in the main configuration file. Each file is named __CONFDIR__/pc/HOST.pl, where HOST is the host name.</p>
2015is named __CONFDIR__/pc/HOST.pl, where HOST is the host name.</p>1404
2016<p>In pre-FHS versions of BackupPC these files were located in1405<p>In pre-FHS versions of BackupPC these files were located in __TOPDIR__/pc/HOST/config.pl.</p>
2017__TOPDIR__/pc/HOST/config.pl.</p>1406
2018</dd>1407</dd>
2019</dl>1408</dl>
1409
2020</dd>1410</dd>
2021<dt><strong><a name="logdir" class="item">__LOGDIR__</a></strong></dt>1411<dt id="LOGDIR__">__LOGDIR__</dt>
2022
2023<dd>1412<dd>
2024<p>The directory __LOGDIR__ (__TOPDIR__/log on pre-FHS versions1413
2025of BackupPC) contains:</p>1414<p>The directory __LOGDIR__ (__TOPDIR__/log on pre-FHS versions of BackupPC) contains:</p>
1415
2026<dl>1416<dl>
2027<dt><strong><a name="log" class="item">LOG</a></strong></dt>1417
20281418<dt id="LOG">LOG</dt>
2029<dd>1419<dd>
2030<p>Current (today's) log file output from BackupPC.</p>1420
2031</dd>1421<p>Current (today&#39;s) log file output from BackupPC.</p>
2032<dt><strong><a name="log_0_or_log_0_z" class="item">LOG.0 or LOG.0.z</a></strong></dt>1422
20331423</dd>
2034<dd>1424<dt id="LOG.0-or-LOG.0.z">LOG.0 or LOG.0.z</dt>
2035<p>Yesterday's log file output. Log files are aged daily and compressed1425<dd>
2036(if compression is enabled), and old LOG files are deleted.</p>1426
2037</dd>1427<p>Yesterday&#39;s log file output. Log files are aged daily and compressed (if compression is enabled), and old LOG files are deleted.</p>
2038<dt><strong><a name="backuppc_pid" class="item">BackupPC.pid</a></strong></dt>1428
20391429</dd>
2040<dd>1430<dt id="BackupPC.pid">BackupPC.pid</dt>
2041<p>Contains BackupPC's process id.</p>1431<dd>
2042</dd>1432
2043<dt><strong><a name="status_pl" class="item">status.pl</a></strong></dt>1433<p>Contains BackupPC&#39;s process id.</p>
20441434
2045<dd>1435</dd>
2046<p>A summary of BackupPC's status written periodically by BackupPC so1436<dt id="status.pl">status.pl</dt>
2047that certain state information can be maintained if BackupPC is1437<dd>
2048restarted. Should not be edited.</p>1438
2049</dd>1439<p>A summary of BackupPC&#39;s status written periodically by BackupPC so that certain state information can be maintained if BackupPC is restarted. Should not be edited.</p>
2050<dt><strong><a name="useremailinfo_pl" class="item">UserEmailInfo.pl</a></strong></dt>1440
20511441</dd>
2052<dd>1442<dt id="UserEmailInfo.pl">UserEmailInfo.pl</dt>
2053<p>A summary of what email was last sent to each user, and when the1443<dd>
2054last email was sent. Should not be edited.</p>1444
1445<p>A summary of what email was last sent to each user, and when the last email was sent. Should not be edited.</p>
1446
2055</dd>1447</dd>
2056</dl>1448</dl>
1449
2057</dd>1450</dd>
2058<dt><strong><a name="topdir" class="item">__TOPDIR__</a></strong></dt>1451<dt id="TOPDIR__">__TOPDIR__</dt>
2059
2060<dd>1452<dd>
2061<p>All of BackupPC's data (PC backup images, logs, configuration information)1453
2062is stored below this directory.</p>1454<p>All of BackupPC&#39;s data (PC backup images, logs, configuration information) is stored below this directory.</p>
1455
2063<p>Below __TOPDIR__ are several directories:</p>1456<p>Below __TOPDIR__ are several directories:</p>
1457
2064<dl>1458<dl>
2065<dt><strong><a name="topdir_trash" class="item">__TOPDIR__/trash</a></strong></dt>
20661459
1460<dt id="TOPDIR__-trash">__TOPDIR__/trash</dt>
2067<dd>1461<dd>
2068<p>Any directories and files below this directory are periodically deleted1462
2069whenever BackupPC_trashClean checks. When a backup is aborted or when an1463<p>Any directories and files below this directory are periodically deleted whenever BackupPC_trashClean checks. When a backup is aborted or when an old backup expires, BackupPC_dump simply moves the directory to __TOPDIR__/trash for later removal by BackupPC_trashClean.</p>
2070old backup expires, BackupPC_dump simply moves the directory to1464
2071__TOPDIR__/trash for later removal by BackupPC_trashClean.</p>
2072</dd>1465</dd>
2073<dt><strong><a name="topdir_pool" class="item">__TOPDIR__/pool</a></strong></dt>1466<dt id="TOPDIR__-pool">__TOPDIR__/pool</dt>
2074
2075<dd>1467<dd>
2076<p>All uncompressed files from PC backups are stored below __TOPDIR__/pool.1468
2077Each file's name is based on the MD5 hex digest of the file contents.1469<p>All uncompressed files from PC backups are stored below __TOPDIR__/pool. Each file&#39;s name is based on the MD5 hex digest of the file contents. Specifically, for files less than 256K, the file length and the entire file is used. For files up to 1MB, the file length and the first and last 128K are used. Finally, for files longer than 1MB, the file length, and the first and eighth 128K chunks for the file are used.</p>
2078Specifically, for files less than 256K, the file length and the entire1470
2079file is used. For files up to 1MB, the file length and the first and1471<p>Each file is stored in a subdirectory X/Y/Z, where X, Y, Z are the first 3 hex digits of the MD5 digest.</p>
2080last 128K are used. Finally, for files longer than 1MB, the file length,1472
2081and the first and eighth 128K chunks for the file are used.</p>1473<p>For example, if a file has an MD5 digest of 123456789abcdef0, the file is stored in __TOPDIR__/pool/1/2/3/123456789abcdef0.</p>
2082<p>Each file is stored in a subdirectory X/Y/Z, where X, Y, Z are the1474
2083first 3 hex digits of the MD5 digest.</p>1475<p>The MD5 digest might not be unique (especially since not all the file&#39;s contents are used for files bigger than 256K). Different files that have the same MD5 digest are stored with a trailing suffix &quot;_n&quot; where n is an incrementing number starting at 0. So, for example, if two additional files were identical to the first, except the last byte was different, and assuming the file was larger than 1MB (so the MD5 digests are the same but the files are actually different), the three files would be stored as:</p>
2084<p>For example, if a file has an MD5 digest of 123456789abcdef0,1476
2085the file is stored in __TOPDIR__/pool/1/2/3/123456789abcdef0.</p>1477<pre><code> __TOPDIR__/pool/1/2/3/123456789abcdef0
2086<p>The MD5 digest might not be unique (especially since not all the file's
2087contents are used for files bigger than 256K). Different files that have
2088the same MD5 digest are stored with a trailing suffix &quot;_n&quot; where n is
2089an incrementing number starting at 0. So, for example, if two additional
2090files were identical to the first, except the last byte was different,
2091and assuming the file was larger than 1MB (so the MD5 digests are the
2092same but the files are actually different), the three files would be
2093stored as:</p>
2094<pre>
2095 __TOPDIR__/pool/1/2/3/123456789abcdef0
2096 __TOPDIR__/pool/1/2/3/123456789abcdef0_01478 __TOPDIR__/pool/1/2/3/123456789abcdef0_0
2097 __TOPDIR__/pool/1/2/3/123456789abcdef0_1</pre>1479 __TOPDIR__/pool/1/2/3/123456789abcdef0_1</code></pre>
2098<p>Both BackupPC_dump (actually, BackupPC_tarExtract) and BackupPC_link are1480
2099responsible for checking newly backed up files against the pool. For1481<p>Both BackupPC_dump (actually, BackupPC_tarExtract) and BackupPC_link are responsible for checking newly backed up files against the pool. For each file, the MD5 digest is used to generate a file name in the pool directory. If the file exists in the pool, the contents are compared. If there is no match, additional files ending in &quot;_n&quot; are checked. (Actually, BackupPC_tarExtract compares multiple candidate files in parallel.) If the file contents exactly match, the file is created by simply making a hard link to the pool file (this is done by BackupPC_tarExtract as the backup proceeds). Otherwise, BackupPC_tarExtract writes the new file to disk and a new hard link is made in the pool to the file (this is done later by BackupPC_link).</p>
2100each file, the MD5 digest is used to generate a file name in the pool1482
2101directory. If the file exists in the pool, the contents are compared.1483<p>Therefore, every file in the pool will have at least 2 hard links (one for the pool file and one for the backup file below __TOPDIR__/pc). Identical files from different backups or PCs will all be linked to the same file. When old backups are deleted, some files in the pool might only have one link. BackupPC_nightly checks the entire pool and removes all files that have only a single link, thereby recovering the storage for that file.</p>
2102If there is no match, additional files ending in &quot;_n&quot; are checked.1484
2103(Actually, BackupPC_tarExtract compares multiple candidate files in1485<p>One other issue: zero length files are not pooled, since there are a lot of these files and on most file systems it doesn&#39;t save any disk space to turn these files into hard links.</p>
2104parallel.) If the file contents exactly match, the file is created by1486
2105simply making a hard link to the pool file (this is done by1487</dd>
2106BackupPC_tarExtract as the backup proceeds). Otherwise,1488<dt id="TOPDIR__-cpool">__TOPDIR__/cpool</dt>
2107BackupPC_tarExtract writes the new file to disk and a new hard link is1489<dd>
2108made in the pool to the file (this is done later by BackupPC_link).</p>1490
2109<p>Therefore, every file in the pool will have at least 2 hard links1491<p>All compressed files from PC backups are stored below __TOPDIR__/cpool. Its layout is the same as __TOPDIR__/pool, and the hashing function is the same (and, importantly, based on the uncompressed file, not the compressed file).</p>
2110(one for the pool file and one for the backup file below __TOPDIR__/pc).1492
2111Identical files from different backups or PCs will all be linked to1493</dd>
2112the same file. When old backups are deleted, some files in the pool1494<dt id="TOPDIR__-pc-host">__TOPDIR__/pc/$host</dt>
2113might only have one link. BackupPC_nightly checks the entire pool1495<dd>
2114and removes all files that have only a single link, thereby recovering1496
2115the storage for that file.</p>1497<p>For each PC $host, all the backups for that PC are stored below the directory __TOPDIR__/pc/$host. This directory contains the following files:</p>
2116<p>One other issue: zero length files are not pooled, since there are a lot1498
2117of these files and on most file systems it doesn't save any disk space
2118to turn these files into hard links.</p>
2119</dd>
2120<dt><strong><a name="topdir_cpool" class="item">__TOPDIR__/cpool</a></strong></dt>
2121
2122<dd>
2123<p>All compressed files from PC backups are stored below __TOPDIR__/cpool.
2124Its layout is the same as __TOPDIR__/pool, and the hashing function
2125is the same (and, importantly, based on the uncompressed file, not
2126the compressed file).</p>
2127</dd>
2128<dt><strong><a name="topdir_pc_host" class="item">__TOPDIR__/pc/$host</a></strong></dt>
2129
2130<dd>
2131<p>For each PC $host, all the backups for that PC are stored below
2132the directory __TOPDIR__/pc/$host. This directory contains the
2133following files:</p>
2134<dl>1499<dl>
2135<dt><strong><a name="log2" class="item">LOG</a></strong></dt>
21361500
1501<dt id="LOG1">LOG</dt>
2137<dd>1502<dd>
1503
2138<p>Current log file for this PC from BackupPC_dump.</p>1504<p>Current log file for this PC from BackupPC_dump.</p>
2139</dd>1505
2140<dt><strong><a name="log_ddmmyyyy_or_log_ddmmyyyy_z" class="item">LOG.DDMMYYYY or LOG.DDMMYYYY.z</a></strong></dt>1506</dd>
21411507<dt id="LOG.DDMMYYYY-or-LOG.DDMMYYYY.z">LOG.DDMMYYYY or LOG.DDMMYYYY.z</dt>
2142<dd>1508<dd>
2143<p>Last month's log file. Log files are aged monthly and compressed1509
2144(if compression is enabled), and old LOG files are deleted.1510<p>Last month&#39;s log file. Log files are aged monthly and compressed (if compression is enabled), and old LOG files are deleted. In earlier versions of BackupPC these files used to have a suffix of 0, 1, ....</p>
2145In earlier versions of BackupPC these files used to have1511
2146a suffix of 0, 1, ....</p>1512</dd>
2147</dd>1513<dt id="XferERR-or-XferERR.z">XferERR or XferERR.z</dt>
2148<dt><strong><a name="xfererr_or_xfererr_z" class="item">XferERR or XferERR.z</a></strong></dt>1514<dd>
21491515
2150<dd>1516<p>Output from the transport program (ie: smbclient, tar, rsync or ftp) for the most recent failed backup.</p>
2151<p>Output from the transport program (ie: smbclient, tar, rsync or ftp)1517
2152for the most recent failed backup.</p>1518</dd>
2153</dd>1519<dt id="new">new</dt>
2154<dt><strong><a name="new" class="item">new</a></strong></dt>1520<dd>
21551521
2156<dd>1522<p>Subdirectory in which the current backup is stored. This directory is renamed if the backup succeeds.</p>
2157<p>Subdirectory in which the current backup is stored. This1523
2158directory is renamed if the backup succeeds.</p>1524</dd>
2159</dd>1525<dt id="XferLOG-or-XferLOG.z">XferLOG or XferLOG.z</dt>
2160<dt><strong><a name="xferlog_or_xferlog_z" class="item">XferLOG or XferLOG.z</a></strong></dt>1526<dd>
21611527
2162<dd>1528<p>Output from the transport program (ie: smbclient, tar, rsync or ftp) for the current backup.</p>
2163<p>Output from the transport program (ie: smbclient, tar, rsync or ftp)1529
2164for the current backup.</p>1530</dd>
2165</dd>1531<dt id="nnn-an-integer-">nnn (an integer)</dt>
2166<dt><strong><a name="nnn" class="item">nnn (an integer)</a></strong></dt>1532<dd>
21671533
2168<dd>
2169<p>Successful backups are in directories numbered sequentially starting at 0.</p>1534<p>Successful backups are in directories numbered sequentially starting at 0.</p>
2170</dd>1535
2171<dt><strong><a name="xferlog_nnn_or_xferlog_nnn_z" class="item">XferLOG.nnn or XferLOG.nnn.z</a></strong></dt>1536</dd>
21721537<dt id="XferLOG.nnn-or-XferLOG.nnn.z">XferLOG.nnn or XferLOG.nnn.z</dt>
2173<dd>1538<dd>
2174<p>Output from the transport program (ie: smbclient, tar, rsync or ftp)1539
2175corresponding to backup number nnn.</p>1540<p>Output from the transport program (ie: smbclient, tar, rsync or ftp) corresponding to backup number nnn.</p>
2176</dd>1541
2177<dt><strong><a name="restoreinfo_nnn" class="item">RestoreInfo.nnn</a></strong></dt>1542</dd>
21781543<dt id="RestoreInfo.nnn">RestoreInfo.nnn</dt>
2179<dd>1544<dd>
2180<p>Information about restore request #nnn including who, what, when, and1545
2181why. This file is in Data::Dumper format. (Note that the restore1546<p>Information about restore request #nnn including who, what, when, and why. This file is in Data::Dumper format. (Note that the restore numbers are not related to the backup number.)</p>
2182numbers are not related to the backup number.)</p>1547
2183</dd>1548</dd>
2184<dt><strong><a name="restorelog_nnn_z" class="item">RestoreLOG.nnn.z</a></strong></dt>1549<dt id="RestoreLOG.nnn.z">RestoreLOG.nnn.z</dt>
21851550<dd>
2186<dd>1551
2187<p>Output from smbclient, tar or rsync during restore #nnn. (Note that the restore1552<p>Output from smbclient, tar or rsync during restore #nnn. (Note that the restore numbers are not related to the backup number.)</p>
2188numbers are not related to the backup number.)</p>1553
2189</dd>1554</dd>
2190<dt><strong><a name="archiveinfo_nnn" class="item">ArchiveInfo.nnn</a></strong></dt>1555<dt id="ArchiveInfo.nnn">ArchiveInfo.nnn</dt>
21911556<dd>
2192<dd>1557
2193<p>Information about archive request #nnn including who, what, when, and1558<p>Information about archive request #nnn including who, what, when, and why. This file is in Data::Dumper format. (Note that the archive numbers are not related to the restore or backup number.)</p>
2194why. This file is in Data::Dumper format. (Note that the archive1559
2195numbers are not related to the restore or backup number.)</p>1560</dd>
2196</dd>1561<dt id="ArchiveLOG.nnn.z">ArchiveLOG.nnn.z</dt>
2197<dt><strong><a name="archivelog_nnn_z" class="item">ArchiveLOG.nnn.z</a></strong></dt>1562<dd>
21981563
2199<dd>1564<p>Output from archive #nnn. (Note that the archive numbers are not related to the backup or restore number.)</p>
2200<p>Output from archive #nnn. (Note that the archive numbers are not related1565
2201to the backup or restore number.)</p>1566</dd>
2202</dd>1567<dt id="config.pl1">config.pl</dt>
2203<dt><strong><a name="config_pl2" class="item">config.pl</a></strong></dt>1568<dd>
22041569
2205<dd>1570<p>Old location of optional configuration settings specific to this host. Settings in this file override the main configuration file. In new versions of BackupPC the per-host configuration files are stored in __CONFDIR__/pc/HOST.pl.</p>
2206<p>Old location of optional configuration settings specific to this host.1571
2207Settings in this file override the main configuration file.1572</dd>
2208In new versions of BackupPC the per-host configuration files are1573<dt id="backups">backups</dt>
2209stored in __CONFDIR__/pc/HOST.pl.</p>1574<dd>
2210</dd>1575
2211<dt><strong><a name="backups" class="item">backups</a></strong></dt>1576<p>A tab-delimited ascii table listing information about each successful backup, one per row. The columns are:</p>
22121577
2213<dd>
2214<p>A tab-delimited ascii table listing information about each successful
2215backup, one per row. The columns are:</p>
2216<dl>1578<dl>
2217<dt><strong><a name="num" class="item">num</a></strong></dt>
22181579
1580<dt id="num">num</dt>
2219<dd>1581<dd>
2220<p>The backup number, an integer that starts at 0 and increments1582
2221for each successive backup. The corresponding backup is stored1583<p>The backup number, an integer that starts at 0 and increments for each successive backup. The corresponding backup is stored in the directory num (eg: if this field is 5, then the backup is stored in __TOPDIR__/pc/$host/5).</p>
2222in the directory num (eg: if this field is 5, then the backup is1584
2223stored in __TOPDIR__/pc/$host/5).</p>
2224</dd>1585</dd>
2225<dt><strong><a name="type" class="item">type</a></strong></dt>1586<dt id="type">type</dt>
1587<dd>
22261588
2227<dd>
2228<p>Set to &quot;full&quot; or &quot;incr&quot; for full or incremental backup.</p>1589<p>Set to &quot;full&quot; or &quot;incr&quot; for full or incremental backup.</p>
1590
2229</dd>1591</dd>
2230<dt><strong><a name="starttime" class="item">startTime</a></strong></dt>1592<dt id="startTime">startTime</dt>
2231
2232<dd>1593<dd>
1594
2233<p>Start time of the backup in unix seconds.</p>1595<p>Start time of the backup in unix seconds.</p>
1596
2234</dd>1597</dd>
2235<dt><strong><a name="endtime" class="item">endTime</a></strong></dt>1598<dt id="endTime">endTime</dt>
2236
2237<dd>1599<dd>
1600
2238<p>Stop time of the backup in unix seconds.</p>1601<p>Stop time of the backup in unix seconds.</p>
1602
2239</dd>1603</dd>
2240<dt><strong><a name="nfiles" class="item">nFiles</a></strong></dt>1604<dt id="nFiles">nFiles</dt>
2241
2242<dd>1605<dd>
1606
2243<p>Number of files backed up (as reported by smbclient, tar, rsync or ftp).</p>1607<p>Number of files backed up (as reported by smbclient, tar, rsync or ftp).</p>
1608
2244</dd>1609</dd>
2245<dt><strong><a name="size" class="item">size</a></strong></dt>1610<dt id="size">size</dt>
2246
2247<dd>1611<dd>
1612
2248<p>Total file size backed up (as reported by smbclient, tar, rsync or ftp).</p>1613<p>Total file size backed up (as reported by smbclient, tar, rsync or ftp).</p>
2249</dd>1614
2250<dt><strong><a name="nfilesexist" class="item">nFilesExist</a></strong></dt>1615</dd>
22511616<dt id="nFilesExist">nFilesExist</dt>
2252<dd>1617<dd>
2253<p>Number of files that were already in the pool1618
2254(as determined by BackupPC_dump and BackupPC_link).</p>1619<p>Number of files that were already in the pool (as determined by BackupPC_dump and BackupPC_link).</p>
2255</dd>1620
2256<dt><strong><a name="sizeexist" class="item">sizeExist</a></strong></dt>1621</dd>
22571622<dt id="sizeExist">sizeExist</dt>
2258<dd>1623<dd>
2259<p>Total size of files that were already in the pool1624
2260(as determined by BackupPC_dump and BackupPC_link).</p>1625<p>Total size of files that were already in the pool (as determined by BackupPC_dump and BackupPC_link).</p>
2261</dd>1626
2262<dt><strong><a name="nfilesnew" class="item">nFilesNew</a></strong></dt>1627</dd>
22631628<dt id="nFilesNew">nFilesNew</dt>
2264<dd>1629<dd>
2265<p>Number of files that were not in the pool1630
2266(as determined by BackupPC_link).</p>1631<p>Number of files that were not in the pool (as determined by BackupPC_link).</p>
2267</dd>1632
2268<dt><strong><a name="sizenew" class="item">sizeNew</a></strong></dt>1633</dd>
22691634<dt id="sizeNew">sizeNew</dt>
2270<dd>1635<dd>
2271<p>Total size of files that were not in the pool1636
2272(as determined by BackupPC_link).</p>1637<p>Total size of files that were not in the pool (as determined by BackupPC_link).</p>
2273</dd>1638
2274<dt><strong><a name="xfererrs" class="item">xferErrs</a></strong></dt>1639</dd>
22751640<dt id="xferErrs">xferErrs</dt>
2276<dd>1641<dd>
1642
2277<p>Number of errors or warnings from smbclient, tar, rsync or ftp.</p>1643<p>Number of errors or warnings from smbclient, tar, rsync or ftp.</p>
1644
2278</dd>1645</dd>
2279<dt><strong><a name="xferbadfile" class="item">xferBadFile</a></strong></dt>1646<dt id="xferBadFile">xferBadFile</dt>
2280
2281<dd>1647<dd>
1648
2282<p>Number of errors from smbclient that were bad file errors (zero otherwise).</p>1649<p>Number of errors from smbclient that were bad file errors (zero otherwise).</p>
1650
2283</dd>1651</dd>
2284<dt><strong><a name="xferbadshare" class="item">xferBadShare</a></strong></dt>1652<dt id="xferBadShare">xferBadShare</dt>
2285
2286<dd>1653<dd>
1654
2287<p>Number of errors from smbclient that were bad share errors (zero otherwise).</p>1655<p>Number of errors from smbclient that were bad share errors (zero otherwise).</p>
1656
2288</dd>1657</dd>
2289<dt><strong><a name="tarerrs" class="item">tarErrs</a></strong></dt>1658<dt id="tarErrs">tarErrs</dt>
2290
2291<dd>1659<dd>
1660
2292<p>Number of errors from BackupPC_tarExtract.</p>1661<p>Number of errors from BackupPC_tarExtract.</p>
2293</dd>1662
2294<dt><strong><a name="compress" class="item">compress</a></strong></dt>1663</dd>
22951664<dt id="compress">compress</dt>
2296<dd>1665<dd>
2297<p>The compression level used on this backup. Zero or empty means no1666
2298compression.</p>1667<p>The compression level used on this backup. Zero or empty means no compression.</p>
2299</dd>1668
2300<dt><strong><a name="sizeexistcomp" class="item">sizeExistComp</a></strong></dt>1669</dd>
23011670<dt id="sizeExistComp">sizeExistComp</dt>
2302<dd>1671<dd>
2303<p>Total compressed size of files that were already in the pool1672
2304(as determined by BackupPC_dump and BackupPC_link).</p>1673<p>Total compressed size of files that were already in the pool (as determined by BackupPC_dump and BackupPC_link).</p>
2305</dd>1674
2306<dt><strong><a name="sizenewcomp" class="item">sizeNewComp</a></strong></dt>1675</dd>
23071676<dt id="sizeNewComp">sizeNewComp</dt>
2308<dd>1677<dd>
2309<p>Total compressed size of files that were not in the pool1678
2310(as determined by BackupPC_link).</p>1679<p>Total compressed size of files that were not in the pool (as determined by BackupPC_link).</p>
2311</dd>1680
2312<dt><strong><a name="nofill" class="item">noFill</a></strong></dt>1681</dd>
23131682<dt id="noFill">noFill</dt>
2314<dd>1683<dd>
2315<p>Set if this backup has not been filled in with the most recent1684
2316previous filled or full backup. See <a href="#_conf_incrfill_">$Conf{IncrFill}</a>.</p>1685<p>Set if this backup has not been filled in with the most recent previous filled or full backup. See <a href="#_conf_incrfill_">$Conf{IncrFill}</a>.</p>
2317</dd>1686
2318<dt><strong><a name="fillfromnum" class="item">fillFromNum</a></strong></dt>1687</dd>
23191688<dt id="fillFromNum">fillFromNum</dt>
2320<dd>1689<dd>
2321<p>If this backup was filled (ie: noFill is 0) then this is the1690
2322number of the backup that it was filled from</p>1691<p>If this backup was filled (ie: noFill is 0) then this is the number of the backup that it was filled from</p>
2323</dd>1692
2324<dt><strong><a name="mangle" class="item">mangle</a></strong></dt>1693</dd>
23251694<dt id="mangle">mangle</dt>
2326<dd>1695<dd>
2327<p>Set if this backup has mangled file names and attributes. Always1696
2328true for backups in v1.4.0 and above. False for all backups prior1697<p>Set if this backup has mangled file names and attributes. Always true for backups in v1.4.0 and above. False for all backups prior to v1.4.0.</p>
2329to v1.4.0.</p>1698
2330</dd>1699</dd>
2331<dt><strong><a name="xfermethod" class="item">xferMethod</a></strong></dt>1700<dt id="xferMethod">xferMethod</dt>
23321701<dd>
2333<dd>1702
2334<p>Set to the value of <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> when this dump was done.</p>1703<p>Set to the value of <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> when this dump was done.</p>
1704
2335</dd>1705</dd>
2336<dt><strong><a name="level" class="item">level</a></strong></dt>1706<dt id="level">level</dt>
2337
2338<dd>1707<dd>
2339<p>The level of this dump. A full dump is level 0. Currently incrementals1708
2340are 1. But when multi-level incrementals are supported this will reflect1709<p>The level of this dump. A full dump is level 0. Currently incrementals are 1. But when multi-level incrementals are supported this will reflect each dump&#39;s incremental level.</p>
2341each dump's incremental level.</p>1710
2342</dd>1711</dd>
2343</dl>1712</dl>
1713
2344</dd>1714</dd>
2345<dt><strong><a name="restores" class="item">restores</a></strong></dt>1715<dt id="restores">restores</dt>
2346
2347<dd>1716<dd>
2348<p>A tab-delimited ascii table listing information about each requested1717
2349restore, one per row. The columns are:</p>1718<p>A tab-delimited ascii table listing information about each requested restore, one per row. The columns are:</p>
1719
2350<dl>1720<dl>
2351<dt><strong>num</strong></dt>
23521721
1722<dt id="num1">num</dt>
2353<dd>1723<dd>
2354<p>Restore number (matches the suffix of the RestoreInfo.nnn and1724
2355RestoreLOG.nnn.z file), unrelated to the backup number.</p>1725<p>Restore number (matches the suffix of the RestoreInfo.nnn and RestoreLOG.nnn.z file), unrelated to the backup number.</p>
1726
2356</dd>1727</dd>
2357<dt><strong><a name="starttime2" class="item">startTime</a></strong></dt>1728<dt id="startTime1">startTime</dt>
1729<dd>
23581730
2359<dd>
2360<p>Start time of the restore in unix seconds.</p>1731<p>Start time of the restore in unix seconds.</p>
1732
2361</dd>1733</dd>
2362<dt><strong><a name="endtime2" class="item">endTime</a></strong></dt>1734<dt id="endTime1">endTime</dt>
2363
2364<dd>1735<dd>
1736
2365<p>End time of the restore in unix seconds.</p>1737<p>End time of the restore in unix seconds.</p>
1738
2366</dd>1739</dd>
2367<dt><strong><a name="result" class="item">result</a></strong></dt>1740<dt id="result">result</dt>
2368
2369<dd>1741<dd>
1742
2370<p>Result (ok or failed).</p>1743<p>Result (ok or failed).</p>
1744
2371</dd>1745</dd>
2372<dt><strong><a name="errormsg" class="item">errorMsg</a></strong></dt>1746<dt id="errorMsg">errorMsg</dt>
2373
2374<dd>1747<dd>
1748
2375<p>Error message if restore failed.</p>1749<p>Error message if restore failed.</p>
1750
2376</dd>1751</dd>
2377<dt><strong><a name="nfiles2" class="item">nFiles</a></strong></dt>1752<dt id="nFiles1">nFiles</dt>
2378
2379<dd>1753<dd>
1754
2380<p>Number of files restored.</p>1755<p>Number of files restored.</p>
1756
2381</dd>1757</dd>
2382<dt><strong>size</strong></dt>1758<dt id="size1">size</dt>
2383
2384<dd>1759<dd>
1760
2385<p>Size in bytes of the restored files.</p>1761<p>Size in bytes of the restored files.</p>
1762
2386</dd>1763</dd>
2387<dt><strong><a name="tarcreateerrs" class="item">tarCreateErrs</a></strong></dt>1764<dt id="tarCreateErrs">tarCreateErrs</dt>
2388
2389<dd>1765<dd>
1766
2390<p>Number of errors from BackupPC_tarCreate during restore.</p>1767<p>Number of errors from BackupPC_tarCreate during restore.</p>
1768
2391</dd>1769</dd>
2392<dt><strong><a name="xfererrs2" class="item">xferErrs</a></strong></dt>1770<dt id="xferErrs1">xferErrs</dt>
2393
2394<dd>1771<dd>
1772
2395<p>Number of errors from smbclient, tar, rsync or ftp during restore.</p>1773<p>Number of errors from smbclient, tar, rsync or ftp during restore.</p>
1774
2396</dd>1775</dd>
2397</dl>1776</dl>
1777
2398</dd>1778</dd>
2399<dt><strong><a name="archives" class="item">archives</a></strong></dt>1779<dt id="archives">archives</dt>
2400
2401<dd>1780<dd>
2402<p>A tab-delimited ascii table listing information about each requested1781
2403archive, one per row. The columns are:</p>1782<p>A tab-delimited ascii table listing information about each requested archive, one per row. The columns are:</p>
1783
2404<dl>1784<dl>
2405<dt><strong>num</strong></dt>
24061785
1786<dt id="num2">num</dt>
2407<dd>1787<dd>
2408<p>Archive number (matches the suffix of the ArchiveInfo.nnn and1788
2409ArchiveLOG.nnn.z file), unrelated to the backup or restore number.</p>1789<p>Archive number (matches the suffix of the ArchiveInfo.nnn and ArchiveLOG.nnn.z file), unrelated to the backup or restore number.</p>
1790
2410</dd>1791</dd>
2411<dt><strong><a name="starttime3" class="item">startTime</a></strong></dt>1792<dt id="startTime2">startTime</dt>
1793<dd>
24121794
2413<dd>
2414<p>Start time of the restore in unix seconds.</p>1795<p>Start time of the restore in unix seconds.</p>
1796
2415</dd>1797</dd>
2416<dt><strong><a name="endtime3" class="item">endTime</a></strong></dt>1798<dt id="endTime2">endTime</dt>
2417
2418<dd>1799<dd>
1800
2419<p>End time of the restore in unix seconds.</p>1801<p>End time of the restore in unix seconds.</p>
1802
2420</dd>1803</dd>
2421<dt><strong>result</strong></dt>1804<dt id="result1">result</dt>
2422
2423<dd>1805<dd>
1806
2424<p>Result (ok or failed).</p>1807<p>Result (ok or failed).</p>
1808
2425</dd>1809</dd>
2426<dt><strong><a name="errormsg2" class="item">errorMsg</a></strong></dt>1810<dt id="errorMsg1">errorMsg</dt>
2427
2428<dd>1811<dd>
1812
2429<p>Error message if archive failed.</p>1813<p>Error message if archive failed.</p>
2430</dd>1814
2431</dl>1815</dd>
2432</dd>1816</dl>
2433</dl>1817
2434</dd>1818</dd>
2435</dl>1819</dl>
2436</dd>1820
2437</dl>1821</dd>
2438<p>1822</dl>
2439</p>1823
2440<h2><a name="compressed_file_format">Compressed file format</a></h2>1824</dd>
2441<p>The compressed file format is as generated by Compress::Zlib::deflate1825</dl>
2442with one minor, but important, tweak. Since Compress::Zlib::inflate1826
2443fully inflates its argument in memory, it could take large amounts of1827<h2 id="Compressed-file-format">Compressed file format</h2>
2444memory if it was inflating a highly compressed file. For example, a1828
2445200MB file of 0x0 bytes compresses to around 200K bytes. If1829<p>The compressed file format is as generated by Compress::Zlib::deflate with one minor, but important, tweak. Since Compress::Zlib::inflate fully inflates its argument in memory, it could take large amounts of memory if it was inflating a highly compressed file. For example, a 200MB file of 0x0 bytes compresses to around 200K bytes. If Compress::Zlib::inflate was called with this single 200K buffer, it would need to allocate 200MB of memory to return the result.</p>
2446Compress::Zlib::inflate was called with this single 200K buffer, it1830
2447would need to allocate 200MB of memory to return the result.</p>1831<p>BackupPC watches how efficiently a file is compressing. If a big file has very high compression (meaning it will use too much memory when it is inflated), BackupPC calls the flush() method, which gracefully completes the current compression. BackupPC then starts another deflate and simply appends the output file. So the BackupPC compressed file format is one or more concatenated deflations/flushes. The specific ratios that BackupPC uses is that if a 6MB chunk compresses to less than 64K then a flush will be done.</p>
2448<p>BackupPC watches how efficiently a file is compressing. If a big file1832
2449has very high compression (meaning it will use too much memory when it1833<p>Back to the example of the 200MB file of 0x0 bytes. Adding flushes every 6MB adds only 200 or so bytes to the 200K output. So the storage cost of flushing is negligible.</p>
2450is inflated), BackupPC calls the <code>flush()</code> method, which gracefully1834
2451completes the current compression. BackupPC then starts another1835<p>To easily decompress a BackupPC compressed file, the script BackupPC_zcat can be found in __INSTALLDIR__/bin. For each file name argument it inflates the file and writes it to stdout.</p>
2452deflate and simply appends the output file. So the BackupPC compressed1836
2453file format is one or more concatenated deflations/flushes. The specific1837<h2 id="Rsync-checksum-caching">Rsync checksum caching</h2>
2454ratios that BackupPC uses is that if a 6MB chunk compresses to less1838
2455than 64K then a flush will be done.</p>1839<p>An incremental backup with rsync compares attributes on the client with the last full backup. Any files with identical attributes are skipped. A full backup with rsync sets the --ignore-times option, which causes every file to be examined independent of attributes.</p>
2456<p>Back to the example of the 200MB file of 0x0 bytes. Adding flushes1840
2457every 6MB adds only 200 or so bytes to the 200K output. So the1841<p>Each file is examined by generating block checksums (default 2K blocks) on the receiving side (that&#39;s the BackupPC side), sending those checksums to the client, where the remote rsync matches those checksums with the corresponding file. The matching blocks and new data is sent back, allowing the client file to be reassembled. A checksum for the entire file is sent to as an extra check the the reconstructed file is correct.</p>
2458storage cost of flushing is negligible.</p>1842
2459<p>To easily decompress a BackupPC compressed file, the script
2460BackupPC_zcat can be found in __INSTALLDIR__/bin. For each
2461file name argument it inflates the file and writes it to stdout.</p>
2462<p>
2463</p>
2464<h2><a name="rsync_checksum_caching">Rsync checksum caching</a></h2>
2465<p>An incremental backup with rsync compares attributes on the client
2466with the last full backup. Any files with identical attributes
2467are skipped. A full backup with rsync sets the --ignore-times
2468option, which causes every file to be examined independent of
2469attributes.</p>
2470<p>Each file is examined by generating block checksums (default 2K
2471blocks) on the receiving side (that's the BackupPC side), sending
2472those checksums to the client, where the remote rsync matches those
2473checksums with the corresponding file. The matching blocks and new
2474data is sent back, allowing the client file to be reassembled.
2475A checksum for the entire file is sent to as an extra check the
2476the reconstructed file is correct.</p>
2477<p>This results in significant disk IO and computation for BackupPC:
2478every file in a full backup, or any file with non-matching attributes
2479in an incremental backup, needs to be uncompressed, block checksums
2480computed and sent. Then the receiving side reassembles the file and
2481has to verify the whole-file checksum. Even if the file is identical,
2482prior to 2.1.0, BackupPC had to read and uncompress the file twice,
2483once to compute the block checksums and later to verify the whole-file
2484checksum.</p>
2485<p>Starting in 2.1.0, BackupPC supports optional checksum caching,
2486which means the block and file checksums only need to be computed
2487once for each file. This results in a significant performance
2488improvement. This only works for compressed pool files.
2489It is enabled by adding</p>
2490<pre>
2491 '--checksum-seed=32761',</pre>
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches