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
1=== modified file 'ChangeLog' (properties changed: +x to -x)
2--- ChangeLog 2011-09-19 00:55:51 +0000
3+++ ChangeLog 2014-01-06 14:04:46 +0000
4@@ -11,13 +11,79 @@
5 #
6 #========================================================================
7 #
8-# Version 3.2.1, released 24 Apr 2011.
9+# Version 3.3.0, released 14 Apr 2013.
10 #
11 # See http://backuppc.sourceforge.net.
12 #
13 #========================================================================
14
15 #------------------------------------------------------------------------
16+# Version 3.3.0, 14 Apr 2013
17+#------------------------------------------------------------------------
18+
19+* Changed restore file name from restore.{zip|tar} to restore_$host_YYYY-MM-DD.{zip|tar},
20+ where the date is the start date of the backup. Originally suggested by Brad Alexander,
21+ with a healthy debate among Les, Holger, Jeffrey, Adam, Carl and others.
22+
23+* Changed the timeStamp2 function in lib/BackupPC/CGI/Lib.pm so that times more than 330
24+ days ago also include the year. More recent times continue to use just the day of month
25+ and month.
26+
27+* Made the directory path display (when browsing backups or history) a sequence of links,
28+ allowing any parent directory to be quick selected.
29+
30+* Added Japanese language file lib/BackupPC/Lang/ja.pm submitted by Rikiya
31+ Yamamoto.
32+
33+* Added Ukrainian language file lib/BackupPC/Lang/uk.pm submitted by Serhiy Yakimchuck.
34+
35+* Added Russian language file lib/BackupPC/Lang/ru.pm submitted by Sergei Butakov.
36+
37+* Patch from Alexander Moisseev that fixed file name encodings in zip files.
38+ The default charset is now utf8. Added a menu option to override the codepage.
39+
40+* Removed -N option from smbclient command in conf/config.pl to remain compatible
41+ with more recent versions (3.2.3 and later) of smbclient. Reported and discussed
42+ by various people on the mail list, most recently by Jeff Boyce, Les Mikesell and
43+ Holger Parplies. Alexander Moisseev also submitted a patch.
44+
45+ Using smbclient >= 3.2.3 with the -N option will give a "tree connect failed:
46+ NT_STATUS_ACCESS_DENIED" error.
47+
48+* Reapplied a patch from Tyler Wagner for lib/BackupPC/CGI/HostInfo.pl so that
49+ empty email status info doesn't appear. Somehow this missed 3.2.1.
50+
51+* Fixed check on $parfile in bin/BackupPC_archiveHost since it is numeric.
52+ Fix submitted by Tim Massey.
53+
54+* Ensure $num is numeric in lib/BackupPC/CGI/View.pm error message
55+ to avoid XSS attack. Report and patch by Jamie Strandboge.
56+
57+* Ensure $num and $share in lib/BackupPC/CGI/RestoreFile.pm error messages
58+ are escaped, to avoid XSS vulnerability. Report and patch by Jamie Strandboge.
59+ Also added some additional error checking and tweaked the handling of the
60+ invalid number error message.
61+
62+* Fixed qw(...) deprecated syntax warnings in lib/BackupPC/Storage/Text.pm
63+ and lib/BackupPC/Lib.pm. Patch supplied by Juergen Harms. Also got a
64+ patch from Alexander Moisseev and report from Richard Shaw.
65+
66+* Fixed error in bin/BackupPC_sendEmail that caused accumulation of
67+ per-host errors in the admin email to be skipped if a host's user
68+ is not defined. Reported by Marco Dalla Via.
69+
70+* Fixed lib/BackupPC/CGI/RSS.pm so that the base_url is correct for https.
71+ Report and fix by Samuel Monsarrat.
72+
73+* Added more careful checking that IO::Dirent returns valid inodes and file types.
74+ Suggested by Daniel Harvey.
75+
76+* Removed redundant setting of $Lang{CfgEdit_Title_Other} from all the Lang files.
77+
78+* Applied couple of fixes to Lib.pm suggested by Jeffrey Kosowsky for special case of where
79+ configuration commands are fragments of perl code.
80+
81+#------------------------------------------------------------------------
82 # Version 3.2.1, 24 Apr 2011
83 #------------------------------------------------------------------------
84
85
86=== modified file 'LICENSE' (properties changed: +x to -x)
87=== modified file 'README' (properties changed: +x to -x)
88--- README 2011-09-19 00:55:51 +0000
89+++ README 2014-01-06 14:04:46 +0000
90@@ -1,11 +1,11 @@
91
92 BackupPC
93
94- Version 3.2.1
95-
96- 24 Apr 2011
97-
98- Copyright (C) 2001-2010 Craig Barratt. All rights reserved.
99+ Version 3.3.0
100+
101+ 14 Apr 2013
102+
103+ Copyright (C) 2001-2013 Craig Barratt. All rights reserved.
104
105 This program is free software; you can redistribute it and/or
106 modify it under the terms of the GNU General Public License.
107@@ -28,8 +28,8 @@
108
109 To install BackupPC run these commands as root:
110
111- tar zxf BackupPC-3.2.1.tar.gz
112- cd BackupPC-3.2.1
113+ tar zxf BackupPC-3.3.0.tar.gz
114+ cd BackupPC-3.3.0
115 perl configure.pl
116
117 This will automatically determine some system information and prompt you
118
119=== modified file 'bin/BackupPC'
120--- bin/BackupPC 2011-09-19 00:55:51 +0000
121+++ bin/BackupPC 2014-01-06 14:04:46 +0000
122@@ -29,7 +29,7 @@
123 # Craig Barratt <cbarratt@users.sourceforge.net>
124 #
125 # COPYRIGHT
126-# Copyright (C) 2001-2009 Craig Barratt
127+# Copyright (C) 2001-2013 Craig Barratt
128 #
129 # This program is free software; you can redistribute it and/or modify
130 # it under the terms of the GNU General Public License as published by
131@@ -47,7 +47,7 @@
132 #
133 #========================================================================
134 #
135-# Version 3.2.1, released 24 Apr 2011.
136+# Version 3.3.0, released 14 Apr 2013.
137 #
138 # See http://backuppc.sourceforge.net.
139 #
140
141=== modified file 'bin/BackupPC_archive'
142--- bin/BackupPC_archive 2011-09-19 00:55:51 +0000
143+++ bin/BackupPC_archive 2014-01-06 14:04:46 +0000
144@@ -11,7 +11,7 @@
145 # Josh Marshall
146 #
147 # COPYRIGHT
148-# Copyright (C) 2001-2009 Craig Barratt
149+# Copyright (C) 2001-2013 Craig Barratt
150 #
151 # This program is free software; you can redistribute it and/or modify
152 # it under the terms of the GNU General Public License as published by
153@@ -29,7 +29,7 @@
154 #
155 #========================================================================
156 #
157-# Version 3.2.1, released 24 Apr 2011.
158+# Version 3.3.0, released 14 Apr 2013.
159 #
160 # See http://backuppc.sourceforge.net.
161 #
162
163=== modified file 'bin/BackupPC_archiveHost'
164--- bin/BackupPC_archiveHost 2011-09-19 00:55:51 +0000
165+++ bin/BackupPC_archiveHost 2014-01-06 14:04:46 +0000
166@@ -20,7 +20,7 @@
167 # Josh Marshall
168 #
169 # COPYRIGHT
170-# Copyright (C) 2001-2009 Craig Barratt
171+# Copyright (C) 2001-2013 Craig Barratt
172 #
173 # This program is free software; you can redistribute it and/or modify
174 # it under the terms of the GNU General Public License as published by
175@@ -38,7 +38,7 @@
176 #
177 #========================================================================
178 #
179-# Version 3.2.1, released 24 Apr 2011.
180+# Version 3.3.0, released 14 Apr 2013.
181 #
182 # See http://backuppc.sourceforge.net.
183 #
184@@ -154,7 +154,7 @@
185 # ie: not a tape device).
186 #
187 if ( -d $outLoc && -x $parPath ) {
188- if ( length($parfile) ) {
189+ if ( length($parfile) && $parfile != 0 ) {
190 print("Running $parPath to create parity files\n");
191 my $parCmd = "$parPath c -r$parfile $outLocE/$host.$bkupNum.tar$fileExt.par2 $outLocE/$host.$bkupNum.tar$fileExt*";
192 $ret = system($parCmd);
193
194=== modified file 'bin/BackupPC_archiveStart'
195--- bin/BackupPC_archiveStart 2011-09-19 00:55:51 +0000
196+++ bin/BackupPC_archiveStart 2014-01-06 14:04:46 +0000
197@@ -17,7 +17,7 @@
198 # Craig Barratt <cbarratt@users.sourceforge.net>
199 #
200 # COPYRIGHT
201-# Copyright (C) 2007-2009 Craig Barratt
202+# Copyright (C) 2007-2013 Craig Barratt
203 #
204 # This program is free software; you can redistribute it and/or modify
205 # it under the terms of the GNU General Public License as published by
206@@ -35,7 +35,7 @@
207 #
208 #========================================================================
209 #
210-# Version 3.2.1, released 24 Apr 2011.
211+# Version 3.3.0, released 14 Apr 2013.
212 #
213 # See http://backuppc.sourceforge.net.
214 #
215
216=== modified file 'bin/BackupPC_attribPrint'
217--- bin/BackupPC_attribPrint 2011-09-19 00:55:51 +0000
218+++ bin/BackupPC_attribPrint 2014-01-06 14:04:46 +0000
219@@ -13,7 +13,7 @@
220 # Craig Barratt <cbarratt@users.sourceforge.net>
221 #
222 # COPYRIGHT
223-# Copyright (C) 2005-2009 Craig Barratt
224+# Copyright (C) 2005-2013 Craig Barratt
225 #
226 # This program is free software; you can redistribute it and/or modify
227 # it under the terms of the GNU General Public License as published by
228@@ -31,7 +31,7 @@
229 #
230 #========================================================================
231 #
232-# Version 3.2.1, released 24 Apr 2011.
233+# Version 3.3.0, released 14 Apr 2013.
234 #
235 # See http://backuppc.sourceforge.net.
236 #
237
238=== modified file 'bin/BackupPC_dump'
239--- bin/BackupPC_dump 2011-09-19 00:55:51 +0000
240+++ bin/BackupPC_dump 2014-01-06 14:04:46 +0000
241@@ -59,7 +59,7 @@
242 # Craig Barratt <cbarratt@users.sourceforge.net>
243 #
244 # COPYRIGHT
245-# Copyright (C) 2001-2009 Craig Barratt
246+# Copyright (C) 2001-2013 Craig Barratt
247 #
248 # This program is free software; you can redistribute it and/or modify
249 # it under the terms of the GNU General Public License as published by
250@@ -77,7 +77,7 @@
251 #
252 #========================================================================
253 #
254-# Version 3.2.1, released 24 Apr 2011.
255+# Version 3.3.0, released 14 Apr 2013.
256 #
257 # See http://backuppc.sourceforge.net.
258 #
259@@ -1066,7 +1066,7 @@
260 # Send ALRMs to BackupPC_tarExtract if we are using it
261 #
262 if ( $tarPid > 0 ) {
263- kill($bpc->sigName2num("ARLM"), $tarPid);
264+ kill($bpc->sigName2num("ALRM"), $tarPid);
265 }
266
267 #
268
269=== modified file 'bin/BackupPC_fixupBackupSummary'
270--- bin/BackupPC_fixupBackupSummary 2011-09-19 00:55:51 +0000
271+++ bin/BackupPC_fixupBackupSummary 2014-01-06 14:04:46 +0000
272@@ -12,7 +12,7 @@
273 # Craig Barratt <cbarratt@users.sourceforge.net>
274 #
275 # COPYRIGHT
276-# Copyright (C) 2005-2009 Craig Barratt
277+# Copyright (C) 2005-2013 Craig Barratt
278 #
279 # This program is free software; you can redistribute it and/or modify
280 # it under the terms of the GNU General Public License as published by
281@@ -30,7 +30,7 @@
282 #
283 #========================================================================
284 #
285-# Version 3.2.1, released 24 Apr 2011.
286+# Version 3.3.0, released 14 Apr 2013.
287 #
288 # See http://backuppc.sourceforge.net.
289 #
290
291=== modified file 'bin/BackupPC_link'
292--- bin/BackupPC_link 2011-09-19 00:55:51 +0000
293+++ bin/BackupPC_link 2014-01-06 14:04:46 +0000
294@@ -21,7 +21,7 @@
295 # Craig Barratt <cbarratt@users.sourceforge.net>
296 #
297 # COPYRIGHT
298-# Copyright (C) 2001-2009 Craig Barratt
299+# Copyright (C) 2001-2013 Craig Barratt
300 #
301 # This program is free software; you can redistribute it and/or modify
302 # it under the terms of the GNU General Public License as published by
303@@ -39,7 +39,7 @@
304 #
305 #========================================================================
306 #
307-# Version 3.2.1, released 24 Apr 2011.
308+# Version 3.3.0, released 14 Apr 2013.
309 #
310 # See http://backuppc.sourceforge.net.
311 #
312
313=== modified file 'bin/BackupPC_nightly'
314--- bin/BackupPC_nightly 2011-09-19 00:55:51 +0000
315+++ bin/BackupPC_nightly 2014-01-06 14:04:46 +0000
316@@ -37,7 +37,7 @@
317 # Craig Barratt <cbarratt@users.sourceforge.net>
318 #
319 # COPYRIGHT
320-# Copyright (C) 2001-2009 Craig Barratt
321+# Copyright (C) 2001-2013 Craig Barratt
322 #
323 # This program is free software; you can redistribute it and/or modify
324 # it under the terms of the GNU General Public License as published by
325@@ -55,7 +55,7 @@
326 #
327 #========================================================================
328 #
329-# Version 3.2.1, released 24 Apr 2011.
330+# Version 3.3.0, released 14 Apr 2013.
331 #
332 # See http://backuppc.sourceforge.net.
333 #
334
335=== modified file 'bin/BackupPC_restore'
336--- bin/BackupPC_restore 2011-09-19 00:55:51 +0000
337+++ bin/BackupPC_restore 2014-01-06 14:04:46 +0000
338@@ -11,7 +11,7 @@
339 # Craig Barratt <cbarratt@users.sourceforge.net>
340 #
341 # COPYRIGHT
342-# Copyright (C) 2001-2009 Craig Barratt
343+# Copyright (C) 2001-2013 Craig Barratt
344 #
345 # This program is free software; you can redistribute it and/or modify
346 # it under the terms of the GNU General Public License as published by
347@@ -29,7 +29,7 @@
348 #
349 #========================================================================
350 #
351-# Version 3.2.1, released 24 Apr 2011.
352+# Version 3.3.0, released 14 Apr 2013.
353 #
354 # See http://backuppc.sourceforge.net.
355 #
356
357=== modified file 'bin/BackupPC_sendEmail'
358--- bin/BackupPC_sendEmail 2011-09-19 00:55:51 +0000
359+++ bin/BackupPC_sendEmail 2014-01-06 14:04:46 +0000
360@@ -13,7 +13,7 @@
361 # Craig Barratt <cbarratt@users.sourceforge.net>
362 #
363 # COPYRIGHT
364-# Copyright (C) 2001-2009 Craig Barratt
365+# Copyright (C) 2001-2013 Craig Barratt
366 #
367 # This program is free software; you can redistribute it and/or modify
368 # it under the terms of the GNU General Public License as published by
369@@ -31,7 +31,7 @@
370 #
371 #========================================================================
372 #
373-# Version 3.2.1, released 24 Apr 2011.
374+# Version 3.3.0, released 14 Apr 2013.
375 #
376 # See http://backuppc.sourceforge.net.
377 #
378@@ -186,8 +186,6 @@
379 %Conf = $bpc->Conf();
380 my $user = $Hosts->{$host}{user};
381
382- next if ( $user eq "" );
383-
384 #
385 # Accumulate host errors for the admin email below
386 #
387@@ -204,6 +202,7 @@
388 || $Conf{XferMethod} eq "archive"
389 || $Conf{BackupsDisable}
390 || $Hosts->{$host}{user} eq ""
391+ || $user eq ""
392 );
393 my @Backups = $bpc->BackupInfoRead($host);
394 my $numBackups = @Backups;
395
396=== modified file 'bin/BackupPC_serverMesg'
397--- bin/BackupPC_serverMesg 2011-09-19 00:55:51 +0000
398+++ bin/BackupPC_serverMesg 2014-01-06 14:04:46 +0000
399@@ -25,7 +25,7 @@
400 # Craig Barratt <cbarratt@users.sourceforge.net>
401 #
402 # COPYRIGHT
403-# Copyright (C) 2001-2009 Craig Barratt
404+# Copyright (C) 2001-2013 Craig Barratt
405 #
406 # This program is free software; you can redistribute it and/or modify
407 # it under the terms of the GNU General Public License as published by
408@@ -43,7 +43,7 @@
409 #
410 #========================================================================
411 #
412-# Version 3.2.1, released 24 Apr 2011.
413+# Version 3.3.0, released 14 Apr 2013.
414 #
415 # See http://backuppc.sourceforge.net.
416 #
417
418=== modified file 'bin/BackupPC_tarCreate'
419--- bin/BackupPC_tarCreate 2011-09-19 00:55:51 +0000
420+++ bin/BackupPC_tarCreate 2014-01-06 14:04:46 +0000
421@@ -37,7 +37,7 @@
422 # Craig Barratt <cbarratt@users.sourceforge.net>
423 #
424 # COPYRIGHT
425-# Copyright (C) 2001-2009 Craig Barratt
426+# Copyright (C) 2001-2013 Craig Barratt
427 #
428 # This program is free software; you can redistribute it and/or modify
429 # it under the terms of the GNU General Public License as published by
430@@ -55,7 +55,7 @@
431 #
432 #========================================================================
433 #
434-# Version 3.2.1, released 24 Apr 2011.
435+# Version 3.3.0, released 14 Apr 2013.
436 #
437 # See http://backuppc.sourceforge.net.
438 #
439
440=== modified file 'bin/BackupPC_tarExtract'
441--- bin/BackupPC_tarExtract 2011-09-19 00:55:51 +0000
442+++ bin/BackupPC_tarExtract 2014-01-06 14:04:46 +0000
443@@ -9,7 +9,7 @@
444 # Craig Barratt <cbarratt@users.sourceforge.net>
445 #
446 # COPYRIGHT
447-# Copyright (C) 2001-2009 Craig Barratt
448+# Copyright (C) 2001-2013 Craig Barratt
449 #
450 # This program is free software; you can redistribute it and/or modify
451 # it under the terms of the GNU General Public License as published by
452@@ -27,7 +27,7 @@
453 #
454 #========================================================================
455 #
456-# Version 3.2.1, released 24 Apr 2011.
457+# Version 3.3.0, released 14 Apr 2013.
458 #
459 # See http://backuppc.sourceforge.net.
460 #
461
462=== modified file 'bin/BackupPC_tarPCCopy'
463--- bin/BackupPC_tarPCCopy 2011-09-19 00:55:51 +0000
464+++ bin/BackupPC_tarPCCopy 2014-01-06 14:04:46 +0000
465@@ -20,7 +20,7 @@
466 # Craig Barratt <cbarratt@users.sourceforge.net>
467 #
468 # COPYRIGHT
469-# Copyright (C) 2005-2009 Craig Barratt
470+# Copyright (C) 2005-2013 Craig Barratt
471 #
472 # This program is free software; you can redistribute it and/or modify
473 # it under the terms of the GNU General Public License as published by
474@@ -38,7 +38,7 @@
475 #
476 #========================================================================
477 #
478-# Version 3.2.1, released 24 Apr 2011.
479+# Version 3.3.0, released 14 Apr 2013.
480 #
481 # See http://backuppc.sourceforge.net.
482 #
483
484=== modified file 'bin/BackupPC_trashClean'
485--- bin/BackupPC_trashClean 2011-09-19 00:55:51 +0000
486+++ bin/BackupPC_trashClean 2014-01-06 14:04:46 +0000
487@@ -11,7 +11,7 @@
488 # Craig Barratt <cbarratt@users.sourceforge.net>
489 #
490 # COPYRIGHT
491-# Copyright (C) 2001-2009 Craig Barratt
492+# Copyright (C) 2001-2013 Craig Barratt
493 #
494 # This program is free software; you can redistribute it and/or modify
495 # it under the terms of the GNU General Public License as published by
496@@ -29,7 +29,7 @@
497 #
498 #========================================================================
499 #
500-# Version 3.2.1, released 24 Apr 2011.
501+# Version 3.3.0, released 14 Apr 2013.
502 #
503 # See http://backuppc.sourceforge.net.
504 #
505
506=== modified file 'bin/BackupPC_zcat'
507--- bin/BackupPC_zcat 2011-09-19 00:55:51 +0000
508+++ bin/BackupPC_zcat 2014-01-06 14:04:46 +0000
509@@ -14,7 +14,7 @@
510 # Craig Barratt <cbarratt@users.sourceforge.net>
511 #
512 # COPYRIGHT
513-# Copyright (C) 2001-2009 Craig Barratt
514+# Copyright (C) 2001-2013 Craig Barratt
515 #
516 # This program is free software; you can redistribute it and/or modify
517 # it under the terms of the GNU General Public License as published by
518@@ -32,7 +32,7 @@
519 #
520 #========================================================================
521 #
522-# Version 3.2.1, released 24 Apr 2011.
523+# Version 3.3.0, released 14 Apr 2013.
524 #
525 # See http://backuppc.sourceforge.net.
526 #
527
528=== modified file 'bin/BackupPC_zipCreate'
529--- bin/BackupPC_zipCreate 2011-09-19 00:55:51 +0000
530+++ bin/BackupPC_zipCreate 2014-01-06 14:04:46 +0000
531@@ -21,7 +21,7 @@
532 # -r pathRemove path prefix that will be replaced with pathAdd
533 # -p pathAdd new path prefix
534 # -c level compression level (default is 0, no compression)
535-# -e charset charset for encoding file names (default: cp1252)
536+# -e charset charset for encoding file names (default: utf8)
537 #
538 # The -h, -n and -s options specify which dump is used to generate
539 # the zip archive. The -r and -p options can be used to relocate
540@@ -33,7 +33,7 @@
541 # Based on Backup_tarCreate by Craig Barratt <cbarratt@users.sourceforge.net>
542 #
543 # COPYRIGHT
544-# Copyright (C) 2002-2009 Craig Barratt and Guillaume Filion
545+# Copyright (C) 2002-2013 Craig Barratt and Guillaume Filion
546 #
547 # This program is free software; you can redistribute it and/or modify
548 # it under the terms of the GNU General Public License as published by
549@@ -51,7 +51,7 @@
550 #
551 #========================================================================
552 #
553-# Version 3.2.1, released 24 Apr 2011.
554+# Version 3.3.0, released 14 Apr 2013.
555 #
556 # See http://backuppc.sourceforge.net.
557 #
558@@ -93,7 +93,7 @@
559 -r pathRemove path prefix that will be replaced with pathAdd
560 -p pathAdd new path prefix
561 -c level compression level (default is 0, no compression)
562- -e charset charset for encoding file names (default: cp1252)
563+ -e charset charset for encoding file names (default: utf8)
564 EOF
565 exit(1);
566 }
567@@ -135,7 +135,7 @@
568 exit(1);
569 }
570
571-my $Charset = "cp1252";
572+my $Charset = ""; # default: utf8
573 $Charset = $opts{e} if ( $opts{e} ne "" );
574
575 my $PathRemove = $1 if ( $opts{r} =~ /(.+)/ );
576@@ -311,6 +311,14 @@
577 # Specify the compression level for this member
578 $zipmember->desiredCompressionLevel($compLevel) if ($compLevel =~ /[0-9]/);
579
580+ if ( $Charset =~ /^(?:utf[-_]?8)?$/i ) {
581+ # Set general purpose bit 11 for UTF-8 code page
582+ $zipmember->{bitFlag} = $zipmember->{bitFlag} | 0x0800 ;
583+ } elsif ( $Charset =~ /^cp(?:437|720|737|775|85[02578]|86[069]|874|93[26]|949|950)$/i ) {
584+ # Set "version made by" field to 0 (MS-DOS) for OEM code pages
585+ $zipmember->fileAttributeFormat('FA_MSDOS');
586+ }
587+
588 # Finally Zip the member
589 $zipfh->addMember($zipmember);
590 }
591
592=== modified file 'cgi-bin/BackupPC_Admin'
593--- cgi-bin/BackupPC_Admin 2011-09-19 00:55:51 +0000
594+++ cgi-bin/BackupPC_Admin 2014-01-06 14:04:46 +0000
595@@ -21,7 +21,7 @@
596 # Craig Barratt <cbarratt@users.sourceforge.net>
597 #
598 # COPYRIGHT
599-# Copyright (C) 2001-2009 Craig Barratt
600+# Copyright (C) 2001-2013 Craig Barratt
601 #
602 # This program is free software; you can redistribute it and/or modify
603 # it under the terms of the GNU General Public License as published by
604@@ -39,7 +39,7 @@
605 #
606 #========================================================================
607 #
608-# Version 3.2.1, released 24 Apr 2011.
609+# Version 3.3.0, released 14 Apr 2013.
610 #
611 # See http://backuppc.sourceforge.net.
612 #
613
614=== modified file 'conf/BackupPC_stnd.css'
615--- conf/BackupPC_stnd.css 2011-09-19 00:55:51 +0000
616+++ conf/BackupPC_stnd.css 2014-01-06 14:04:46 +0000
617@@ -1,7 +1,7 @@
618 /*
619 * BackupPC standard CSS definitions
620 *
621- * Version 3.2.1, released 24 Apr 2011.
622+ * Version 3.3.0, released 14 Apr 2013.
623 *
624 * See http://backuppc.sourceforge.net.
625 *
626@@ -9,7 +9,7 @@
627 * Craig Barratt <cbarratt@users.sourceforge.net>
628 *
629 * COPYRIGHT
630- * Copyright (C) 2004-2009 Craig Barratt
631+ * Copyright (C) 2004-2013 Craig Barratt
632 */
633
634 body {
635
636=== modified file 'conf/BackupPC_stnd_orig.css'
637--- conf/BackupPC_stnd_orig.css 2011-09-19 00:55:51 +0000
638+++ conf/BackupPC_stnd_orig.css 2014-01-06 14:04:46 +0000
639@@ -1,7 +1,7 @@
640 /*
641 * BackupPC standard CSS definitions
642 *
643- * Version 3.2.1, released 24 Apr 2011.
644+ * Version 3.3.0, released 14 Apr 2013.
645 *
646 * See http://backuppc.sourceforge.net.
647 *
648@@ -9,7 +9,7 @@
649 * Craig Barratt <cbarratt@users.sourceforge.net>
650 *
651 * COPYRIGHT
652- * Copyright (C) 2004-2009 Craig Barratt
653+ * Copyright (C) 2004-2013 Craig Barratt
654 */
655
656 body {
657
658=== modified file 'conf/config.pl'
659--- conf/config.pl 2011-03-07 11:35:50 +0000
660+++ conf/config.pl 2014-01-06 14:04:46 +0000
661@@ -29,7 +29,7 @@
662 # Craig Barratt <cbarratt@users.sourceforge.net>
663 #
664 # COPYRIGHT
665-# Copyright (C) 2001-2009 Craig Barratt
666+# Copyright (C) 2001-2013 Craig Barratt
667 #
668 # See http://backuppc.sourceforge.net.
669 #
670@@ -976,7 +976,7 @@
671 # redirection and pipes; put that in a script if you need it.
672 #
673 $Conf{SmbClientFullCmd} = '$smbClientPath \\\\$host\\$shareName'
674- . ' $I_option -U $userName -E -N -d 1'
675+ . ' $I_option -U $userName -E -d 1'
676 . ' -c tarmode\\ full -Tc$X_option - $fileList';
677
678 #
679@@ -990,7 +990,7 @@
680 # redirection and pipes; put that in a script if you need it.
681 #
682 $Conf{SmbClientIncrCmd} = '$smbClientPath \\\\$host\\$shareName'
683- . ' $I_option -U $userName -E -N -d 1'
684+ . ' $I_option -U $userName -E -d 1'
685 . ' -c tarmode\\ full -TcN$X_option $timeStampFile - $fileList';
686
687 #
688@@ -1008,7 +1008,7 @@
689 # redirection and pipes; put that in a script if you need it.
690 #
691 $Conf{SmbClientRestoreCmd} = '$smbClientPath \\\\$host\\$shareName'
692- . ' $I_option -U $userName -E -N -d 1'
693+ . ' $I_option -U $userName -E -d 1'
694 . ' -c tarmode\\ full -Tx -';
695
696 ###########################################################################
697@@ -1047,11 +1047,14 @@
698 $Conf{TarShareName} = '/';
699
700 #
701-# Full command to run tar on the client. GNU tar is required. You will
702+# Command to run tar on the client. GNU tar is required. You will
703 # need to fill in the correct paths for ssh2 on the local host (server)
704 # and GNU tar on the client. Security caution: normal users should not
705 # allowed to write to these executable files or directories.
706 #
707+# $Conf{TarClientCmd} is appended with with either $Conf{TarFullArgs} or
708+# $Conf{TarIncrArgs} to create the final command that is run.
709+#
710 # See the documentation for more information about setting up ssh2 keys.
711 #
712 # If you plan to use NFS then tar just runs locally and ssh2 is not needed.
713
714=== modified file 'conf/hosts'
715--- conf/hosts 2010-11-21 14:59:53 +0000
716+++ conf/hosts 2014-01-06 14:04:46 +0000
717@@ -41,7 +41,7 @@
718 # Craig Barratt <craig@arraycomm.com>
719 #
720 # COPYRIGHT
721-# Copyright (C) 2001-2009 Craig Barratt
722+# Copyright (C) 2001-2013 Craig Barratt
723 #
724 # See http://backuppc.sourceforge.net.
725 #
726
727=== modified file 'configure.pl' (properties changed: +x to -x)
728--- configure.pl 2011-09-19 00:55:51 +0000
729+++ configure.pl 2014-01-06 14:04:46 +0000
730@@ -19,7 +19,7 @@
731 # Craig Barratt <cbarratt@users.sourceforge.net>
732 #
733 # COPYRIGHT
734-# Copyright (C) 2001-2010 Craig Barratt
735+# Copyright (C) 2001-2013 Craig Barratt
736 #
737 # This program is free software; you can redistribute it and/or modify
738 # it under the terms of the GNU General Public License as published by
739@@ -37,7 +37,7 @@
740 #
741 #========================================================================
742 #
743-# Version 3.2.1, released 24 Apr 2011.
744+# Version 3.3.0, released 14 Apr 2013.
745 #
746 # See http://backuppc.sourceforge.net.
747 #
748@@ -72,7 +72,7 @@
749 BackupPC distribution. This probably means you did not cd to the
750 unpacked BackupPC distribution before running configure.pl, eg:
751
752- cd BackupPC-3.2.1
753+ cd BackupPC-3.3.0
754 ./configure.pl
755
756 Please try again.
757@@ -642,9 +642,12 @@
758 lib/BackupPC/Lang/es.pm
759 lib/BackupPC/Lang/fr.pm
760 lib/BackupPC/Lang/it.pm
761+ lib/BackupPC/Lang/ja.pm
762 lib/BackupPC/Lang/nl.pm
763 lib/BackupPC/Lang/pl.pm
764 lib/BackupPC/Lang/pt_br.pm
765+ lib/BackupPC/Lang/ru.pm
766+ lib/BackupPC/Lang/uk.pm
767 lib/BackupPC/Lang/zh_CN.pm
768 lib/BackupPC/Storage/Text.pm
769 lib/BackupPC/Xfer.pm
770@@ -673,7 +676,7 @@
771 #
772 # Install new CSS file, making a backup copy if necessary
773 #
774- my $cssBackup = "$DestDir$Conf{CgiImageDir}/BackupPC_stnd.css.pre-3.2.1";
775+ my $cssBackup = "$DestDir$Conf{CgiImageDir}/BackupPC_stnd.css.pre-3.3.0";
776 if ( -f "$DestDir$Conf{CgiImageDir}/BackupPC_stnd.css" && !-f $cssBackup ) {
777 rename("$DestDir$Conf{CgiImageDir}/BackupPC_stnd.css", $cssBackup);
778 }
779@@ -893,7 +896,7 @@
780 #
781 # Now backup and write the config file
782 #
783-my $confCopy = "$dest.pre-3.2.1";
784+my $confCopy = "$dest.pre-3.3.0";
785 if ( -f $dest && !-f $confCopy ) {
786 #
787 # Make copy of config file, preserving ownership and modes
788
789=== modified file 'debian/README.Debian'
790--- debian/README.Debian 2011-01-14 11:02:06 +0000
791+++ debian/README.Debian 2014-01-06 14:04:46 +0000
792@@ -105,5 +105,15 @@
793 - Data directory is /var/lib/backuppc/
794
795
796+/etc/default/backuppc
797+---------------------
798+
799+You can change the nice value by adding a line like 'NICE=10' to
800+/etc/default/backuppc
801+
802+
803+
804+
805+
806
807 -- Ludovic Drolez <ldrolez@debian.org>, Mon, 16 Jun 2004 10:43:48 +0200
808
809=== added file 'debian/backuppc.default'
810--- debian/backuppc.default 1970-01-01 00:00:00 +0000
811+++ debian/backuppc.default 2014-01-06 14:04:46 +0000
812@@ -0,0 +1,2 @@
813+# Nice BackupPC daemon value
814+NICE=0
815
816=== modified file 'debian/backuppc.init'
817--- debian/backuppc.init 2013-01-06 03:04:32 +0000
818+++ debian/backuppc.init 2014-01-06 14:04:46 +0000
819@@ -23,6 +23,9 @@
820 DATADIR=/var/lib/backuppc
821 USER=backuppc
822 NICE=0
823+
824+test -f /etc/default/backuppc && . /etc/default/backuppc
825+
826 #
827 NAME=backuppc
828 DAEMON=BackupPC
829
830=== modified file 'debian/backuppc.templates'
831--- debian/backuppc.templates 2009-12-18 10:44:41 +0000
832+++ debian/backuppc.templates 2014-01-06 14:04:46 +0000
833@@ -11,7 +11,7 @@
834 Template: backuppc/reconfigure-webserver
835 Type: multiselect
836 Choices: apache2
837-Default:
838+Default: apache2
839 _Description: Which web server would you like to reconfigure automatically:
840 BackupPC supports any web server with CGI enabled, but this automatic
841 configuration process only supports Apache.
842
843=== modified file 'debian/changelog'
844--- debian/changelog 2013-12-20 02:17:32 +0000
845+++ debian/changelog 2014-01-06 14:04:46 +0000
846@@ -1,3 +1,53 @@
847+backuppc (3.3.0-1ubuntu1) trusty-proposed; urgency=low
848+
849+ * Merge from Debian unstable. Remaining changes:
850+ - debian/backuppc.init, debian/rules, debian/postinst: Do not call init
851+ script on shutdown and reboot (TearDown) (Debian #488660).
852+ - debian/control:
853+ + Remove estraneous libtime-modules-perl (Debian #734356).
854+ + Depend on default-mta | mail-transport-agent, instead of enumerating a
855+ long list of alternative MTAs.
856+
857+ -- Louis Bouchard <louis.bouchard@ubuntu.com> Mon, 06 Jan 2014 13:26:25 +0100
858+
859+backuppc (3.3.0-1) unstable; urgency=low
860+
861+ * New upstream release. Closes: #716824
862+ * Fix Typo in kill signal name (ALRM vs ARLM). Closes: #698441
863+ * Enable Apache2 (2.4) configuration by default. Closes: #718550 #710956
864+
865+ -- Ludovic Drolez <ldrolez@debian.org> Thu, 12 Sep 2013 6:13:50 +0200
866+
867+backuppc (3.2.1-5.2) unstable; urgency=low
868+
869+ * Non-maintainer upload.
870+ * Patch BackupPC.pod for POD errors with Perl 5.18
871+ pod2man has become more strict with perl 5.18. The applied patch
872+ converts the non-7-bit clean character into UTF-8 and declares the
873+ file's encoding as such.
874+ Thanks to Dominic Hargreaves <dom@earth.li> (Closes: #719827)
875+
876+ -- Salvatore Bonaccorso <carnil@debian.org> Sat, 24 Aug 2013 15:29:57 +0200
877+
878+backuppc (3.2.1-5.1) unstable; urgency=low
879+
880+ * Non-maintainer upload.
881+ * Do not ship /etc/backuppc/config.pl as a conffile; it is handled
882+ by ucf already (Closes: #706315)
883+
884+ -- Jonathan Wiltshire <jmw@tiger-computing.co.uk> Fri, 07 Jun 2013 11:42:08 +0100
885+
886+backuppc (3.2.1-5) unstable; urgency=low
887+
888+ * Added libtime-modules-perl dependency. Closes: #525395
889+ * Remove /var/lib/backuppc/pc/localhost if it's empty
890+ Closes: #672372
891+ * Added stuff to support Apache 2.4. Closes: #669765
892+ * Added NICE support in /etc/default/backuppc. Closes: #639102
893+ * Changed the default display date format. Closes: #663975
894+
895+ -- Ludovic Drolez <ldrolez@debian.org> Thu, 03 Jan 2013 17:27:35 +0100
896+
897 backuppc (3.2.1-4ubuntu2) trusty; urgency=medium
898
899 * Specify pod2man encoding.
900
901=== modified file 'debian/patches/config.pl.diff'
902--- debian/patches/config.pl.diff 2011-03-07 11:35:50 +0000
903+++ debian/patches/config.pl.diff 2014-01-06 14:04:46 +0000
904@@ -21,33 +21,6 @@
905 $Conf{CatPath} = '/bin/cat';
906 $Conf{GzipPath} = '/bin/gzip';
907 $Conf{Bzip2Path} = '/bin/bzip2';
908-@@ -952,7 +952,7 @@
909- # redirection and pipes; put that in a script if you need it.
910- #
911- $Conf{SmbClientFullCmd} = '$smbClientPath \\\\$host\\$shareName'
912-- . ' $I_option -U $userName -E -N -d 1'
913-+ . ' $I_option -U $userName -E -d 1'
914- . ' -c tarmode\\ full -Tc$X_option - $fileList';
915-
916- #
917-@@ -966,7 +966,7 @@
918- # redirection and pipes; put that in a script if you need it.
919- #
920- $Conf{SmbClientIncrCmd} = '$smbClientPath \\\\$host\\$shareName'
921-- . ' $I_option -U $userName -E -N -d 1'
922-+ . ' $I_option -U $userName -E -d 1'
923- . ' -c tarmode\\ full -TcN$X_option $timeStampFile - $fileList';
924-
925- #
926-@@ -984,7 +984,7 @@
927- # redirection and pipes; put that in a script if you need it.
928- #
929- $Conf{SmbClientRestoreCmd} = '$smbClientPath \\\\$host\\$shareName'
930-- . ' $I_option -U $userName -E -N -d 1'
931-+ . ' $I_option -U $userName -E -d 1'
932- . ' -c tarmode\\ full -Tx -';
933-
934- #
935 @@ -1462,7 +1462,7 @@
936 # Full path for ssh. Security caution: normal users should not
937 # allowed to write to this file or directory.
938
939=== modified file 'debian/postinst'
940--- debian/postinst 2011-06-15 16:28:41 +0000
941+++ debian/postinst 2014-01-06 14:04:46 +0000
942@@ -52,6 +52,19 @@
943 > /etc/$webserver/httpd.conf
944 fi
945 # add new links
946+
947+ # Apache 2.4
948+ if [ -d /etc/$webserver/conf-available -a ! -f /etc/$webserver/conf-available/backuppc.conf -a ! -h /etc/$webserver/conf-available/backuppc.conf ]; then
949+ ln -s /etc/backuppc/apache.conf /etc/$webserver/conf-available/backuppc.conf
950+ [ -f /etc/$webserver/conf.d/backuppc.conf ] && rm /etc/$webserver/conf.d/backuppc.conf
951+
952+ if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
953+ . /usr/share/apache2/apache2-maintscript-helper
954+ apache2_invoke enconf backuppc.conf
955+ fi
956+ fi
957+
958+ # Apache < 2.4
959 newfile=false
960 if [ -d /etc/$webserver/conf.d -a ! -f /etc/$webserver/conf.d/backuppc.conf -a ! -h /etc/$webserver/conf.d/backuppc.conf ]; then
961 ln -s /etc/backuppc/apache.conf /etc/$webserver/conf.d/backuppc.conf
962@@ -59,10 +72,10 @@
963 if [ "$webservers_rst" = "true" ]; then
964 # restart
965 if [ -x /usr/sbin/invoke-rc.d ]; then
966- invoke-rc.d $webserver restart
967+ invoke-rc.d $webserver reload
968 else
969- /etc/init.d/$webserver restart
970- fi
971+ /etc/init.d/$webserver reload
972+ fi
973 fi
974 fi
975 ;;
976
977=== modified file 'debian/postrm'
978--- debian/postrm 2011-06-15 16:28:41 +0000
979+++ debian/postrm 2014-01-06 14:04:46 +0000
980@@ -43,9 +43,9 @@
981 if [ "$webservers_rst" = "true" ]; then
982 # restart
983 if [ -x /usr/sbin/invoke-rc.d ]; then
984- invoke-rc.d $webserver restart
985+ invoke-rc.d $webserver reload
986 else
987- /etc/init.d/$webserver restart
988+ /etc/init.d/$webserver reload
989 fi
990 fi
991 fi
992@@ -54,6 +54,14 @@
993 done
994 fi
995
996+ if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
997+ . /usr/share/apache2/apache2-maintscript-helper
998+ apache2_invoke disconf backuppc.conf
999+ fi
1000+
1001+ if [ -h /etc/apache2/conf-available/backuppc.conf ]; then
1002+ rm -f /etc/apache2/conf-available/backuppc.conf
1003+ fi
1004
1005 dpkg-statoverride --remove --force /usr/share/backuppc/cgi-bin/index.cgi
1006 dpkg-statoverride --remove --force /usr/lib/backuppc/cgi-bin/index.cgi
1007@@ -61,6 +69,7 @@
1008 if [ -x "/usr/bin/ucf" ]; then
1009 ucf --purge /etc/backuppc/config.pl
1010 fi
1011+ rmdir --ignore-fail-on-non-empty /var/lib/backuppc/pc/localhost/
1012
1013 ;;
1014 remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
1015
1016=== modified file 'debian/rules'
1017--- debian/rules 2011-06-15 16:28:41 +0000
1018+++ debian/rules 2014-01-06 14:04:46 +0000
1019@@ -51,6 +51,7 @@
1020 dh_installdirs
1021
1022 # Add here commands to install the package into debian/backuppc.
1023+ chmod 755 ./configure.pl
1024 ./configure.pl --batch --no-fhs --hostname XXXXXX --uid-ignore \
1025 --install-dir /usr/share/backuppc --dest-dir $(CURDIR)/debian/backuppc/ \
1026 --data-dir /var/lib/backuppc --cgi-dir /usr/share/backuppc/cgi-bin \
1027@@ -73,6 +74,7 @@
1028 (cd debian/backuppc/usr/share/backuppc/cgi-bin; ln -s ../image; ln -s /usr/lib/backuppc/cgi-bin/index.cgi )
1029 patch --no-backup-if-mismatch -p0 < debian/patches/config.pl.diff
1030 install --mode=644 debian/backuppc/etc/backuppc/config.pl debian/backuppc/usr/share/backuppc/conf
1031+ rm -rf debian/backuppc/etc/backuppc/config.pl
1032
1033 # Build architecture-independent files here.
1034 binary-indep: build install
1035
1036=== modified file 'doc/BackupPC.html'
1037--- doc/BackupPC.html 2011-09-19 00:55:51 +0000
1038+++ doc/BackupPC.html 2014-01-06 14:04:46 +0000
1039@@ -4,1267 +4,854 @@
1040 <head>
1041 <title>BackupPC</title>
1042 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
1043-<link rev="made" href="mailto:rurban@x-ray.at" />
1044+<link rev="made" href="mailto:craig@craigs-macbook-pro.local" />
1045 </head>
1046
1047 <body style="background-color: white">
1048 <table border="0" width="100%" cellspacing="0" cellpadding="3">
1049-<tr><td class="block" style="background-color: #cccccc" valign="middle">
1050-<big><strong><span class="block">&nbsp;BackupPC</span></strong></big>
1051+<tr><td class="_podblock_" style="background-color: #cccccc" valign="middle">
1052+<big><strong><span class="_podblock_">&nbsp;BackupPC</span></strong></big>
1053 </td></tr>
1054 </table>
1055
1056
1057-<!-- INDEX BEGIN -->
1058-<div name="index">
1059-<p><a name="__index__"></a></p>
1060-
1061-<ul>
1062-
1063- <li><a href="#backuppc_introduction">BackupPC Introduction</a></li>
1064- <ul>
1065-
1066- <li><a href="#overview">Overview</a></li>
1067- <li><a href="#backup_basics">Backup basics</a></li>
1068- <li><a href="#resources">Resources</a></li>
1069- <li><a href="#road_map">Road map</a></li>
1070- <li><a href="#you_can_help">You can help</a></li>
1071- </ul>
1072-
1073- <li><a href="#installing_backuppc">Installing BackupPC</a></li>
1074- <ul>
1075-
1076- <li><a href="#requirements">Requirements</a></li>
1077- <li><a href="#what_type_of_storage_space_do_i_need">What type of storage space do I need?</a></li>
1078- <li><a href="#how_much_disk_space_do_i_need">How much disk space do I need?</a></li>
1079- <li><a href="#step_1__getting_backuppc">Step 1: Getting BackupPC</a></li>
1080- <li><a href="#step_2__installing_the_distribution">Step 2: Installing the distribution</a></li>
1081- <li><a href="#step_3__setting_up_config_pl">Step 3: Setting up config.pl</a></li>
1082- <li><a href="#step_4__setting_up_the_hosts_file">Step 4: Setting up the hosts file</a></li>
1083- <li><a href="#step_5__client_setup">Step 5: Client Setup</a></li>
1084- <li><a href="#step_6__running_backuppc">Step 6: Running BackupPC</a></li>
1085- <li><a href="#step_7__talking_to_backuppc">Step 7: Talking to BackupPC</a></li>
1086- <li><a href="#step_8__checking_email_delivery">Step 8: Checking email delivery</a></li>
1087- <li><a href="#step_9__cgi_interface">Step 9: CGI interface</a></li>
1088- <li><a href="#how_backuppc_finds_hosts">How BackupPC Finds Hosts</a></li>
1089- <li><a href="#other_installation_topics">Other installation topics</a></li>
1090- <li><a href="#fixing_installation_problems">Fixing installation problems</a></li>
1091- </ul>
1092-
1093- <li><a href="#restore_functions">Restore functions</a></li>
1094- <ul>
1095-
1096- <li><a href="#cgi_restore_options">CGI restore options</a></li>
1097- <li><a href="#command_line_restore_options">Command-line restore options</a></li>
1098- </ul>
1099-
1100- <li><a href="#archive_functions">Archive functions</a></li>
1101- <ul>
1102-
1103- <li><a href="#configuring_an_archive_host">Configuring an Archive Host</a></li>
1104- <li><a href="#starting_an_archive">Starting an Archive</a></li>
1105- <li><a href="#starting_an_archive_from_the_command_line">Starting an Archive from the command line</a></li>
1106- </ul>
1107-
1108- <li><a href="#other_cgi_functions">Other CGI Functions</a></li>
1109- <ul>
1110-
1111- <li><a href="#configuration_and_host_editor">Configuration and Host Editor</a></li>
1112- <li><a href="#rss">RSS</a></li>
1113- </ul>
1114-
1115- <li><a href="#backuppc_design">BackupPC Design</a></li>
1116- <ul>
1117-
1118- <li><a href="#some_design_issues">Some design issues</a></li>
1119- <li><a href="#backuppc_operation">BackupPC operation</a></li>
1120- <li><a href="#storage_layout">Storage layout</a></li>
1121- <li><a href="#compressed_file_format">Compressed file format</a></li>
1122- <li><a href="#rsync_checksum_caching">Rsync checksum caching</a></li>
1123- <li><a href="#file_name_mangling">File name mangling</a></li>
1124- <li><a href="#special_files">Special files</a></li>
1125- <li><a href="#attribute_file_format">Attribute file format</a></li>
1126- <li><a href="#optimizations">Optimizations</a></li>
1127- <li><a href="#limitations">Limitations</a></li>
1128- <li><a href="#security_issues">Security issues</a></li>
1129- </ul>
1130-
1131- <li><a href="#configuration_file">Configuration File</a></li>
1132- <ul>
1133-
1134- <li><a href="#modifying_the_main_configuration_file">Modifying the main configuration file</a></li>
1135- </ul>
1136-
1137- <li><a href="#configuration_parameters">Configuration Parameters</a></li>
1138- <ul>
1139-
1140- <li><a href="#general_server_configuration">General server configuration</a></li>
1141- <li><a href="#what_to_backup_and_when_to_do_it">What to backup and when to do it</a></li>
1142- <li><a href="#how_to_backup_a_client">How to backup a client</a></li>
1143- <li><a href="#samba_configuration">Samba Configuration</a></li>
1144- <li><a href="#tar_configuration">Tar Configuration</a></li>
1145- <li><a href="#rsync_rsyncd_configuration">Rsync/Rsyncd Configuration</a></li>
1146- <li><a href="#ftp_configuration">FTP Configuration</a></li>
1147- <li><a href="#archive_configuration">Archive Configuration</a></li>
1148- <li><a href="#email_reminders__status_and_messages">Email reminders, status and messages</a></li>
1149- <li><a href="#cgi_user_interface_configuration_settings">CGI user interface configuration settings</a></li>
1150- </ul>
1151-
1152- <li><a href="#version_numbers">Version Numbers</a></li>
1153- <li><a href="#author">Author</a></li>
1154- <li><a href="#copyright">Copyright</a></li>
1155- <li><a href="#credits">Credits</a></li>
1156- <li><a href="#license">License</a></li>
1157+
1158+<ul id="index">
1159+ <li><a href="#BackupPC-Introduction">BackupPC Introduction</a>
1160+ <ul>
1161+ <li><a href="#Overview">Overview</a></li>
1162+ <li><a href="#Backup-basics">Backup basics</a></li>
1163+ <li><a href="#Resources">Resources</a></li>
1164+ <li><a href="#Road-map">Road map</a></li>
1165+ <li><a href="#You-can-help">You can help</a></li>
1166+ </ul>
1167+ </li>
1168+ <li><a href="#Installing-BackupPC">Installing BackupPC</a>
1169+ <ul>
1170+ <li><a href="#Requirements">Requirements</a></li>
1171+ <li><a href="#What-type-of-storage-space-do-I-need-">What type of storage space do I need?</a></li>
1172+ <li><a href="#How-much-disk-space-do-I-need-">How much disk space do I need?</a></li>
1173+ <li><a href="#Step-1:-Getting-BackupPC">Step 1: Getting BackupPC</a></li>
1174+ <li><a href="#Step-2:-Installing-the-distribution">Step 2: Installing the distribution</a></li>
1175+ <li><a href="#Step-3:-Setting-up-config.pl">Step 3: Setting up config.pl</a></li>
1176+ <li><a href="#Step-4:-Setting-up-the-hosts-file">Step 4: Setting up the hosts file</a></li>
1177+ <li><a href="#Step-5:-Client-Setup">Step 5: Client Setup</a></li>
1178+ <li><a href="#Step-6:-Running-BackupPC">Step 6: Running BackupPC</a></li>
1179+ <li><a href="#Step-7:-Talking-to-BackupPC">Step 7: Talking to BackupPC</a></li>
1180+ <li><a href="#Step-8:-Checking-email-delivery">Step 8: Checking email delivery</a></li>
1181+ <li><a href="#Step-9:-CGI-interface">Step 9: CGI interface</a></li>
1182+ <li><a href="#How-BackupPC-Finds-Hosts">How BackupPC Finds Hosts</a></li>
1183+ <li><a href="#Other-installation-topics">Other installation topics</a></li>
1184+ <li><a href="#Fixing-installation-problems">Fixing installation problems</a></li>
1185+ </ul>
1186+ </li>
1187+ <li><a href="#Restore-functions">Restore functions</a>
1188+ <ul>
1189+ <li><a href="#CGI-restore-options">CGI restore options</a></li>
1190+ <li><a href="#Command-line-restore-options">Command-line restore options</a></li>
1191+ </ul>
1192+ </li>
1193+ <li><a href="#Archive-functions">Archive functions</a>
1194+ <ul>
1195+ <li><a href="#Configuring-an-Archive-Host">Configuring an Archive Host</a></li>
1196+ <li><a href="#Starting-an-Archive">Starting an Archive</a></li>
1197+ <li><a href="#Starting-an-Archive-from-the-command-line">Starting an Archive from the command line</a></li>
1198+ </ul>
1199+ </li>
1200+ <li><a href="#Other-CGI-Functions">Other CGI Functions</a>
1201+ <ul>
1202+ <li><a href="#Configuration-and-Host-Editor">Configuration and Host Editor</a></li>
1203+ <li><a href="#RSS">RSS</a></li>
1204+ </ul>
1205+ </li>
1206+ <li><a href="#BackupPC-Design">BackupPC Design</a>
1207+ <ul>
1208+ <li><a href="#Some-design-issues">Some design issues</a></li>
1209+ <li><a href="#BackupPC-operation">BackupPC operation</a></li>
1210+ <li><a href="#Storage-layout">Storage layout</a></li>
1211+ <li><a href="#Compressed-file-format">Compressed file format</a></li>
1212+ <li><a href="#Rsync-checksum-caching">Rsync checksum caching</a></li>
1213+ <li><a href="#File-name-mangling">File name mangling</a></li>
1214+ <li><a href="#Special-files">Special files</a></li>
1215+ <li><a href="#Attribute-file-format">Attribute file format</a></li>
1216+ <li><a href="#Optimizations">Optimizations</a></li>
1217+ <li><a href="#Limitations">Limitations</a></li>
1218+ <li><a href="#Security-issues">Security issues</a></li>
1219+ </ul>
1220+ </li>
1221+ <li><a href="#Configuration-File">Configuration File</a>
1222+ <ul>
1223+ <li><a href="#Modifying-the-main-configuration-file">Modifying the main configuration file</a></li>
1224+ </ul>
1225+ </li>
1226+ <li><a href="#Configuration-Parameters">Configuration Parameters</a>
1227+ <ul>
1228+ <li><a href="#General-server-configuration">General server configuration</a></li>
1229+ <li><a href="#What-to-backup-and-when-to-do-it">What to backup and when to do it</a></li>
1230+ <li><a href="#How-to-backup-a-client">How to backup a client</a></li>
1231+ <li><a href="#Samba-Configuration">Samba Configuration</a></li>
1232+ <li><a href="#Tar-Configuration">Tar Configuration</a></li>
1233+ <li><a href="#Rsync-Rsyncd-Configuration">Rsync/Rsyncd Configuration</a></li>
1234+ <li><a href="#FTP-Configuration">FTP Configuration</a></li>
1235+ <li><a href="#Archive-Configuration">Archive Configuration</a></li>
1236+ <li><a href="#Email-reminders-status-and-messages">Email reminders, status and messages</a></li>
1237+ <li><a href="#CGI-user-interface-configuration-settings">CGI user interface configuration settings</a></li>
1238+ </ul>
1239+ </li>
1240+ <li><a href="#Version-Numbers">Version Numbers</a></li>
1241+ <li><a href="#Author">Author</a></li>
1242+ <li><a href="#Copyright">Copyright</a></li>
1243+ <li><a href="#Credits">Credits</a></li>
1244+ <li><a href="#License">License</a></li>
1245 </ul>
1246
1247-<hr name="index" />
1248-</div>
1249-<!-- INDEX END -->
1250-
1251-<p>
1252-</p>
1253-<h1><a name="backuppc_introduction">BackupPC Introduction</a></h1>
1254-<p>This documentation describes BackupPC version 3.2.1,
1255-released on 24 Apr 2011.</p>
1256-<p>
1257-</p>
1258-<h2><a name="overview">Overview</a></h2>
1259-<p>BackupPC is a high-performance, enterprise-grade system for backing up
1260-Unix, Linux, WinXX, and MacOSX PCs, desktops and laptops to a server's
1261-disk. BackupPC is highly configurable and easy to install and maintain.</p>
1262-<p>Given the ever decreasing cost of disks and raid systems, it is now
1263-practical and cost effective to backup a large number of machines onto
1264-a server's local disk or network storage. For some sites this might be
1265-the complete backup solution. For other sites additional permanent
1266-archives could be created by periodically backing up the server to tape.</p>
1267+<hr />
1268+<h1 id="BackupPC-Introduction">BackupPC Introduction</h1>
1269+
1270+<p>This documentation describes BackupPC version 3.3.0, released on 14 Apr 2013.</p>
1271+
1272+<h2 id="Overview">Overview</h2>
1273+
1274+<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>
1275+
1276+<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>
1277+
1278 <p>Features include:</p>
1279+
1280 <ul>
1281-<li>
1282-<p>A clever pooling scheme minimizes disk storage and disk I/O.
1283-Identical files across multiple backups of the same or different PC
1284-are stored only once (using hard links), resulting in substantial
1285-savings in disk storage and disk writes.</p>
1286-</li>
1287-<li>
1288-<p>Optional compression provides additional reductions in storage
1289-(around 40%). The CPU impact of compression is low since only
1290-new files (those not already in the pool) need to be compressed.</p>
1291-</li>
1292-<li>
1293-<p>A powerful http/cgi user interface allows administrators to view
1294-the current status, edit configuration, add/delete hosts, view log
1295-files, and allows users to initiate and cancel backups and browse
1296-and restore files from backups.</p>
1297-</li>
1298-<li>
1299-<p>The http/cgi user interface has internationalization (i18n) support,
1300-currently providing English, French, German, Spanish, Italian,
1301-Dutch, Polish, Portuguese-Brazilian and Chinese</p>
1302-</li>
1303-<li>
1304-<p>No client-side software is needed. On WinXX the standard smb
1305-protocol is used to extract backup data. On linux, unix or MacOSX
1306-clients, rsync, tar (over ssh/rsh/nfs) or ftp is used to extract
1307-backup data. Alternatively, rsync can also be used on WinXX (using
1308-cygwin), and Samba could be installed on the linux or unix client
1309-to provide smb shares).</p>
1310-</li>
1311-<li>
1312-<p>Flexible restore options. Single files can be downloaded from
1313-any backup directly from the CGI interface. Zip or Tar archives
1314-for selected files or directories from any backup can also be
1315-downloaded from the CGI interface. Finally, direct restore to
1316-the client machine (using smb or tar) for selected files or
1317-directories is also supported from the CGI interface.</p>
1318-</li>
1319-<li>
1320-<p>BackupPC supports mobile environments where laptops are only
1321-intermittently connected to the network and have dynamic IP addresses
1322-(DHCP). Configuration settings allow machines connected via slower WAN
1323-connections (eg: dial up, DSL, cable) to not be backed up, even if they
1324-use the same fixed or dynamic IP address as when they are connected
1325-directly to the LAN.</p>
1326-</li>
1327-<li>
1328-<p>Flexible configuration parameters allow multiple backups to be performed
1329-in parallel, specification of which shares to backup, which directories
1330-to backup or not backup, various schedules for full and incremental
1331-backups, schedules for email reminders to users and so on. Configuration
1332-parameters can be set system-wide or also on a per-PC basis.</p>
1333-</li>
1334-<li>
1335-<p>Users are sent periodic email reminders if their PC has not
1336-recently been backed up. Email content, timing and policies
1337-are configurable.</p>
1338-</li>
1339-<li>
1340-<p>BackupPC is Open Source software hosted by SourceForge.</p>
1341+
1342+<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>
1343+
1344+</li>
1345+<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>
1346+
1347+</li>
1348+<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>
1349+
1350+</li>
1351+<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>
1352+
1353+</li>
1354+<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>
1355+
1356+</li>
1357+<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>
1358+
1359+</li>
1360+<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>
1361+
1362+</li>
1363+<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>
1364+
1365+</li>
1366+<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>
1367+
1368+</li>
1369+<li><p>BackupPC is Open Source software hosted by SourceForge.</p>
1370+
1371 </li>
1372 </ul>
1373-<p>
1374-</p>
1375-<h2><a name="backup_basics">Backup basics</a></h2>
1376+
1377+<h2 id="Backup-basics">Backup basics</h2>
1378+
1379 <dl>
1380-<dt><strong><a name="full_backup" class="item">Full Backup</a></strong></dt>
1381-
1382-<dd>
1383-<p>A full backup is a complete backup of a share. BackupPC can be
1384-configured to do a full backup at a regular interval (typically
1385-weekly). BackupPC can be configured to keep a certain number
1386-of full backups. Exponential expiry is also supported, allowing
1387-full backups with various vintages to be kept (for example, a
1388-settable number of most recent weekly fulls, plus a settable
1389-number of older fulls that are 2, 4, 8, or 16 weeks apart).</p>
1390-</dd>
1391-<dt><strong><a name="incremental_backup" class="item">Incremental Backup</a></strong></dt>
1392-
1393-<dd>
1394-<p>An incremental backup is a backup of files that have changed
1395-since the last successful full or incremental backup. Starting
1396-in BackupPC 3.0 multi-level incrementals are supported.
1397-A full backup has level 0. A new incremental of level N will
1398-backup all files that have changed since the most recent backup
1399-of a lower level. <a href="#_conf_incrlevels_">$Conf{IncrLevels}</a> is used to specify the
1400-level of each successive incremental. The default value is
1401-all level 1, which makes the behavior the same as earlier
1402-versions of BackupPC: each incremental will back up all the
1403-files that changed since the last full (level 0).</p>
1404-<p>For SMB and tar, BackupPC uses the modification time (mtime) to
1405-determine which files have changed since the last lower-level
1406-backup. That means SMB and tar incrementals are not able to detect
1407-deleted files, renamed files or new files whose modification time
1408-is prior to the last lower-level backup.</p>
1409-<p>Rsync is more clever: any files whose attributes have changed (ie: uid,
1410-gid, mtime, modes, size) since the last full are backed up. Deleted,
1411-new files and renamed files are detected by Rsync incrementals.</p>
1412-<p>BackupPC can also be configured to keep a certain number of incremental
1413-backups, and to keep a smaller number of very old incremental backups.
1414-If multi-level incrementals are specified then it is likely that
1415-more incrementals will need to be kept since lower-level incrementals
1416-(and the full backup) are needed to reconstruct a higher-level
1417-incremental.</p>
1418-<p>BackupPC &quot;fills-in&quot; incremental backups when browsing or restoring,
1419-based on the levels of each backup, giving every backup a &quot;full&quot;
1420-appearance. This makes browsing and restoring backups much easier:
1421-you can restore from any one backup independent of whether it was
1422-an incremental or full.</p>
1423-</dd>
1424-<dt><strong><a name="partial_backup" class="item">Partial Backup</a></strong></dt>
1425-
1426-<dd>
1427-<p>When a full backup fails or is canceled, and some files have already
1428-been backed up, BackupPC keeps a partial backup containing just the
1429-files that were backed up successfully. The partial backup is removed
1430-when the next successful backup completes, or if another full backup
1431-fails resulting in a newer partial backup. A failed full backup
1432-that has not backed up any files, or any failed incremental backup,
1433-is removed; no partial backup is saved in these cases.</p>
1434-<p>The partial backup may be browsed or used to restore files just like
1435-a successful full or incremental backup.</p>
1436-<p>With the rsync transfer method the partial backup is used to resume
1437-the next full backup, avoiding the need to retransfer the file data
1438-already in the partial backup.</p>
1439-</dd>
1440-<dt><strong><a name="identical_files" class="item">Identical Files</a></strong></dt>
1441-
1442-<dd>
1443-<p>BackupPC pools identical files using hardlinks. By &quot;identical
1444-files&quot; we mean files with identical contents, not necessary the
1445-same permissions, ownership or modification time. Two files might
1446-have different permissions, ownership, or modification time but
1447-will still be pooled whenever the contents are identical. This
1448-is possible since BackupPC stores the file meta-data (permissions,
1449-ownership, and modification time) separately from the file contents.</p>
1450-</dd>
1451-<dt><strong><a name="backup_policy" class="item">Backup Policy</a></strong></dt>
1452-
1453-<dd>
1454-<p>Based on your site's requirements you need to decide what your backup
1455-policy is. BackupPC is not designed to provide exact re-imaging of
1456-failed disks. See <a href="#limitations">Limitations</a> for more information.
1457-However, the addition of tar transport for linux/unix clients, plus
1458-full support for special file types and unix attributes in v1.4.0
1459-likely means an exact image of a linux/unix file system can be made.</p>
1460-<p>BackupPC saves backups onto disk. Because of pooling you can relatively
1461-economically keep several weeks of old backups.</p>
1462-<p>At some sites the disk-based backup will be adequate, without a
1463-secondary tape backup. This system is robust to any single failure: if a
1464-client disk fails or loses files, the BackupPC server can be used to
1465-restore files. If the server disk fails, BackupPC can be restarted on a
1466-fresh file system, and create new backups from the clients. The chance
1467-of the server disk failing can be made very small by spending more money
1468-on increasingly better RAID systems. However, there is still the risk
1469-of catastrophic events like fires or earthquakes that can destroy
1470-both the BackupPC server and the clients it is backing up if they
1471-are physically nearby.</p>
1472-<p>Some sites might choose to do periodic backups to tape or cd/dvd.
1473-This backup can be done perhaps weekly using the archive function of
1474-BackupPC.</p>
1475-<p>Other users have reported success with removable disks to rotate the
1476-BackupPC data drives, or using rsync to mirror the BackupPC data pool
1477-offsite.</p>
1478+
1479+<dt id="Full-Backup">Full Backup</dt>
1480+<dd>
1481+
1482+<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>
1483+
1484+</dd>
1485+<dt id="Incremental-Backup">Incremental Backup</dt>
1486+<dd>
1487+
1488+<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>
1489+
1490+<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>
1491+
1492+<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>
1493+
1494+<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>
1495+
1496+<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>
1497+
1498+</dd>
1499+<dt id="Partial-Backup">Partial Backup</dt>
1500+<dd>
1501+
1502+<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>
1503+
1504+<p>The partial backup may be browsed or used to restore files just like a successful full or incremental backup.</p>
1505+
1506+<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>
1507+
1508+</dd>
1509+<dt id="Identical-Files">Identical Files</dt>
1510+<dd>
1511+
1512+<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>
1513+
1514+</dd>
1515+<dt id="Backup-Policy">Backup Policy</dt>
1516+<dd>
1517+
1518+<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>
1519+
1520+<p>BackupPC saves backups onto disk. Because of pooling you can relatively economically keep several weeks of old backups.</p>
1521+
1522+<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>
1523+
1524+<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>
1525+
1526+<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>
1527+
1528 </dd>
1529 </dl>
1530-<p>
1531-</p>
1532-<h2><a name="resources">Resources</a></h2>
1533+
1534+<h2 id="Resources">Resources</h2>
1535+
1536 <dl>
1537-<dt><strong><a name="backuppc_home_page" class="item">BackupPC home page</a></strong></dt>
1538
1539+<dt id="BackupPC-home-page">BackupPC home page</dt>
1540 <dd>
1541-<p>The BackupPC Open Source project is hosted on SourceForge. The
1542-home page can be found at:</p>
1543-<pre>
1544- <a href="http://backuppc.sourceforge.net">http://backuppc.sourceforge.net</a></pre>
1545-<p>This page has links to the current documentation, the SourceForge
1546-project page and general information.</p>
1547+
1548+<p>The BackupPC Open Source project is hosted on SourceForge. The home page can be found at:</p>
1549+
1550+<pre><code> http://backuppc.sourceforge.net</code></pre>
1551+
1552+<p>This page has links to the current documentation, the SourceForge project page and general information.</p>
1553+
1554 </dd>
1555-<dt><strong><a name="sourceforge_project" class="item">SourceForge project</a></strong></dt>
1556+<dt id="SourceForge-project">SourceForge project</dt>
1557+<dd>
1558
1559-<dd>
1560 <p>The SourceForge project page is at:</p>
1561-<pre>
1562- <a href="http://sourceforge.net/projects/backuppc">http://sourceforge.net/projects/backuppc</a></pre>
1563+
1564+<pre><code> http://sourceforge.net/projects/backuppc</code></pre>
1565+
1566 <p>This page has links to the current releases of BackupPC.</p>
1567-</dd>
1568-<dt><strong><a name="backuppc_wiki" class="item">BackupPC Wiki</a></strong></dt>
1569-
1570-<dd>
1571-<p>BackupPC has a Wiki at <a href="http://backuppc.wiki.sourceforge.net">http://backuppc.wiki.sourceforge.net</a>.
1572-Everyone is encouraged to contribute to the Wiki. Anyone with
1573-a SourceForge account can edit the Wiki.</p>
1574-<p>The old FAQ is at <a href="http://backuppc.sourceforge.net/faq">http://backuppc.sourceforge.net/faq</a>, but
1575-is deprecated in favor of the Wiki.</p>
1576-</dd>
1577-<dt><strong><a name="mailing_lists" class="item">Mailing lists</a></strong></dt>
1578-
1579-<dd>
1580-<p>Three BackupPC mailing lists exist for announcements (backuppc-announce),
1581-developers (backuppc-devel), and a general user list for support, asking
1582-questions or any other topic relevant to BackupPC (backuppc-users).</p>
1583-<p>The lists are archived on SourceForge and Gmane. The SourceForge lists
1584-are not always up to date and the searching is limited, so Gmane is
1585-a good alternative. See:</p>
1586-<pre>
1587- <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>
1588- <a href="http://sourceforge.net/mailarchive/forum.php?forum=backuppc-users">http://sourceforge.net/mailarchive/forum.php?forum=backuppc-users</a></pre>
1589+
1590+</dd>
1591+<dt id="BackupPC-Wiki">BackupPC Wiki</dt>
1592+<dd>
1593+
1594+<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>
1595+
1596+<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>
1597+
1598+</dd>
1599+<dt id="Mailing-lists">Mailing lists</dt>
1600+<dd>
1601+
1602+<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>
1603+
1604+<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>
1605+
1606+<pre><code> http://news.gmane.org/index.php?prefix=gmane.comp.sysutils.backup.backuppc
1607+ http://sourceforge.net/mailarchive/forum.php?forum=backuppc-users</code></pre>
1608+
1609 <p>You can subscribe to these lists by visiting:</p>
1610-<pre>
1611- <a href="http://lists.sourceforge.net/lists/listinfo/backuppc-announce">http://lists.sourceforge.net/lists/listinfo/backuppc-announce</a>
1612- <a href="http://lists.sourceforge.net/lists/listinfo/backuppc-users">http://lists.sourceforge.net/lists/listinfo/backuppc-users</a>
1613- <a href="http://lists.sourceforge.net/lists/listinfo/backuppc-devel">http://lists.sourceforge.net/lists/listinfo/backuppc-devel</a></pre>
1614-<p>The backuppc-announce list is moderated and is used only for
1615-important announcements (eg: new versions). It is low traffic.
1616-You only need to subscribe to one of backuppc-announce and
1617-backuppc-users: backuppc-users also receives any messages on
1618-backuppc-announce.</p>
1619-<p>The backuppc-devel list is only for developers who are working on BackupPC.
1620-Do not post questions or support requests there. But detailed technical
1621-discussions should happen on this list.</p>
1622+
1623+<pre><code> http://lists.sourceforge.net/lists/listinfo/backuppc-announce
1624+ http://lists.sourceforge.net/lists/listinfo/backuppc-users
1625+ http://lists.sourceforge.net/lists/listinfo/backuppc-devel</code></pre>
1626+
1627+<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>
1628+
1629+<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>
1630+
1631 <p>To post a message to the backuppc-users list, send an email to</p>
1632-<pre>
1633- backuppc-users@lists.sourceforge.net</pre>
1634+
1635+<pre><code> backuppc-users@lists.sourceforge.net</code></pre>
1636+
1637 <p>Do not send subscription requests to this address!</p>
1638+
1639 </dd>
1640-<dt><strong><a name="other_programs_of_interest" class="item">Other Programs of Interest</a></strong></dt>
1641-
1642+<dt id="Other-Programs-of-Interest">Other Programs of Interest</dt>
1643 <dd>
1644-<p>If you want to mirror linux or unix files or directories to a remote server
1645-you should use rsync, <a href="http://rsync.samba.org">http://rsync.samba.org</a>. BackupPC uses
1646-rsync as a transport mechanism; if you are already an rsync user you
1647-can think of BackupPC as adding efficient storage (compression and
1648-pooling) and a convenient user interface to rsync.</p>
1649-<p>Two popular open source packages that do tape backup are
1650-Amanda (<a href="http://www.amanda.org">http://www.amanda.org</a>)
1651-and Bacula (<a href="http://www.bacula.org">http://www.bacula.org</a>).
1652-These packages can be used as complete solutions, or also as back
1653-ends to BackupPC to backup the BackupPC server data to tape.</p>
1654-<p>Various programs and scripts use rsync to provide hardlinked backups.
1655-See, for example, Mike Rubel's site (<a href="http://www.mikerubel.org/computers/rsync_snapshots">http://www.mikerubel.org/computers/rsync_snapshots</a>),
1656-JW Schultz's dirvish (<a href="http://www.dirvish.org/">http://www.dirvish.org/</a>),
1657-Ben Escoto's rdiff-backup (<a href="http://www.nongnu.org/rdiff-backup">http://www.nongnu.org/rdiff-backup</a>),
1658-and John Bowman's rlbackup (<a href="http://www.math.ualberta.ca/imaging/rlbackup">http://www.math.ualberta.ca/imaging/rlbackup</a>).</p>
1659-<p>Unison is a utility that can do two-way, interactive, synchronization.
1660-See <a href="http://freshmeat.net/projects/unison">http://freshmeat.net/projects/unison</a>. An external wrapper around
1661-rsync that maintains transfer data to enable two-way synchronization is
1662-drsync; see <a href="http://freshmeat.net/projects/drsync">http://freshmeat.net/projects/drsync</a>.</p>
1663-<p>BackupPC provides many additional features, such as compressed storage,
1664-hardlinking any matching files (rather than just files with the same name),
1665-and storing special files without root privileges. But these other programs
1666-provide simple, effective and fast solutions and are definitely worthy of
1667-consideration.</p>
1668+
1669+<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>
1670+
1671+<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>
1672+
1673+<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>
1674+
1675+<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>
1676+
1677+<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>
1678+
1679 </dd>
1680 </dl>
1681-<p>
1682-</p>
1683-<h2><a name="road_map">Road map</a></h2>
1684-<p>The new features planned for future releases of BackupPC
1685-are on the Wiki at <a href="http://backuppc.wiki.sourceforge.net">http://backuppc.wiki.sourceforge.net</a>.</p>
1686+
1687+<h2 id="Road-map">Road map</h2>
1688+
1689+<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>
1690+
1691 <p>Comments and suggestions are welcome.</p>
1692-<p>
1693-</p>
1694-<h2><a name="you_can_help">You can help</a></h2>
1695-<p>BackupPC is free. I work on BackupPC because I enjoy doing it and I like
1696-to contribute to the open source community.</p>
1697-<p>BackupPC already has more than enough features for my own needs. The
1698-main compensation for continuing to work on BackupPC is knowing that
1699-more and more people find it useful. So feedback is certainly
1700-appreciated, both positive and negative.</p>
1701-<p>Beyond being a satisfied user and telling other people about it, everyone
1702-is encouraged to add links to <a href="http://backuppc.sourceforge.net">http://backuppc.sourceforge.net</a>
1703-(I'll see them via Google) or otherwise publicize BackupPC. Unlike
1704-the commercial products in this space, I have a zero budget (in both
1705-time and money) for marketing, PR and advertising, so it's up to
1706-all of you! Feel free to vote for BackupPC at
1707-<a href="http://freshmeat.net/projects/backuppc">http://freshmeat.net/projects/backuppc</a>.</p>
1708-<p>Also, everyone is encouraged to contribute patches, bug reports,
1709-feature and design suggestions, new code, Wiki additions (you can
1710-do those directly) and documentation corrections or improvements.
1711-Answering questions on the mailing list is a big help too.</p>
1712-<p>
1713-<a href="#__index__"><small>Back to Top</small></a>
1714-</p>
1715+
1716+<h2 id="You-can-help">You can help</h2>
1717+
1718+<p>BackupPC is free. I work on BackupPC because I enjoy doing it and I like to contribute to the open source community.</p>
1719+
1720+<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>
1721+
1722+<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>
1723+
1724+<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>
1725+
1726 <hr />
1727-<h1><a name="installing_backuppc">Installing BackupPC</a></h1>
1728-<p>
1729-</p>
1730-<h2><a name="requirements">Requirements</a></h2>
1731+<h1 id="Installing-BackupPC">Installing BackupPC</h1>
1732+
1733+<h2 id="Requirements">Requirements</h2>
1734+
1735 <p>BackupPC requires:</p>
1736+
1737 <ul>
1738-<li>
1739-<p>A linux, solaris, or unix based server with a substantial amount of free
1740-disk space (see the next section for what that means). The CPU and disk
1741-performance on this server will determine how many simultaneous backups
1742-you can run. You should be able to run 4-8 simultaneous backups on a
1743-moderately configured server.</p>
1744-<p>Several users have reported significantly better performance using
1745-reiserfs compared to ext3 for the BackupPC data file system. It is
1746-also recommended you consider either an LVM or RAID setup (either
1747-in HW or SW; eg: 3Ware RAID10 or RAID5) so that you can expand the
1748-file system as necessary.</p>
1749-<p>When BackupPC starts with an empty pool, all the backup data will be
1750-written to the pool on disk. After more backups are done, a higher
1751-percentage of incoming files will already be in the pool. BackupPC is
1752-able to avoid writing to disk new files that are already in the pool.
1753-So over time disk writes will reduce significantly (by perhaps a factor
1754-of 20 or more), since eventually 95% or more of incoming backup files
1755-are typically in the pool. Disk reads from the pool are still needed to
1756-do file compares to verify files are an exact match. So, with a mature
1757-pool, if a relatively fast client generates data at say 1MB/sec, and you
1758-run 4 simultaneous backups, there will be an average server disk load of
1759-about 4MB/sec reads and 0.2MB/sec writes (assuming 95% of the incoming
1760-files are in the pool). These rates will be perhaps 40% lower if
1761-compression is on.</p>
1762-</li>
1763-<li>
1764-<p>Perl version 5.8.0 or later. If you don't have perl, please
1765-see <a href="http://www.cpan.org">http://www.cpan.org</a>.</p>
1766-</li>
1767-<li>
1768-<p>Perl modules Compress::Zlib, Archive::Zip and File::RsyncP. Try &quot;perldoc
1769-Compress::Zlib&quot; and &quot;perldoc Archive::Zip&quot; to see if you have these
1770-modules. If not, fetch them from <a href="http://www.cpan.org">http://www.cpan.org</a> and see the
1771-instructions below for how to build and install them.</p>
1772-<p>The File::RsyncP module is available from <a href="http://perlrsync.sourceforge.net">http://perlrsync.sourceforge.net</a>
1773-or CPAN. You'll need to install the File::RsyncP module if you want to use
1774-Rsync as a transport method.</p>
1775-</li>
1776-<li>
1777-<p>If you are using smb to backup WinXX machines you need smbclient and
1778-nmblookup from the samba package. You will also need nmblookup if
1779-you are backing up linux/unix DHCP machines. See <a href="http://www.samba.org">http://www.samba.org</a>.
1780-Samba versions 3.x are stable and now recommended instead of 2.x.</p>
1781-<p>See <a href="http://www.samba.org">http://www.samba.org</a> for source and binaries. It's pretty easy to
1782-fetch and compile samba, and just grab smbclient and nmblookup, without
1783-doing the installation. Alternatively, <a href="http://www.samba.org">http://www.samba.org</a> has binary
1784-distributions for most platforms.</p>
1785-</li>
1786-<li>
1787-<p>If you are using tar to backup linux/unix machines, those machines should have
1788-version 1.13.7 at a minimum, with version 1.13.20 or higher recommended. Use
1789-&quot;tar --version&quot; to check your version. Various GNU mirrors have the newest
1790-versions of tar; see <a href="http://www.gnu.org/software/tar/">http://www.gnu.org/software/tar/</a>.</p>
1791-</li>
1792-<li>
1793-<p>If you are using rsync to backup linux/unix machines you should have
1794-version 2.6.3 or higher on each client machine. See
1795-<a href="http://rsync.samba.org">http://rsync.samba.org</a>. Use &quot;rsync --version&quot; to check your version.</p>
1796-<p>For BackupPC to use Rsync you will also need to install the perl
1797-File::RsyncP module, which is available from
1798-<a href="http://perlrsync.sourceforge.net">http://perlrsync.sourceforge.net</a>.
1799-Version 0.68 or later is required.</p>
1800-</li>
1801-<li>
1802-<p>The Apache web server, see <a href="http://www.apache.org">http://www.apache.org</a>, preferably built
1803-with mod_perl support.</p>
1804+
1805+<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>
1806+
1807+<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>
1808+
1809+<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>
1810+
1811+</li>
1812+<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>
1813+
1814+</li>
1815+<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>
1816+
1817+<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>
1818+
1819+</li>
1820+<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>
1821+
1822+<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>
1823+
1824+</li>
1825+<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>
1826+
1827+</li>
1828+<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>
1829+
1830+<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>
1831+
1832+</li>
1833+<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>
1834+
1835 </li>
1836 </ul>
1837-<p>
1838-</p>
1839-<h2><a name="what_type_of_storage_space_do_i_need">What type of storage space do I need?</a></h2>
1840-<p>BackupPC uses hardlinks to pool files common to different backups.
1841-Therefore BackupPC's data store (__TOPDIR__) must point to a single
1842-file system that supports hardlinks. You cannot split this file
1843-system with multiple mount points or using symbolic links to point a
1844-sub-directory to a different file system (it is ok to use a single
1845-symbolic link at the top-level directory (__TOPDIR__) to point the
1846-entire data store somewhere else). You can of course use any kind of
1847-RAID system or logical volume manager that combines the capacity of
1848-multiple disks into a single, larger, file system. Such approaches
1849-have the advantage that the file system can be expanded without having
1850-to copy it.</p>
1851-<p>Any standard linux or unix file system supports hardlinks. NFS mounted
1852-file systems work too (provided the underlying file system supports
1853-hardlinks). But windows based FAT and NTFS file systems will not work.</p>
1854-<p>Starting with BackupPC 3.1.0, run-time checks are done at startup and
1855-at the start of each backup to ensure that the file system can support
1856-hardlinks, since this is a common area of configuration problems.</p>
1857-<p>
1858-</p>
1859-<h2><a name="how_much_disk_space_do_i_need">How much disk space do I need?</a></h2>
1860-<p>Here's one real example for an environment that is backing up 65 laptops
1861-with compression off. Each full backup averages 3.2GB. Each incremental
1862-backup averages about 0.2GB. Storing one full backup and two incremental
1863-backups per laptop is around 240GB of raw data. But because of the
1864-pooling of identical files, only 87GB is used. This is without
1865-compression.</p>
1866-<p>Another example, with compression on: backing up 95 laptops, where
1867-each backup averages 3.6GB and each incremental averages about 0.3GB.
1868-Keeping three weekly full backups, and six incrementals is around
1869-1200GB of raw data. Because of pooling and compression, only 150GB
1870-is needed.</p>
1871-<p>Here's a rule of thumb. Add up the disk usage of all the machines you
1872-want to backup (210GB in the first example above). This is a rough
1873-minimum space estimate that should allow a couple of full backups and at
1874-least half a dozen incremental backups per machine. If compression is on
1875-you can reduce the storage requirements by maybe 30-40%. Add some margin
1876-in case you add more machines or decide to keep more old backups.</p>
1877-<p>Your actual mileage will depend upon the types of clients, operating
1878-systems and applications you have. The more uniform the clients and
1879-applications the bigger the benefit from pooling common files.</p>
1880-<p>For example, the Eudora email tool stores each mail folder in a separate
1881-file, and attachments are extracted as separate files. So in the sadly
1882-common case of a large attachment emailed to many recipients, Eudora
1883-will extract the attachment into a new file. When these machines are
1884-backed up, only one copy of the file will be stored on the server, even
1885-though the file appears in many different full or incremental backups. In
1886-this sense Eudora is a &quot;friendly&quot; application from the point of view of
1887-backup storage requirements.</p>
1888-<p>An example at the other end of the spectrum is Outlook. Everything
1889-(email bodies, attachments, calendar, contact lists) is stored in a
1890-single file, which often becomes huge. Any change to this file requires
1891-a separate copy of the file to be saved during backup. Outlook is even
1892-more troublesome, since it keeps this file locked all the time, so it
1893-cannot be read by smbclient whenever Outlook is running. See the
1894-<a href="#limitations">Limitations</a> section for more discussion of this problem.</p>
1895-<p>In addition to total disk space, you should make sure you have
1896-plenty of inodes on your BackupPC data partition. Some users have
1897-reported running out of inodes on their BackupPC data partition.
1898-So even if you have plenty of disk space, BackupPC will report
1899-failures when the inodes are exhausted. This is a particular
1900-problem with ext2/ext3 file systems that have a fixed number of
1901-inodes when the file system is built. Use &quot;df -i&quot; to see your
1902-inode usage.</p>
1903-<p>
1904-</p>
1905-<h2><a name="step_1__getting_backuppc">Step 1: Getting BackupPC</a></h2>
1906-<p>Some linux distributions now include BackupPC. The Debian
1907-distribution, supported by Ludovic Drolez, can be found at
1908-<a href="http://packages.debian.org/backuppc">http://packages.debian.org/backuppc</a> and is included
1909-in the current stable Debian release. On Debian, BackupPC can
1910-be installed with the command:</p>
1911-<pre>
1912- apt-get install backuppc</pre>
1913-<p>In the future there might be packages for Gentoo and other
1914-linux flavors. If the packaged version is older than the
1915-released version then you may want to install the
1916-latest version as described below.</p>
1917-<p>Otherwise, manually fetching and installing BackupPC is easy.
1918-Start by downloading the latest version from
1919-<a href="http://backuppc.sourceforge.net">http://backuppc.sourceforge.net</a>. Hit the &quot;Code&quot; button,
1920-then select the &quot;backuppc&quot; or &quot;backuppc-beta&quot; package and
1921-download the latest version.</p>
1922-<p>
1923-</p>
1924-<h2><a name="step_2__installing_the_distribution">Step 2: Installing the distribution</a></h2>
1925-<p>Note: most information in this step is only relevant if you build
1926-and install BackupPC yourself. If you use a package provided by a
1927-distribution, the package management system should take of installing
1928-any needed dependencies.</p>
1929-<p>First off, there are five perl modules you should install.
1930-These are all optional, but highly recommended:</p>
1931+
1932+<h2 id="What-type-of-storage-space-do-I-need-">What type of storage space do I need?</h2>
1933+
1934+<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>
1935+
1936+<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>
1937+
1938+<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>
1939+
1940+<h2 id="How-much-disk-space-do-I-need-">How much disk space do I need?</h2>
1941+
1942+<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>
1943+
1944+<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>
1945+
1946+<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>
1947+
1948+<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>
1949+
1950+<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>
1951+
1952+<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>
1953+
1954+<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>
1955+
1956+<h2 id="Step-1:-Getting-BackupPC">Step 1: Getting BackupPC</h2>
1957+
1958+<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>
1959+
1960+<pre><code> apt-get install backuppc</code></pre>
1961+
1962+<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>
1963+
1964+<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>
1965+
1966+<h2 id="Step-2:-Installing-the-distribution">Step 2: Installing the distribution</h2>
1967+
1968+<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>
1969+
1970+<p>First off, there are five perl modules you should install. These are all optional, but highly recommended:</p>
1971+
1972 <dl>
1973-<dt><strong><a name="compress_zlib" class="item">Compress::Zlib</a></strong></dt>
1974-
1975-<dd>
1976-<p>To enable compression, you will need to install Compress::Zlib
1977-from <a href="http://www.cpan.org">http://www.cpan.org</a>.
1978-You can run &quot;perldoc Compress::Zlib&quot; to see if this module is installed.</p>
1979-</dd>
1980-<dt><strong><a name="archive_zip" class="item">Archive::Zip</a></strong></dt>
1981-
1982-<dd>
1983-<p>To support restore via Zip archives you will need to install
1984-Archive::Zip, also from <a href="http://www.cpan.org">http://www.cpan.org</a>.
1985-You can run &quot;perldoc Archive::Zip&quot; to see if this module is installed.</p>
1986-</dd>
1987-<dt><strong><a name="xml_rss" class="item">XML::RSS</a></strong></dt>
1988-
1989-<dd>
1990-<p>To support the RSS feature you will need to install XML::RSS, also from
1991-<a href="http://www.cpan.org">http://www.cpan.org</a>. There is not need to install this module if you
1992-don't plan on using RSS. You can run &quot;perldoc XML::RSS&quot; to see if this
1993-module is installed.</p>
1994-</dd>
1995-<dt><strong><a name="file_rsyncp" class="item">File::RsyncP</a></strong></dt>
1996-
1997-<dd>
1998-<p>To use rsync and rsyncd with BackupPC you will need to install File::RsyncP.
1999-You can run &quot;perldoc File::RsyncP&quot; to see if this module is installed.
2000-File::RsyncP is available from <a href="http://perlrsync.sourceforge.net">http://perlrsync.sourceforge.net</a>.
2001-Version 0.68 or later is required.</p>
2002-</dd>
2003-<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>
2004-
2005-<dd>
2006-<p>To use ftp with BackupPC you will need four libraries, but actually
2007-need to install only File::Listing from <a href="http://www.cpan.org">http://www.cpan.org</a>.
2008-You can run &quot;perldoc File::Listing&quot; to see if this module is installed.
2009-Net::FTP is a standard module. Net::FTP::RetrHandle and
2010-Net::FTP::AutoReconnect included in BackupPC distribution.</p>
2011+
2012+<dt id="Compress::Zlib">Compress::Zlib</dt>
2013+<dd>
2014+
2015+<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>
2016+
2017+</dd>
2018+<dt id="Archive::Zip">Archive::Zip</dt>
2019+<dd>
2020+
2021+<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>
2022+
2023+</dd>
2024+<dt id="XML::RSS">XML::RSS</dt>
2025+<dd>
2026+
2027+<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>
2028+
2029+</dd>
2030+<dt id="File::RsyncP">File::RsyncP</dt>
2031+<dd>
2032+
2033+<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>
2034+
2035+</dd>
2036+<dt id="File::Listing-Net::FTP-Net::FTP::RetrHandle-Net::FTP::AutoReconnect">File::Listing, Net::FTP, Net::FTP::RetrHandle, Net::FTP::AutoReconnect</dt>
2037+<dd>
2038+
2039+<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>
2040+
2041 </dd>
2042 </dl>
2043-<p>To build and install these packages you should use the cpan program.
2044-Alternatively, you can fetch the tar.gz file from <a href="http://www.cpan.org">http://www.cpan.org</a>
2045-and then run these commands:</p>
2046-<pre>
2047- tar zxvf Archive-Zip-1.26.tar.gz
2048+
2049+<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>
2050+
2051+<pre><code> tar zxvf Archive-Zip-1.26.tar.gz
2052 cd Archive-Zip-1.26
2053 perl Makefile.PL
2054 make
2055 make test
2056- make install</pre>
2057+ make install</code></pre>
2058+
2059 <p>The same sequence of commands can be used for each module.</p>
2060-<p>Now let's move onto BackupPC itself. After fetching
2061-BackupPC-3.2.1.tar.gz, run these commands as root:</p>
2062-<pre>
2063- tar zxf BackupPC-3.2.1.tar.gz
2064- cd BackupPC-3.2.1
2065- perl configure.pl</pre>
2066-<p>In the future this release might also have patches available on the
2067-SourceForge site. These patch files are text files, with a name of
2068-the form</p>
2069-<pre>
2070- BackupPC-3.2.1plN.diff</pre>
2071-<p>where N is the patch level, eg: pl2 is patch-level 2. These
2072-patch files are cumulative: you only need apply the last patch
2073-file, not all the earlier patch files. If a patch file is
2074-available, eg: BackupPC-3.2.1pl2.diff, you should apply
2075-the patch after extracting the tar file:</p>
2076-<pre>
2077- # fetch BackupPC-3.2.1.tar.gz
2078- # fetch BackupPC-3.2.1pl2.diff
2079- tar zxf BackupPC-3.2.1.tar.gz
2080- cd BackupPC-3.2.1
2081- patch -p0 &lt; ../BackupPC-3.2.1pl2.diff
2082- perl configure.pl</pre>
2083-<p>A patch file includes comments that describe that bug fixes
2084-and changes. Feel free to review it before you apply the patch.</p>
2085-<p>The configure.pl script also accepts command-line options if you
2086-wish to run it in a non-interactive manner. It has self-contained
2087-documentation for all the command-line options, which you can
2088-read with perldoc:</p>
2089-<pre>
2090- perldoc configure.pl</pre>
2091-<p>Starting with BackupPC 3.0.0, the configure.pl script by default
2092-complies with the file system hierarchy (FHS) conventions. The
2093-major difference compared to earlier versions is that by default
2094-configuration files will be stored in /etc/BackupPC
2095-rather than below the data directory, __TOPDIR__/conf,
2096-and the log files will be stored in /var/log/BackupPC
2097-rather than below the data directory, __TOPDIR__/log.</p>
2098-<p>Note that distributions may choose to use different locations for
2099-BackupPC files than these defaults.</p>
2100-<p>If you are upgrading from an earlier version the configure.pl script
2101-will keep the configuration files and log files in their original
2102-location.</p>
2103-<p>When you run configure.pl you will be prompted for the full paths
2104-of various executables, and you will be prompted for the following
2105-information.</p>
2106+
2107+<p>Now let&#39;s move onto BackupPC itself. After fetching BackupPC-3.3.0.tar.gz, run these commands as root:</p>
2108+
2109+<pre><code> tar zxf BackupPC-3.3.0.tar.gz
2110+ cd BackupPC-3.3.0
2111+ perl configure.pl</code></pre>
2112+
2113+<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>
2114+
2115+<pre><code> BackupPC-3.3.0plN.diff</code></pre>
2116+
2117+<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>
2118+
2119+<pre><code> # fetch BackupPC-3.3.0.tar.gz
2120+ # fetch BackupPC-3.3.0pl2.diff
2121+ tar zxf BackupPC-3.3.0.tar.gz
2122+ cd BackupPC-3.3.0
2123+ patch -p0 &lt; ../BackupPC-3.3.0pl2.diff
2124+ perl configure.pl</code></pre>
2125+
2126+<p>A patch file includes comments that describe that bug fixes and changes. Feel free to review it before you apply the patch.</p>
2127+
2128+<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>
2129+
2130+<pre><code> perldoc configure.pl</code></pre>
2131+
2132+<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>
2133+
2134+<p>Note that distributions may choose to use different locations for BackupPC files than these defaults.</p>
2135+
2136+<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>
2137+
2138+<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>
2139+
2140 <dl>
2141-<dt><strong><a name="backuppc_user" class="item">BackupPC User</a></strong></dt>
2142
2143+<dt id="BackupPC-User">BackupPC User</dt>
2144 <dd>
2145-<p>It is best if BackupPC runs as a special user, eg backuppc, that has
2146-limited privileges. It is preferred that backuppc belongs to a system
2147-administrator group so that sys admin members can browse BackupPC files,
2148-edit the configuration files and so on. Although configurable, the
2149-default settings leave group read permission on pool files, so make
2150-sure the BackupPC user's group is chosen restrictively.</p>
2151+
2152+<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>
2153+
2154 <p>On this installation, this is __BACKUPPCUSER__.</p>
2155-<p>For security purposes you might choose to configure the BackupPC
2156-user with the shell set to /bin/false. Since you might need to
2157-run some BackupPC programs as the BackupPC user for testing
2158-purposes, you can use the -s option to su to explicitly run
2159-a shell, eg:</p>
2160-<pre>
2161- su -s /bin/bash __BACKUPPCUSER__</pre>
2162+
2163+<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>
2164+
2165+<pre><code> su -s /bin/bash __BACKUPPCUSER__</code></pre>
2166+
2167 <p>Depending upon your configuration you might also need the -l option.</p>
2168+
2169 </dd>
2170-<dt><strong><a name="data_directory" class="item">Data Directory</a></strong></dt>
2171-
2172+<dt id="Data-Directory">Data Directory</dt>
2173 <dd>
2174-<p>You need to decide where to put the data directory, below which
2175-all the BackupPC data is stored. This needs to be a big file system.</p>
2176+
2177+<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>
2178+
2179 <p>On this installation, this is __TOPDIR__.</p>
2180+
2181 </dd>
2182-<dt><strong><a name="install_directory" class="item">Install Directory</a></strong></dt>
2183-
2184+<dt id="Install-Directory">Install Directory</dt>
2185 <dd>
2186-<p>You should decide where the BackupPC scripts, libraries and documentation
2187-should be installed, eg: /usr/local/BackupPC.</p>
2188+
2189+<p>You should decide where the BackupPC scripts, libraries and documentation should be installed, eg: /usr/local/BackupPC.</p>
2190+
2191 <p>On this installation, this is __INSTALLDIR__.</p>
2192+
2193 </dd>
2194-<dt><strong><a name="cgi_bin_directory" class="item">CGI bin Directory</a></strong></dt>
2195-
2196+<dt id="CGI-bin-Directory">CGI bin Directory</dt>
2197 <dd>
2198-<p>You should decide where the BackupPC CGI script resides. This will
2199-usually be below Apache's cgi-bin directory.</p>
2200-<p>It is also possible to use a different directory and use Apache's
2201-``&lt;Directory&gt;'' directive to specifiy that location. See the Apache
2202-HTTP Server documentation for additional information.</p>
2203+
2204+<p>You should decide where the BackupPC CGI script resides. This will usually be below Apache&#39;s cgi-bin directory.</p>
2205+
2206+<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>
2207+
2208 <p>On this installation, this is __CGIDIR__.</p>
2209-</dd>
2210-<dt><strong><a name="apache_image_directory" class="item">Apache image Directory</a></strong></dt>
2211-
2212-<dd>
2213-<p>A directory where BackupPC's images are stored so that Apache can
2214-serve them. You should ensure this directory is readable by Apache and
2215-create a symlink to this directory from the BackupPC CGI bin Directory.</p>
2216-</dd>
2217-<dt><strong><a name="config_and_log_directories" class="item">Config and Log Directories</a></strong></dt>
2218-
2219-<dd>
2220-<p>In this installation the configuration and log directories are
2221-located in the following locations:</p>
2222-<pre>
2223- __CONFDIR__/config.pl main config file
2224+
2225+</dd>
2226+<dt id="Apache-image-Directory">Apache image Directory</dt>
2227+<dd>
2228+
2229+<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>
2230+
2231+</dd>
2232+<dt id="Config-and-Log-Directories">Config and Log Directories</dt>
2233+<dd>
2234+
2235+<p>In this installation the configuration and log directories are located in the following locations:</p>
2236+
2237+<pre><code> __CONFDIR__/config.pl main config file
2238 __CONFDIR__/hosts hosts file
2239 __CONFDIR__/pc/HOST.pl per-pc config file
2240- __LOGDIR__/BackupPC log files, pid, status</pre>
2241-<p>The configure.pl script doesn't prompt for these locations but
2242-they can be set for new installations using command-line options.</p>
2243+ __LOGDIR__/BackupPC log files, pid, status</code></pre>
2244+
2245+<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>
2246+
2247 </dd>
2248 </dl>
2249-<p>
2250-</p>
2251-<h2><a name="step_3__setting_up_config_pl">Step 3: Setting up config.pl</a></h2>
2252-<p>After running configure.pl, browse through the config file,
2253-__CONFDIR__/config.pl, and make sure all the default settings are
2254-correct. In particular, you will need to decide whether to use
2255-smb, tar,or rsync or ftp transport (or whether to set it on a
2256-per-PC basis) and set the relevant parameters for that transport
2257-method. See the section <a href="#step_5__client_setup">Client Setup</a> for
2258-more details.</p>
2259-<p>
2260-</p>
2261-<h2><a name="step_4__setting_up_the_hosts_file">Step 4: Setting up the hosts file</a></h2>
2262-<p>The file __CONFDIR__/hosts contains the list of clients to backup.
2263-BackupPC reads this file in three cases:</p>
2264+
2265+<h2 id="Step-3:-Setting-up-config.pl">Step 3: Setting up config.pl</h2>
2266+
2267+<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>
2268+
2269+<h2 id="Step-4:-Setting-up-the-hosts-file">Step 4: Setting up the hosts file</h2>
2270+
2271+<p>The file __CONFDIR__/hosts contains the list of clients to backup. BackupPC reads this file in three cases:</p>
2272+
2273 <ul>
2274-<li>
2275-<p>Upon startup.</p>
2276-</li>
2277-<li>
2278-<p>When BackupPC is sent a HUP (-1) signal. Assuming you installed the
2279-init.d script, you can also do this with &quot;/etc/init.d/backuppc reload&quot;.</p>
2280-</li>
2281-<li>
2282-<p>When the modification time of the hosts file changes. BackupPC
2283-checks the modification time once during each regular wakeup.</p>
2284+
2285+<li><p>Upon startup.</p>
2286+
2287+</li>
2288+<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>
2289+
2290+</li>
2291+<li><p>When the modification time of the hosts file changes. BackupPC checks the modification time once during each regular wakeup.</p>
2292+
2293 </li>
2294 </ul>
2295-<p>Whenever you change the hosts file (to add or remove a host) you can
2296-either do a kill -HUP BackupPC_pid or simply wait until the next regular
2297-wakeup period.</p>
2298-<p>Each line in the hosts file contains three fields, separated
2299-by white space:</p>
2300+
2301+<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>
2302+
2303+<p>Each line in the hosts file contains three fields, separated by white space:</p>
2304+
2305 <dl>
2306-<dt><strong><a name="host_name" class="item">Host name</a></strong></dt>
2307
2308+<dt id="Host-name">Host name</dt>
2309 <dd>
2310-<p>This is typically the host name or NetBios name of the client machine
2311-and should be in lower case. The host name can contain spaces (escape
2312-with a backslash), but it is not recommended.</p>
2313-<p>Please read the section <a href="#how_backuppc_finds_hosts">How BackupPC Finds Hosts</a>.</p>
2314-<p>In certain cases you might want several distinct clients to refer
2315-to the same physical machine. For example, you might have a database
2316-you want to backup, and you want to bracket the backup of the database
2317-with shutdown/restart using <a href="#_conf_dumppreusercmd_">$Conf{DumpPreUserCmd}</a> and <a href="#_conf_dumppostusercmd_">$Conf{DumpPostUserCmd}</a>.
2318-But you also want to backup the rest of the machine while the database
2319-is still running. In the case you can specify two different clients in
2320-the host file, using any mnemonic name (eg: myhost_mysql and myhost), and
2321-use <a href="#_conf_clientnamealias_">$Conf{ClientNameAlias}</a> in myhost_mysql's config.pl to specify the
2322-real host name of the machine.</p>
2323+
2324+<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>
2325+
2326+<p>Please read the section <a href="#How-BackupPC-Finds-Hosts">&quot;How BackupPC Finds Hosts&quot;</a>.</p>
2327+
2328+<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>
2329+
2330 </dd>
2331-<dt><strong><a name="dhcp_flag" class="item">DHCP flag</a></strong></dt>
2332-
2333+<dt id="DHCP-flag">DHCP flag</dt>
2334 <dd>
2335-<p>Starting with v2.0.0 the way hosts are discovered has changed and now
2336-in most cases you should specify 0 for the DHCP flag, even if the host
2337-has a dynamically assigned IP address.
2338-Please read the section <a href="#how_backuppc_finds_hosts">How BackupPC Finds Hosts</a>
2339-to understand whether you need to set the DHCP flag.</p>
2340-<p>You only need to set DHCP to 1 if your client machine doesn't
2341-respond to the NetBios multicast request:</p>
2342-<pre>
2343- nmblookup myHost</pre>
2344+
2345+<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>
2346+
2347+<p>You only need to set DHCP to 1 if your client machine doesn&#39;t respond to the NetBios multicast request:</p>
2348+
2349+<pre><code> nmblookup myHost</code></pre>
2350+
2351 <p>but does respond to a request directed to its IP address:</p>
2352-<pre>
2353- nmblookup -A W.X.Y.Z</pre>
2354-<p>If you do set DHCP to 1 on any client you will need to specify the range of
2355-DHCP addresses to search is specified in <a href="#_conf_dhcpaddressranges_">$Conf{DHCPAddressRanges}</a>.</p>
2356-<p>Note also that the <a href="#_conf_clientnamealias_">$Conf{ClientNameAlias}</a> feature does not work for
2357-clients with DHCP set to 1.</p>
2358-</dd>
2359-<dt><strong><a name="user_name" class="item">User name</a></strong></dt>
2360-
2361-<dd>
2362-<p>This should be the unix login/email name of the user who &quot;owns&quot; or uses
2363-this machine. This is the user who will be sent email about this
2364-machine, and this user will have permission to stop/start/browse/restore
2365-backups for this host. Leave this blank if no specific person should
2366-receive email or be allowed to stop/start/browse/restore backups
2367-for this host. Administrators will still have full permissions.</p>
2368-</dd>
2369-<dt><strong><a name="more_users" class="item">More users</a></strong></dt>
2370-
2371-<dd>
2372-<p>Additional user names, separate by commas and with no white space,
2373-can be specified. These users will also have full permission in
2374-the CGI interface to stop/start/browse/restore backups for this host.
2375-These users will not be sent email about this host.</p>
2376+
2377+<pre><code> nmblookup -A W.X.Y.Z</code></pre>
2378+
2379+<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>
2380+
2381+<p>Note also that the <a href="#_conf_clientnamealias_">$Conf{ClientNameAlias}</a> feature does not work for clients with DHCP set to 1.</p>
2382+
2383+</dd>
2384+<dt id="User-name">User name</dt>
2385+<dd>
2386+
2387+<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>
2388+
2389+</dd>
2390+<dt id="More-users">More users</dt>
2391+<dd>
2392+
2393+<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>
2394+
2395 </dd>
2396 </dl>
2397-<p>The first non-comment line of the hosts file is special: it contains
2398-the names of the columns and should not be edited.</p>
2399-<p>Here's a simple example of a hosts file:</p>
2400-<pre>
2401- host dhcp user moreUsers
2402+
2403+<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>
2404+
2405+<p>Here&#39;s a simple example of a hosts file:</p>
2406+
2407+<pre><code> host dhcp user moreUsers
2408 farside 0 craig jim,dave
2409- larson 1 gary andy</pre>
2410-<p>
2411-</p>
2412-<h2><a name="step_5__client_setup">Step 5: Client Setup</a></h2>
2413-<p>Four methods for getting backup data from a client are supported:
2414-smb, tar, rsync and ftp. Smb or rsync are the preferred methods
2415-for WinXX clients and rsync or tar are the preferred methods for
2416-linux/unix/MacOSX clients.</p>
2417-<p>The transfer method is set using the <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> configuration
2418-setting. If you have a mixed environment (ie: you will use smb for some
2419-clients and tar for others), you will need to pick the most common
2420-choice for <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> for the main config.pl file, and then
2421-override it in the per-PC config file for those hosts that will use
2422-the other method. (Or you could run two completely separate instances
2423-of BackupPC, with different data directories, one for WinXX and the
2424-other for linux/unix, but then common files between the different
2425-machine types will duplicated.)</p>
2426+ larson 1 gary andy</code></pre>
2427+
2428+<h2 id="Step-5:-Client-Setup">Step 5: Client Setup</h2>
2429+
2430+<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>
2431+
2432+<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>
2433+
2434 <p>Here are some brief client setup notes:</p>
2435+
2436 <dl>
2437-<dt><strong><a name="winxx" class="item">WinXX</a></strong></dt>
2438
2439+<dt id="WinXX">WinXX</dt>
2440 <dd>
2441-<p>One setup for WinXX clients is to set <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> to &quot;smb&quot;.
2442-Actually, rsyncd is the better method for WinXX if you are prepared to
2443-run rsync/cygwin on your WinXX client.</p>
2444-<p>If you want to use rsyncd for WinXX clients you can find a pre-packaged
2445-zip file on <a href="http://backuppc.sourceforge.net">http://backuppc.sourceforge.net</a>. The package is called
2446-cygwin-rsync. It contains rsync.exe, template setup files and the
2447-minimal set of cygwin libraries for everything to run. The README file
2448-contains instructions for running rsync as a service, so it starts
2449-automatically everytime you boot your machine. If you use rsync
2450-to backup WinXX machines, be sure to set <a href="#_conf_clientcharset_">$Conf{ClientCharset}</a>
2451-correctly (eg: 'cp1252') so that the WinXX file name encoding is
2452-correctly converted to utf8.</p>
2453-<p>Otherwise, to use SMB, you can either create shares for the data you want
2454-to backup or your can use the existing C$ share. To create a new
2455-share, open &quot;My Computer&quot;, right click on the drive (eg: C), and
2456-select &quot;Sharing...&quot; (or select &quot;Properties&quot; and select the &quot;Sharing&quot;
2457-tab). In this dialog box you can enable sharing, select the share name
2458-and permissions.</p>
2459-<p>All Windows NT based OS (NT, 2000, XP Pro), are configured by default
2460-to share the entire C drive as C$. This is a special share used for
2461-various administration functions, one of which is to grant access to backup
2462-operators. All you need to do is create a new domain user, specifically
2463-for backup. Then add the new backup user to the built in &quot;Backup
2464-Operators&quot; group. You now have backup capability for any directory on
2465-any computer in the domain in one easy step. This avoids using
2466-administrator accounts and only grants permission to do exactly what you
2467-want for the given user, i.e.: backup.
2468-Also, for additional security, you may wish to deny the ability for this
2469-user to logon to computers in the default domain policy.</p>
2470-<p>If this machine uses DHCP you will also need to make sure the
2471-NetBios name is set. Go to Control Panel|System|Network Identification
2472-(on Win2K) or Control Panel|System|Computer Name (on WinXP).
2473-Also, you should go to Control Panel|Network Connections|Local Area
2474-Connection|Properties|Internet Protocol (TCP/IP)|Properties|Advanced|WINS
2475-and verify that NetBios is not disabled.</p>
2476-<p>The relevant configuration settings are <a href="#_conf_smbsharename_">$Conf{SmbShareName}</a>,
2477-<a href="#_conf_smbshareusername_">$Conf{SmbShareUserName}</a>, <a href="#_conf_smbsharepasswd_">$Conf{SmbSharePasswd}</a>, <a href="#_conf_smbclientpath_">$Conf{SmbClientPath}</a>,
2478-<a href="#_conf_smbclientfullcmd_">$Conf{SmbClientFullCmd}</a>, <a href="#_conf_smbclientincrcmd_">$Conf{SmbClientIncrCmd}</a> and
2479-<a href="#_conf_smbclientrestorecmd_">$Conf{SmbClientRestoreCmd}</a>.</p>
2480-<p>BackupPC needs to know the smb share user name and password for a
2481-client machine that uses smb. The user name is specified in
2482-<a href="#_conf_smbshareusername_">$Conf{SmbShareUserName}</a>. There are four ways to tell BackupPC the
2483-smb share password:</p>
2484+
2485+<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>
2486+
2487+<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>
2488+
2489+<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>
2490+
2491+<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>
2492+
2493+<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>
2494+
2495+<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>
2496+
2497+<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>
2498+
2499 <ul>
2500-<li>
2501-<p>As an environment variable BPC_SMB_PASSWD set before BackupPC starts.
2502-If you start BackupPC manually the BPC_SMB_PASSWD variable must be set
2503-manually first. For backward compatibility for v1.5.0 and prior, the
2504-environment variable PASSWD can be used if BPC_SMB_PASSWD is not set.
2505-Warning: on some systems it is possible to see environment variables of
2506-running processes.</p>
2507-</li>
2508-<li>
2509-<p>Alternatively the BPC_SMB_PASSWD setting can be included in
2510-/etc/init.d/backuppc, in which case you must make sure this file
2511-is not world (other) readable.</p>
2512-</li>
2513-<li>
2514-<p>As a configuration variable <a href="#_conf_smbsharepasswd_">$Conf{SmbSharePasswd}</a> in
2515-__CONFDIR__/config.pl. If you put the password
2516-here you must make sure this file is not world (other) readable.</p>
2517-</li>
2518-<li>
2519-<p>As a configuration variable <a href="#_conf_smbsharepasswd_">$Conf{SmbSharePasswd}</a> in the per-PC
2520-configuration file (__CONFDIR__/pc/$host.pl or
2521-__TOPDIR__/pc/$host/config.pl in non-FHS versions of BackupPC).
2522-You will have to use this option if the smb share password is different
2523-for each host. If you put the password here you must make sure this file
2524-is not world (other) readable.</p>
2525+
2526+<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>
2527+
2528+</li>
2529+<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>
2530+
2531+</li>
2532+<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>
2533+
2534+</li>
2535+<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>
2536+
2537 </li>
2538 </ul>
2539-<p>Placement and protection of the smb share password is a possible
2540-security risk, so please double-check the file and directory
2541-permissions. In a future version there might be support for
2542-encryption of this password, but a private key will still have to
2543-be stored in a protected place. Suggestions are welcome.</p>
2544-<p>As an alternative to setting <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> to &quot;smb&quot; (using
2545-smbclient) for WinXX clients, you can use an smb network filesystem (eg:
2546-ksmbfs or similar) on your linux/unix server to mount the share,
2547-and then set <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> to &quot;tar&quot; (use tar on the network
2548-mounted file system).</p>
2549-<p>Also, to make sure that file names with special characters are correctly
2550-transferred by smbclient you should make sure that the smb.conf file
2551-has (for samba 3.x):</p>
2552-<pre>
2553- [global]
2554- unix charset = UTF8</pre>
2555-<p>UTF8 is the default setting, so if the parameter is missing then it
2556-is ok. With this setting <a href="#_conf_clientcharset_">$Conf{ClientCharset}</a> should be emtpy,
2557-since smbclient has already converted the file names to utf8.</p>
2558+
2559+<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>
2560+
2561+<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>
2562+
2563+<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>
2564+
2565+<pre><code> [global]
2566+ unix charset = UTF8</code></pre>
2567+
2568+<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>
2569+
2570 </dd>
2571-<dt><strong><a name="linux_unix" class="item">Linux/Unix</a></strong></dt>
2572-
2573+<dt id="Linux-Unix">Linux/Unix</dt>
2574 <dd>
2575-<p>The preferred setup for linux/unix clients is to set <a href="#_conf_xfermethod_">$Conf{XferMethod}</a>
2576-to &quot;rsync&quot;, &quot;rsyncd&quot; or &quot;tar&quot;.</p>
2577-<p>You can use either rsync, smb, or tar for linux/unix machines. Smb requires
2578-that the Samba server (smbd) be run to provide the shares. Since the smb
2579-protocol can't represent special files like symbolic links and fifos,
2580-tar and rsync are the better transport methods for linux/unix machines.
2581-(In fact, by default samba makes symbolic links look like the file or
2582-directory that they point to, so you could get an infinite loop if a
2583-symbolic link points to the current or parent directory. If you really
2584-need to use Samba shares for linux/unix backups you should turn off the
2585-&quot;follow symlinks&quot; samba config setting. See the smb.conf manual page.)</p>
2586+
2587+<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>
2588+
2589+<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>
2590+
2591 <p>The requirements for each Xfer Method are:</p>
2592+
2593 <dl>
2594-<dt><strong><a name="tar" class="item">tar</a></strong></dt>
2595-
2596-<dd>
2597-<p>You must have GNU tar on the client machine. Use &quot;tar --version&quot;
2598-or &quot;gtar --version&quot; to verify. The version should be at least
2599-1.13.7, and 1.13.20 or greater is recommended. Tar is run on
2600-the client machine via rsh or ssh.</p>
2601-<p>The relevant configuration settings are <a href="#_conf_tarclientpath_">$Conf{TarClientPath}</a>,
2602-<a href="#_conf_tarsharename_">$Conf{TarShareName}</a>, <a href="#_conf_tarclientcmd_">$Conf{TarClientCmd}</a>, <a href="#_conf_tarfullargs_">$Conf{TarFullArgs}</a>,
2603-<a href="#_conf_tarincrargs_">$Conf{TarIncrArgs}</a>, and <a href="#_conf_tarclientrestorecmd_">$Conf{TarClientRestoreCmd}</a>.</p>
2604-</dd>
2605-<dt><strong><a name="rsync" class="item">rsync</a></strong></dt>
2606-
2607-<dd>
2608-<p>You should have at least rsync 2.6.3, and the latest version is
2609-recommended. Rsync is run on the remote client via rsh or ssh.</p>
2610-<p>The relevant configuration settings are <a href="#_conf_rsyncclientpath_">$Conf{RsyncClientPath}</a>,
2611-<a href="#_conf_rsyncclientcmd_">$Conf{RsyncClientCmd}</a>, <a href="#_conf_rsyncclientrestorecmd_">$Conf{RsyncClientRestoreCmd}</a>, <a href="#_conf_rsyncsharename_">$Conf{RsyncShareName}</a>,
2612-<a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a>, and <a href="#_conf_rsyncrestoreargs_">$Conf{RsyncRestoreArgs}</a>.</p>
2613-</dd>
2614-<dt><strong><a name="rsyncd" class="item">rsyncd</a></strong></dt>
2615-
2616-<dd>
2617-<p>You should have at least rsync 2.6.3, and the latest version is
2618-recommended. In this case the rsync daemon should be running on
2619-the client machine and BackupPC connects directly to it.</p>
2620-<p>The relevant configuration settings are <a href="#_conf_rsyncdclientport_">$Conf{RsyncdClientPort}</a>,
2621-<a href="#_conf_rsyncdusername_">$Conf{RsyncdUserName}</a>, <a href="#_conf_rsyncdpasswd_">$Conf{RsyncdPasswd}</a>, <a href="#_conf_rsyncdauthrequired_">$Conf{RsyncdAuthRequired}</a>,
2622-<a href="#_conf_rsyncsharename_">$Conf{RsyncShareName}</a>, <a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a>, <a href="#_conf_rsyncargsextra_">$Conf{RsyncArgsExtra}</a>, and
2623-<a href="#_conf_rsyncrestoreargs_">$Conf{RsyncRestoreArgs}</a>. <a href="#_conf_rsyncsharename_">$Conf{RsyncShareName}</a> is the name of an rsync
2624-module (ie: the thing in square brackets in rsyncd's conf file -- see
2625-rsyncd.conf), not a file system path.</p>
2626-<p>Be aware that rsyncd will remove the leading '/' from path names in
2627-symbolic links if you specify &quot;use chroot = no&quot; in the rsynd.conf file.
2628-See the rsyncd.conf manual page for more information.</p>
2629-</dd>
2630-<dt><strong><a name="ftp" class="item">ftp</a></strong></dt>
2631-
2632-<dd>
2633-<p>You need to be running an ftp server on the client machine.
2634-The relevant configuration settings are <a href="#_conf_ftpsharename_">$Conf{FtpShareName}</a>,
2635-<a href="#_conf_ftpusername_">$Conf{FtpUserName}</a>, <a href="#_conf_ftppasswd_">$Conf{FtpPasswd}</a>, <a href="#_conf_ftpblocksize_">$Conf{FtpBlockSize}</a>,
2636-<a href="#_conf_ftpport_">$Conf{FtpPort}</a>, <a href="#_conf_ftptimeout_">$Conf{FtpTimeout}</a>, and <a href="#_conf_ftpfollowsymlinks_">$Conf{FtpFollowSymlinks}</a>.</p>
2637-</dd>
2638-</dl>
2639-<p>You need to set <a href="#_conf_clientcharset_">$Conf{ClientCharset}</a> to the client's charset so that
2640-file names are correctly converted to utf8. Use &quot;locale charmap&quot;
2641-on the client to see its charset.</p>
2642-<p>For linux/unix machines you should not backup &quot;/proc&quot;. This directory
2643-contains a variety of files that look like regular files but they are
2644-special files that don't need to be backed up (eg: /proc/kcore is a
2645-regular file that contains physical memory). See <a href="#_conf_backupfilesexclude_">$Conf{BackupFilesExclude}</a>.
2646-It is safe to back up /dev since it contains mostly character-special
2647-and block-special files, which are correctly handed by BackupPC
2648-(eg: backing up /dev/hda5 just saves the block-special file information,
2649-not the contents of the disk).</p>
2650-<p>Alternatively, rather than backup all the file systems as a single
2651-share (&quot;/&quot;), it is easier to restore a single file system if you backup
2652-each file system separately. To do this you should list each file system
2653-mount point in <a href="#_conf_tarsharename_">$Conf{TarShareName}</a> or <a href="#_conf_rsyncsharename_">$Conf{RsyncShareName}</a>, and add the
2654---one-file-system option to <a href="#_conf_tarclientcmd_">$Conf{TarClientCmd}</a> or <a href="#_conf_rsyncargs_">$Conf{RsyncArgs}</a>.
2655-In this case there is no need to exclude /proc explicitly since it looks
2656-like a different file system.</p>
2657-<p>Next you should decide whether to run tar over ssh, rsh or nfs. Ssh is
2658-the preferred method. Rsh is not secure and therefore not recommended.
2659-Nfs will work, but you need to make sure that the BackupPC user (running
2660-on the server) has sufficient permissions to read all the files below
2661-the nfs mount.</p>
2662-<p>Ssh allows BackupPC to run as a privileged user on the client (eg:
2663-root), since it needs sufficient permissions to read all the backup
2664-files. Ssh is setup so that BackupPC on the server (an otherwise low
2665-privileged user) can ssh as root on the client, without being prompted
2666-for a password. There are two common versions of ssh: v1 and v2. Here
2667-are some instructions for one way to setup ssh. (Check which version
2668-of SSH you have by typing &quot;ssh&quot; or &quot;man ssh&quot;.)</p>
2669-</dd>
2670-<dt><strong><a name="macosx" class="item">MacOSX</a></strong></dt>
2671-
2672-<dd>
2673-<p>In general this should be similar to Linux/Unix machines.
2674-In versions 10.4 and later, the native MacOSX tar works,
2675-and also supports resource forks. xtar is another option,
2676-and rsync works too (although the MacOSX-supplied rsync
2677-has an extension for extended attributes that is not
2678-compatible with standard rsync).</p>
2679-</dd>
2680-<dt><strong><a name="ssh_setup" class="item">SSH Setup</a></strong></dt>
2681-
2682-<dd>
2683-<p>SSH is a secure way to run tar or rsync on a backup client to extract
2684-the data. SSH provides strong authentication and encryption of
2685-the network data.</p>
2686-<p>Note that if you run rsyncd (rsync daemon), ssh is not used.
2687-In this case, rsyncd provides its own authentication, but there
2688-is no encryption of network data. If you want encryption of
2689-network data you can use ssh to create a tunnel, or use a
2690-program like stunnel.</p>
2691-<p>Setup instructions for ssh can be found at
2692-<a href="http://backuppc.sourceforge.net/faq/ssh.html">http://backuppc.sourceforge.net/faq/ssh.html</a> or on the Wiki.</p>
2693-</dd>
2694-<dt><strong><a name="clients_that_use_dhcp" class="item">Clients that use DHCP</a></strong></dt>
2695-
2696-<dd>
2697-<p>If a client machine uses DHCP BackupPC needs some way to find the
2698-IP address given the host name. One alternative is to set dhcp
2699-to 1 in the hosts file, and BackupPC will search a pool of IP
2700-addresses looking for hosts. More efficiently, it is better to
2701-set dhcp = 0 and provide a mechanism for BackupPC to find the
2702-IP address given the host name.</p>
2703-<p>For WinXX machines BackupPC uses the NetBios name server to determine
2704-the IP address given the host name.
2705-For unix machines you can run nmbd (the NetBios name server) from
2706-the Samba distribution so that the machine responds to a NetBios
2707-name request. See the manual page and Samba documentation for more
2708-information.</p>
2709-<p>Alternatively, you can set <a href="#_conf_nmblookupfindhostcmd_">$Conf{NmbLookupFindHostCmd}</a> to any command
2710-that returns the IP address given the host name.</p>
2711-<p>Please read the section <a href="#how_backuppc_finds_hosts">How BackupPC Finds Hosts</a>
2712-for more details.</p>
2713-</dd>
2714-</dl>
2715-<p>
2716-</p>
2717-<h2><a name="step_6__running_backuppc">Step 6: Running BackupPC</a></h2>
2718-<p>The installation contains an init.d backuppc script that can be copied
2719-to /etc/init.d so that BackupPC can auto-start on boot.
2720-See init.d/README for further instructions.</p>
2721-<p>BackupPC should be ready to start. If you installed the init.d script,
2722-then you should be able to run BackupPC with:</p>
2723-<pre>
2724- /etc/init.d/backuppc start</pre>
2725-<p>(This script can also be invoked with &quot;stop&quot; to stop BackupPC and &quot;reload&quot;
2726-to tell BackupPC to reload config.pl and the hosts file.)</p>
2727+
2728+<dt id="tar">tar</dt>
2729+<dd>
2730+
2731+<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>
2732+
2733+<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>
2734+
2735+</dd>
2736+<dt id="rsync">rsync</dt>
2737+<dd>
2738+
2739+<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>
2740+
2741+<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>
2742+
2743+</dd>
2744+<dt id="rsyncd">rsyncd</dt>
2745+<dd>
2746+
2747+<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>
2748+
2749+<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>
2750+
2751+<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>
2752+
2753+</dd>
2754+<dt id="ftp">ftp</dt>
2755+<dd>
2756+
2757+<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>
2758+
2759+</dd>
2760+</dl>
2761+
2762+<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>
2763+
2764+<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>
2765+
2766+<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>
2767+
2768+<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>
2769+
2770+<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>
2771+
2772+</dd>
2773+<dt id="MacOSX">MacOSX</dt>
2774+<dd>
2775+
2776+<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>
2777+
2778+</dd>
2779+<dt id="SSH-Setup">SSH Setup</dt>
2780+<dd>
2781+
2782+<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>
2783+
2784+<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>
2785+
2786+<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>
2787+
2788+</dd>
2789+<dt id="Clients-that-use-DHCP">Clients that use DHCP</dt>
2790+<dd>
2791+
2792+<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>
2793+
2794+<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>
2795+
2796+<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>
2797+
2798+<p>Please read the section <a href="#How-BackupPC-Finds-Hosts">&quot;How BackupPC Finds Hosts&quot;</a> for more details.</p>
2799+
2800+</dd>
2801+</dl>
2802+
2803+<h2 id="Step-6:-Running-BackupPC">Step 6: Running BackupPC</h2>
2804+
2805+<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>
2806+
2807+<p>BackupPC should be ready to start. If you installed the init.d script, then you should be able to run BackupPC with:</p>
2808+
2809+<pre><code> /etc/init.d/backuppc start</code></pre>
2810+
2811+<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>
2812+
2813 <p>Otherwise, just run</p>
2814-<pre>
2815- __INSTALLDIR__/bin/BackupPC -d</pre>
2816-<p>as user __BACKUPPCUSER__. The -d option tells BackupPC to run as a daemon
2817-(ie: it does an additional fork).</p>
2818-<p>Any immediate errors will be printed to stderr and BackupPC will quit.
2819-Otherwise, look in __LOGDIR__/LOG and verify that BackupPC reports
2820-it has started and all is ok.</p>
2821-<p>
2822-</p>
2823-<h2><a name="step_7__talking_to_backuppc">Step 7: Talking to BackupPC</a></h2>
2824-<p>You should verify that BackupPC is running by using BackupPC_serverMesg.
2825-This sends a message to BackupPC via the unix (or TCP) socket and prints
2826-the response. Like all BackupPC programs, BackupPC_serverMesg
2827-should be run as the BackupPC user (__BACKUPPCUSER__), so you
2828-should</p>
2829-<pre>
2830- su __BACKUPPCUSER__</pre>
2831-<p>before running BackupPC_serverMesg. If the BackupPC user is
2832-configured with /bin/false as the shell, you can use the -s
2833-option to su to explicitly run a shell, eg:</p>
2834-<pre>
2835- su -s /bin/bash __BACKUPPCUSER__</pre>
2836-<p>Depending upon your configuration you might also need
2837-the -l option.</p>
2838-<p>You can request status information and start and stop backups using this
2839-interface. This socket interface is mainly provided for the CGI interface
2840-(and some of the BackupPC sub-programs use it too). But right now we just
2841-want to make sure BackupPC is happy. Each of these commands should
2842-produce some status output:</p>
2843-<pre>
2844- __INSTALLDIR__/bin/BackupPC_serverMesg status info
2845+
2846+<pre><code> __INSTALLDIR__/bin/BackupPC -d</code></pre>
2847+
2848+<p>as user __BACKUPPCUSER__. The -d option tells BackupPC to run as a daemon (ie: it does an additional fork).</p>
2849+
2850+<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>
2851+
2852+<h2 id="Step-7:-Talking-to-BackupPC">Step 7: Talking to BackupPC</h2>
2853+
2854+<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>
2855+
2856+<pre><code> su __BACKUPPCUSER__</code></pre>
2857+
2858+<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>
2859+
2860+<pre><code> su -s /bin/bash __BACKUPPCUSER__</code></pre>
2861+
2862+<p>Depending upon your configuration you might also need the -l option.</p>
2863+
2864+<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>
2865+
2866+<pre><code> __INSTALLDIR__/bin/BackupPC_serverMesg status info
2867 __INSTALLDIR__/bin/BackupPC_serverMesg status jobs
2868- __INSTALLDIR__/bin/BackupPC_serverMesg status hosts</pre>
2869-<p>The output should be some hashes printed with Data::Dumper. If it
2870-looks cryptic and confusing, and doesn't look like an error message,
2871-then all is ok.</p>
2872-<p>The jobs status should initially show just BackupPC_trashClean.
2873-The hosts status should produce a list of every host you have listed
2874-in __CONFDIR__/hosts as part of a big cryptic output line.</p>
2875+ __INSTALLDIR__/bin/BackupPC_serverMesg status hosts</code></pre>
2876+
2877+<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>
2878+
2879+<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>
2880+
2881 <p>You can also request that all hosts be queued:</p>
2882-<pre>
2883- __INSTALLDIR__/bin/BackupPC_serverMesg backup all</pre>
2884-<p>At this point you should make sure the CGI interface works since
2885-it will be much easier to see what is going on. That's our
2886-next subject.</p>
2887-<p>
2888-</p>
2889-<h2><a name="step_8__checking_email_delivery">Step 8: Checking email delivery</a></h2>
2890-<p>The script BackupPC_sendEmail sends status and error emails to
2891-the administrator and users. It is usually run each night
2892-by BackupPC_nightly.</p>
2893-<p>To verify that it can run sendmail and deliver email correctly
2894-you should ask it to send a test email to you:</p>
2895-<pre>
2896- su __BACKUPPCUSER__
2897- __INSTALLDIR__/bin/BackupPC_sendEmail -u MYNAME@MYDOMAIN.COM</pre>
2898-<p>BackupPC_sendEmail also takes a -c option that checks if BackupPC
2899-is running, and it sends an email to <a href="#_conf_emailadminusername_">$Conf{EMailAdminUserName}</a>
2900-if it is not. That can be used as a keep-alive check by adding</p>
2901-<pre>
2902- __INSTALLDIR__/bin/BackupPC_sendEmail -c</pre>
2903-<p>to __BACKUPPCUSER__'s cron.</p>
2904-<p>The -t option to BackupPC_sendEmail causes it to print the email
2905-message instead of invoking sendmail to deliver the message.</p>
2906-<p>
2907-</p>
2908-<h2><a name="step_9__cgi_interface">Step 9: CGI interface</a></h2>
2909-<p>The CGI interface script, BackupPC_Admin, is a powerful and flexible
2910-way to see and control what BackupPC is doing. It is written for an
2911-Apache server. If you don't have Apache, see <a href="http://www.apache.org">http://www.apache.org</a>.</p>
2912-<p>There are two options for setting up the CGI interface: standard
2913-mode and using mod_perl. Mod_perl provides much higher performance
2914-(around 15x) and is the best choice if your Apache was built with
2915-mod_perl support. To see if your apache was built with mod_perl
2916-run this command:</p>
2917-<pre>
2918- httpd -l | egrep mod_perl</pre>
2919+
2920+<pre><code> __INSTALLDIR__/bin/BackupPC_serverMesg backup all</code></pre>
2921+
2922+<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>
2923+
2924+<h2 id="Step-8:-Checking-email-delivery">Step 8: Checking email delivery</h2>
2925+
2926+<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>
2927+
2928+<p>To verify that it can run sendmail and deliver email correctly you should ask it to send a test email to you:</p>
2929+
2930+<pre><code> su __BACKUPPCUSER__
2931+ __INSTALLDIR__/bin/BackupPC_sendEmail -u MYNAME@MYDOMAIN.COM</code></pre>
2932+
2933+<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>
2934+
2935+<pre><code> __INSTALLDIR__/bin/BackupPC_sendEmail -c</code></pre>
2936+
2937+<p>to __BACKUPPCUSER__&#39;s cron.</p>
2938+
2939+<p>The -t option to BackupPC_sendEmail causes it to print the email message instead of invoking sendmail to deliver the message.</p>
2940+
2941+<h2 id="Step-9:-CGI-interface">Step 9: CGI interface</h2>
2942+
2943+<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>
2944+
2945+<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>
2946+
2947+<pre><code> httpd -l | egrep mod_perl</code></pre>
2948+
2949 <p>If this prints mod_perl.c then your Apache supports mod_perl.</p>
2950-<p>Note: on some distributions (like Debian) the command is not ``httpd'',
2951-but ``apache'' or ``apache2''. Those distributions will generally also
2952-use ``apache'' for the Apache user account and configuration files.</p>
2953-<p>Using mod_perl with BackupPC_Admin requires a dedicated Apache
2954-to be run as the BackupPC user (__BACKUPPCUSER__). This is
2955-because BackupPC_Admin needs permission to access various files
2956-in BackupPC's data directories. In contrast, the standard
2957-installation (without mod_perl) solves this problem by having
2958-BackupPC_Admin installed as setuid to the BackupPC user, so that
2959-BackupPC_Admin runs as the BackupPC user.</p>
2960+
2961+<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>
2962+
2963+<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>
2964+
2965 <p>Here are some specifics for each setup:</p>
2966+
2967 <dl>
2968-<dt><strong><a name="standard_setup" class="item">Standard Setup</a></strong></dt>
2969
2970+<dt id="Standard-Setup">Standard Setup</dt>
2971 <dd>
2972-<p>The CGI interface should have been installed by the configure.pl script
2973-in __CGIDIR__/BackupPC_Admin. BackupPC_Admin should have been installed
2974-as setuid to the BackupPC user (__BACKUPPCUSER__), in addition to user
2975-and group execute permission.</p>
2976-<p>You should be very careful about permissions on BackupPC_Admin and
2977-the directory __CGIDIR__: it is important that normal users cannot
2978-directly execute or change BackupPC_Admin, otherwise they can access
2979-backup files for any PC. You might need to change the group ownership
2980-of BackupPC_Admin to a group that Apache belongs to so that Apache
2981-can execute it (don't add &quot;other&quot; execute permission!).
2982-The permissions should look like this:</p>
2983-<pre>
2984- ls -l __CGIDIR__/BackupPC_Admin
2985- -swxr-x--- 1 __BACKUPPCUSER__ web 82406 Jun 17 22:58 __CGIDIR__/BackupPC_Admin</pre>
2986-<p>The setuid script won't work unless perl on your machine was installed
2987-with setuid emulation. This is likely the problem if you get an error
2988-saying such as &quot;Wrong user: my userid is 25, instead of 150&quot;, meaning
2989-the script is running as the httpd user, not the BackupPC user.
2990-This is because setuid scripts are disabled by the kernel in most
2991-flavors of unix and linux.</p>
2992-<p>To see if your perl has setuid emulation, see if there is a program
2993-called sperl5.8.0 (or sperl5.8.2 etc, based on your perl version)
2994-in the place where perl is installed. If you can't find this program,
2995-then you have two options: rebuild and reinstall perl with the setuid
2996-emulation turned on (answer &quot;y&quot; to the question &quot;Do you want to do
2997-setuid/setgid emulation?&quot; when you run perl's configure script), or
2998-switch to the mod_perl alternative for the CGI script (which doesn't
2999-need setuid to work).</p>
3000+
3001+<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>
3002+
3003+<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>
3004+
3005+<pre><code> ls -l __CGIDIR__/BackupPC_Admin
3006+ -swxr-x--- 1 __BACKUPPCUSER__ web 82406 Jun 17 22:58 __CGIDIR__/BackupPC_Admin</code></pre>
3007+
3008+<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>
3009+
3010+<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>
3011+
3012 </dd>
3013-<dt><strong><a name="mod_perl_setup" class="item">Mod_perl Setup</a></strong></dt>
3014-
3015+<dt id="Mod_perl-Setup">Mod_perl Setup</dt>
3016 <dd>
3017-<p>The advantage of the mod_perl setup is that no setuid script is needed,
3018-and there is a huge performance advantage. Not only does all the perl
3019-code need to be parsed just once, the config.pl and hosts files, plus
3020-the connection to the BackupPC server are cached between requests. The
3021-typical speedup is around 15 times.</p>
3022-<p>To use mod_perl you need to run Apache as user __BACKUPPCUSER__.
3023-If you need to run multiple Apache's for different services then
3024-you need to create multiple top-level Apache directories, each
3025-with their own config file. You can make copies of /etc/init.d/httpd
3026-and use the -d option to httpd to point each http to a different
3027-top-level directory. Or you can use the -f option to explicitly
3028-point to the config file. Multiple Apache's will run on different
3029-Ports (eg: 80 is standard, 8080 is a typical alternative port accessed
3030-via <a href="http://yourhost.com:8080).">http://yourhost.com:8080).</a></p>
3031-<p>Inside BackupPC's Apache http.conf file you should check the
3032-settings for ServerRoot, DocumentRoot, User, Group, and Port. See
3033-<a href="http://httpd.apache.org/docs/server-wide.html">http://httpd.apache.org/docs/server-wide.html</a> for more details.</p>
3034-<p>For mod_perl, BackupPC_Admin should not have setuid permission, so
3035-you should turn it off:</p>
3036-<pre>
3037- chmod u-s __CGIDIR__/BackupPC_Admin</pre>
3038-<p>To tell Apache to use mod_perl to execute BackupPC_Admin, add this
3039-to Apache's 1.x httpd.conf file:</p>
3040-<pre>
3041- &lt;IfModule mod_perl.c&gt;
3042+
3043+<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>
3044+
3045+<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>
3046+
3047+<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>
3048+
3049+<p>For mod_perl, BackupPC_Admin should not have setuid permission, so you should turn it off:</p>
3050+
3051+<pre><code> chmod u-s __CGIDIR__/BackupPC_Admin</code></pre>
3052+
3053+<p>To tell Apache to use mod_perl to execute BackupPC_Admin, add this to Apache&#39;s 1.x httpd.conf file:</p>
3054+
3055+<pre><code> &lt;IfModule mod_perl.c&gt;
3056 PerlModule Apache::Registry
3057 PerlTaintCheck On
3058 &lt;Location /cgi-bin/BackupPC/BackupPC_Admin&gt; # &lt;--- change path as needed
3059@@ -1273,13 +860,13 @@
3060 Options ExecCGI
3061 PerlSendHeader On
3062 &lt;/Location&gt;
3063- &lt;/IfModule&gt;</pre>
3064-<p>Apache 2.0.44 with Perl 5.8.0 on RedHat 7.1, Don Silvia reports that
3065-this works (with tweaks from Michael Tuzi):</p>
3066-<pre>
3067- LoadModule perl_module modules/mod_perl.so
3068- PerlModule Apache2</pre>
3069-<pre>
3070+ &lt;/IfModule&gt;</code></pre>
3071+
3072+<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>
3073+
3074+<pre><code> LoadModule perl_module modules/mod_perl.so
3075+ PerlModule Apache2
3076+
3077 &lt;Directory /path/to/cgi/&gt;
3078 SetHandler perl-script
3079 PerlResponseHandler ModPerl::Registry
3080@@ -1292,34 +879,28 @@
3081 AuthType Basic
3082 AuthUserFile /path/to/user_file
3083 Require valid-user
3084- &lt;/Directory&gt;</pre>
3085-<p>There are other optimizations and options with mod_perl. For
3086-example, you can tell mod_perl to preload various perl modules,
3087-which saves memory compared to loading separate copies in every
3088-Apache process after they are forked. See Stas's definitive
3089-mod_perl guide at <a href="http://perl.apache.org/guide">http://perl.apache.org/guide</a>.</p>
3090+ &lt;/Directory&gt;</code></pre>
3091+
3092+<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>
3093+
3094 </dd>
3095 </dl>
3096-<p>BackupPC_Admin requires that users are authenticated by Apache.
3097-Specifically, it expects that Apache sets the REMOTE_USER environment
3098-variable when it runs. There are several ways to do this. One way
3099-is to create a .htaccess file in the cgi-bin directory that looks like:</p>
3100-<pre>
3101- AuthGroupFile /etc/httpd/conf/group # &lt;--- change path as needed
3102+
3103+<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>
3104+
3105+<pre><code> AuthGroupFile /etc/httpd/conf/group # &lt;--- change path as needed
3106 AuthUserFile /etc/http/conf/passwd # &lt;--- change path as needed
3107 AuthType basic
3108 AuthName &quot;access&quot;
3109- require valid-user</pre>
3110-<p>You will also need &quot;AllowOverride Indexes AuthConfig&quot; in the Apache
3111-httpd.conf file to enable the .htaccess file. Alternatively, everything
3112-can go in the Apache httpd.conf file inside a Location directive. The
3113-list of users and password file above can be extracted from the NIS
3114-passwd file.</p>
3115-<p>One alternative is to use LDAP. In Apache's http.conf add these lines:</p>
3116-<pre>
3117- LoadModule auth_ldap_module modules/auth_ldap.so
3118- AddModule auth_ldap.c</pre>
3119-<pre>
3120+ require valid-user</code></pre>
3121+
3122+<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>
3123+
3124+<p>One alternative is to use LDAP. In Apache&#39;s http.conf add these lines:</p>
3125+
3126+<pre><code> LoadModule auth_ldap_module modules/auth_ldap.so
3127+ AddModule auth_ldap.c
3128+
3129 # cgi-bin - auth via LDAP (for BackupPC)
3130 &lt;Location /cgi-binBackupPC/BackupPC_Admin&gt; # &lt;--- change path as needed
3131 AuthType Basic
3132@@ -1327,297 +908,220 @@
3133 # replace MYDOMAIN, PORT, ORG and CO as needed
3134 AuthLDAPURL ldap://ldap.MYDOMAIN.com:PORT/o=ORG,c=CO?uid?sub?(objectClass=*)
3135 require valid-user
3136- &lt;/Location&gt;</pre>
3137-<p>If you want to disable the user authentication you can set
3138-<a href="#_conf_cgiadminusers_">$Conf{CgiAdminUsers}</a> to '*', which allows any user to have
3139-full access to all hosts and backups. In this case the REMOTE_USER
3140-environment variable does not have to be set by Apache.</p>
3141-<p>Alternatively, you can force a particular user name by getting Apache
3142-to set REMOTE_USER, eg, to hardcode the user to www you could add
3143-this to Apache's httpd.conf:</p>
3144-<pre>
3145- &lt;Location /cgi-bin/BackupPC/BackupPC_Admin&gt; # &lt;--- change path as needed
3146+ &lt;/Location&gt;</code></pre>
3147+
3148+<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>
3149+
3150+<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>
3151+
3152+<pre><code> &lt;Location /cgi-bin/BackupPC/BackupPC_Admin&gt; # &lt;--- change path as needed
3153 Setenv REMOTE_USER www
3154- &lt;/Location&gt;</pre>
3155-<p>Finally, you should also edit the config.pl file and adjust, as necessary,
3156-the CGI-specific settings. They're near the end of the config file. In
3157-particular, you should specify which users or groups have administrator
3158-(privileged) access: see the config settings <a href="#_conf_cgiadminusergroup_">$Conf{CgiAdminUserGroup}</a>
3159-and <a href="#_conf_cgiadminusers_">$Conf{CgiAdminUsers}</a>. Also, the configure.pl script placed various
3160-images into <a href="#_conf_cgiimagedir_">$Conf{CgiImageDir}</a> that BackupPC_Admin needs to serve
3161-up. You should make sure that <a href="#_conf_cgiimagedirurl_">$Conf{CgiImageDirURL}</a> is the correct
3162-URL for the image directory.</p>
3163-<p>See the section <a href="#fixing_installation_problems">Fixing installation problems</a> for suggestions on debugging the Apache authentication setup.</p>
3164-<p>
3165-</p>
3166-<h2><a name="how_backuppc_finds_hosts">How BackupPC Finds Hosts</a></h2>
3167-<p>Starting with v2.0.0 the way hosts are discovered has changed. In most
3168-cases you should specify 0 for the DHCP flag in the conf/hosts file,
3169-even if the host has a dynamically assigned IP address.</p>
3170+ &lt;/Location&gt;</code></pre>
3171+
3172+<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>
3173+
3174+<p>See the section <a href="#Fixing-installation-problems">&quot;Fixing installation problems&quot;</a> for suggestions on debugging the Apache authentication setup.</p>
3175+
3176+<h2 id="How-BackupPC-Finds-Hosts">How BackupPC Finds Hosts</h2>
3177+
3178+<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>
3179+
3180 <p>BackupPC (starting with v2.0.0) looks up hosts with DHCP = 0 in this manner:</p>
3181+
3182 <ul>
3183-<li>
3184-<p>First DNS is used to lookup the IP address given the client's name
3185-using perl's <code>gethostbyname()</code> function. This should succeed for machines
3186-that have fixed IP addresses that are known via DNS. You can manually
3187-see whether a given host have a DNS entry according to perl's
3188-gethostbyname function with this command:</p>
3189-<pre>
3190- perl -e 'print(gethostbyname(&quot;myhost&quot;) ? &quot;ok\n&quot; : &quot;not found\n&quot;);'</pre>
3191+
3192+<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>
3193+
3194+<pre><code> perl -e &#39;print(gethostbyname(&quot;myhost&quot;) ? &quot;ok\n&quot; : &quot;not found\n&quot;);&#39;</code></pre>
3195+
3196 </li>
3197-<li>
3198-<p>If <code>gethostbyname()</code> fails, BackupPC then attempts a NetBios multicast to
3199-find the host. Provided your client machine is configured properly,
3200-it should respond to this NetBios multicast request. Specifically,
3201-BackupPC runs a command of this form:</p>
3202-<pre>
3203- nmblookup myhost</pre>
3204+<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>
3205+
3206+<pre><code> nmblookup myhost</code></pre>
3207+
3208 <p>If this fails you will see output like:</p>
3209-<pre>
3210- querying myhost on 10.10.255.255
3211- name_query failed to find name myhost</pre>
3212+
3213+<pre><code> querying myhost on 10.10.255.255
3214+ name_query failed to find name myhost</code></pre>
3215+
3216 <p>If it is successful you will see output like:</p>
3217-<pre>
3218- querying myhost on 10.10.255.255
3219- 10.10.1.73 myhost&lt;00&gt;</pre>
3220-<p>Depending on your netmask you might need to specify the -B option to
3221-nmblookup. For example:</p>
3222-<pre>
3223- nmblookup -B 10.10.1.255 myhost</pre>
3224-<p>If necessary, experiment with the nmblookup command which will return the
3225-IP address of the client given its name. Then update
3226-<a href="#_conf_nmblookupfindhostcmd_">$Conf{NmbLookupFindHostCmd}</a> with any necessary options to nmblookup.</p>
3227+
3228+<pre><code> querying myhost on 10.10.255.255
3229+ 10.10.1.73 myhost&lt;00&gt;</code></pre>
3230+
3231+<p>Depending on your netmask you might need to specify the -B option to nmblookup. For example:</p>
3232+
3233+<pre><code> nmblookup -B 10.10.1.255 myhost</code></pre>
3234+
3235+<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>
3236+
3237 </li>
3238 </ul>
3239-<p>For hosts that have the DHCP flag set to 1, these machines are
3240-discovered as follows:</p>
3241+
3242+<p>For hosts that have the DHCP flag set to 1, these machines are discovered as follows:</p>
3243+
3244 <ul>
3245-<li>
3246-<p>A DHCP address pool (<a href="#_conf_dhcpaddressranges_">$Conf{DHCPAddressRanges}</a>) needs to be specified.
3247-BackupPC will check the NetBIOS name of each machine in the range using
3248-a command of the form:</p>
3249-<pre>
3250- nmblookup -A W.X.Y.Z</pre>
3251-<p>where W.X.Y.Z is each candidate address from <a href="#_conf_dhcpaddressranges_">$Conf{DHCPAddressRanges}</a>.
3252-Any host that has a valid NetBIOS name returned by this command (ie:
3253-matching an entry in the hosts file) will be backed up. You can
3254-modify the specific nmblookup command if necessary via <a href="#_conf_nmblookupcmd_">$Conf{NmbLookupCmd}</a>.</p>
3255+
3256+<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>
3257+
3258+<pre><code> nmblookup -A W.X.Y.Z</code></pre>
3259+
3260+<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>
3261+
3262 </li>
3263-<li>
3264-<p>You only need to use this DHCP feature if your client machine doesn't
3265-respond to the NetBios multicast request:</p>
3266-<pre>
3267- nmblookup myHost</pre>
3268+<li><p>You only need to use this DHCP feature if your client machine doesn&#39;t respond to the NetBios multicast request:</p>
3269+
3270+<pre><code> nmblookup myHost</code></pre>
3271+
3272 <p>but does respond to a request directed to its IP address:</p>
3273-<pre>
3274- nmblookup -A W.X.Y.Z</pre>
3275+
3276+<pre><code> nmblookup -A W.X.Y.Z</code></pre>
3277+
3278 </li>
3279 </ul>
3280-<p>
3281-</p>
3282-<h2><a name="other_installation_topics">Other installation topics</a></h2>
3283+
3284+<h2 id="Other-installation-topics">Other installation topics</h2>
3285+
3286 <dl>
3287-<dt><strong><a name="removing_a_client" class="item">Removing a client</a></strong></dt>
3288
3289+<dt id="Removing-a-client">Removing a client</dt>
3290 <dd>
3291-<p>If there is a machine that no longer needs to be backed up (eg: a retired
3292-machine) you have two choices. First, you can keep the backups accessible
3293-and browsable, but disable all new backups. Alternatively, you can
3294-completely remove the client and all its backups.</p>
3295-<p>To disable backups for a client <a href="#_conf_backupsdisable_">$Conf{BackupsDisable}</a> can be
3296-set to two different values in that client's per-PC config.pl file:</p>
3297+
3298+<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>
3299+
3300+<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>
3301+
3302 <ol>
3303-<li>
3304-<p>Don't do any regular backups on this machine. Manually
3305-requested backups (via the CGI interface) will still occur.</p>
3306+
3307+<li><p>Don&#39;t do any regular backups on this machine. Manually requested backups (via the CGI interface) will still occur.</p>
3308+
3309 </li>
3310-<li>
3311-<p>Don't do any backups on this machine. Manually requested
3312-backups (via the CGI interface) will be ignored.</p>
3313+<li><p>Don&#39;t do any backups on this machine. Manually requested backups (via the CGI interface) will be ignored.</p>
3314+
3315 </li>
3316 </ol>
3317-<p>This will still allow the client's old backups to be browsable
3318-and restorable.</p>
3319-<p>To completely remove a client and all its backups, you should remove its
3320-entry in the conf/hosts file, and then delete the __TOPDIR__/pc/$host
3321-directory. Whenever you change the hosts file, you should send
3322-BackupPC a HUP (-1) signal so that it re-reads the hosts file.
3323-If you don't do this, BackupPC will automatically re-read the
3324-hosts file at the next regular wakeup.</p>
3325-<p>Note that when you remove a client's backups you won't initially
3326-recover much disk space. That's because the client's files are
3327-still in the pool. Overnight, when BackupPC_nightly next runs,
3328-all the unused pool files will be deleted and this will recover
3329-the disk space used by the client's backups.</p>
3330+
3331+<p>This will still allow the client&#39;s old backups to be browsable and restorable.</p>
3332+
3333+<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>
3334+
3335+<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>
3336+
3337 </dd>
3338-<dt><strong><a name="copying_the_pool" class="item">Copying the pool</a></strong></dt>
3339-
3340+<dt id="Copying-the-pool">Copying the pool</dt>
3341 <dd>
3342-<p>If the pool disk requirements grow you might need to copy the entire
3343-data directory to a new (bigger) file system. Hopefully you are lucky
3344-enough to avoid this by having the data directory on a RAID file system
3345-or LVM that allows the capacity to be grown in place by adding disks.</p>
3346-<p>The backup data directories contain large numbers of hardlinks. If
3347-you try to copy the pool the target directory will occupy a lot more
3348-space if the hardlinks aren't re-established.</p>
3349-<p>The best way to copy a pool file system, if possible, is by copying
3350-the raw device at the block level (eg: using dd). Application level
3351-programs that understand hardlinks include the GNU cp program with
3352-the -a option and rsync -H. However, the large number of hardlinks
3353-in the pool will make the memory usage large and the copy very slow.
3354-Don't forget to stop BackupPC while the copy runs.</p>
3355-<p>Starting in 3.0.0 a new script bin/BackupPC_tarPCCopy can be
3356-used to assist the copy process. Given one or more pc paths
3357-(eg: TOPDIR/pc/HOST or TOPDIR/pc/HOST/nnn), BackupPC_tarPCCopy
3358-creates a tar archive with all the hardlinks pointing to ../cpool/....
3359-Any files not hardlinked (eg: backups, LOG etc) are included
3360-verbatim.</p>
3361-<p>You will need to specify the -P option to tar when you extract
3362-the archive generated by BackupPC_tarPCCopy since the hardlink
3363-targets are outside of the directory being extracted.</p>
3364-<p>To copy a complete store (ie: __TOPDIR__) using BackupPC_tarPCCopy
3365-you should:</p>
3366+
3367+<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>
3368+
3369+<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>
3370+
3371+<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>
3372+
3373+<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>
3374+
3375+<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>
3376+
3377+<p>To copy a complete store (ie: __TOPDIR__) using BackupPC_tarPCCopy you should:</p>
3378+
3379 <ul>
3380-<li>
3381-<p>stop BackupPC so that the store is static.</p>
3382-</li>
3383-<li>
3384-<p>copy the cpool, conf and log directory trees using any technique
3385-(like cp, rsync or tar) without the need to preserve hardlinks.</p>
3386-</li>
3387-<li>
3388-<p>copy the pc directory using BackupPC_tarPCCopy:</p>
3389-<pre>
3390- su __BACKUPPCUSER__
3391+
3392+<li><p>stop BackupPC so that the store is static.</p>
3393+
3394+</li>
3395+<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>
3396+
3397+</li>
3398+<li><p>copy the pc directory using BackupPC_tarPCCopy:</p>
3399+
3400+<pre><code> su __BACKUPPCUSER__
3401 cd NEW_TOPDIR
3402 mkdir pc
3403 cd pc
3404- __INSTALLDIR__/bin/BackupPC_tarPCCopy __TOPDIR__/pc | tar xvPf -</pre>
3405+ __INSTALLDIR__/bin/BackupPC_tarPCCopy __TOPDIR__/pc | tar xvPf -</code></pre>
3406+
3407 </li>
3408 </ul>
3409+
3410 </dd>
3411 </dl>
3412-<p>
3413-</p>
3414-<h2><a name="fixing_installation_problems">Fixing installation problems</a></h2>
3415-<p>Please see the Wiki at <a href="http://backuppc.wiki.sourceforge.net">http://backuppc.wiki.sourceforge.net</a> for
3416-debugging suggestions. If you find a solution to your problem that
3417-could help other users please add it to the Wiki!</p>
3418-<p>
3419-<a href="#__index__"><small>Back to Top</small></a>
3420-</p>
3421+
3422+<h2 id="Fixing-installation-problems">Fixing installation problems</h2>
3423+
3424+<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>
3425+
3426 <hr />
3427-<h1><a name="restore_functions">Restore functions</a></h1>
3428-<p>BackupPC supports several different methods for restoring files. The
3429-most convenient restore options are provided via the CGI interface.
3430-Alternatively, backup files can be restored using manual commands.</p>
3431-<p>
3432-</p>
3433-<h2><a name="cgi_restore_options">CGI restore options</a></h2>
3434-<p>By selecting a host in the CGI interface, a list of all the backups
3435-for that machine will be displayed. By selecting the backup number
3436-you can navigate the shares and directory tree for that backup.</p>
3437-<p>BackupPC's CGI interface automatically fills incremental backups
3438-with the corresponding full backup, which means each backup has
3439-a filled appearance. Therefore, there is no need to do multiple
3440-restores from the incremental and full backups: BackupPC does all
3441-the hard work for you. You simply select the files and directories
3442-you want from the correct backup vintage in one step.</p>
3443-<p>You can download a single backup file at any time simply by selecting
3444-it. Your browser should prompt you with the file name and ask you
3445-whether to open the file or save it to disk.</p>
3446-<p>Alternatively, you can select one or more files or directories in
3447-the currently selected directory and select &quot;Restore selected files&quot;.
3448-(If you need to restore selected files and directories from several
3449-different parent directories you will need to do that in multiple
3450-steps.)</p>
3451-<p>If you select all the files in a directory, BackupPC will replace
3452-the list of files with the parent directory. You will be presented
3453-with a screen that has three options:</p>
3454+<h1 id="Restore-functions">Restore functions</h1>
3455+
3456+<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>
3457+
3458+<h2 id="CGI-restore-options">CGI restore options</h2>
3459+
3460+<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>
3461+
3462+<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>
3463+
3464+<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>
3465+
3466+<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>
3467+
3468+<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>
3469+
3470 <dl>
3471-<dt><strong><a name="option_1_direct_restore" class="item">Option 1: Direct Restore</a></strong></dt>
3472-
3473-<dd>
3474-<p>With this option the selected files and directories are restored
3475-directly back onto the host, by default in their original location.
3476-Any old files with the same name will be overwritten, so use caution.
3477-You can optionally change the target host name, target share name,
3478-and target path prefix for the restore, allowing you to restore the
3479-files to a different location.</p>
3480-<p>Once you select &quot;Start Restore&quot; you will be prompted one last time
3481-with a summary of the exact source and target files and directories
3482-before you commit. When you give the final go ahead the restore
3483-operation will be queued like a normal backup job, meaning that it
3484-will be deferred if there is a backup currently running for that host.
3485-When the restore job is run, smbclient, tar, rsync or rsyncd is used
3486-(depending upon <a href="#_conf_xfermethod_">$Conf{XferMethod}</a>) to actually restore the files.
3487-Sorry, there is currently no option to cancel a restore that has been
3488-started. Currently ftp restores are not fully implemented.</p>
3489-<p>A record of the restore request, including the result and list of
3490-files and directories, is kept. It can be browsed from the host's
3491-home page. <a href="#_conf_restoreinfokeepcnt_">$Conf{RestoreInfoKeepCnt}</a> specifies how many old restore
3492-status files to keep.</p>
3493-<p>Note that for direct restore to work, the <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> must
3494-be able to write to the client. For example, that means an SMB
3495-share for smbclient needs to be writable, and the rsyncd module
3496-needs &quot;read only&quot; set to &quot;false&quot;. This creates additional security
3497-risks. If you only create read-only SMB shares (which is a good
3498-idea), then the direct restore will fail. You can disable the
3499-direct restore option by setting <a href="#_conf_smbclientrestorecmd_">$Conf{SmbClientRestoreCmd}</a>,
3500-<a href="#_conf_tarclientrestorecmd_">$Conf{TarClientRestoreCmd}</a> and <a href="#_conf_rsyncrestoreargs_">$Conf{RsyncRestoreArgs}</a> to undef.</p>
3501-</dd>
3502-<dt><strong><a name="option_2_download_zip_archive" class="item">Option 2: Download Zip archive</a></strong></dt>
3503-
3504-<dd>
3505-<p>With this option a zip file containing the selected files and directories
3506-is downloaded. The zip file can then be unpacked or individual files
3507-extracted as necessary on the host machine. The compression level can be
3508-specified. A value of 0 turns off compression.</p>
3509-<p>When you select &quot;Download Zip File&quot; you should be prompted where to
3510-save the restore.zip file.</p>
3511-<p>BackupPC does not consider downloading a zip file as an actual
3512-restore operation, so the details are not saved for later browsing
3513-as in the first case. However, a mention that a zip file was
3514-downloaded by a particular user, and a list of the files, does
3515-appear in BackupPC's log file.</p>
3516-</dd>
3517-<dt><strong><a name="option_3_download_tar_archive" class="item">Option 3: Download Tar archive</a></strong></dt>
3518-
3519-<dd>
3520-<p>This is identical to the previous option, except a tar file is downloaded
3521-rather than a zip file (and there is currently no compression option).</p>
3522+
3523+<dt id="Option-1:-Direct-Restore">Option 1: Direct Restore</dt>
3524+<dd>
3525+
3526+<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>
3527+
3528+<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>
3529+
3530+<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>
3531+
3532+<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>
3533+
3534+</dd>
3535+<dt id="Option-2:-Download-Zip-archive">Option 2: Download Zip archive</dt>
3536+<dd>
3537+
3538+<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>
3539+
3540+<p>When you select &quot;Download Zip File&quot; you should be prompted where to save the restore.zip file.</p>
3541+
3542+<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>
3543+
3544+</dd>
3545+<dt id="Option-3:-Download-Tar-archive">Option 3: Download Tar archive</dt>
3546+<dd>
3547+
3548+<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>
3549+
3550 </dd>
3551 </dl>
3552-<p>
3553-</p>
3554-<h2><a name="command_line_restore_options">Command-line restore options</a></h2>
3555-<p>Apart from the CGI interface, BackupPC allows you to restore files
3556-and directories from the command line. The following programs can
3557-be used:</p>
3558+
3559+<h2 id="Command-line-restore-options">Command-line restore options</h2>
3560+
3561+<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>
3562+
3563 <dl>
3564-<dt><strong><a name="backuppc_zcat" class="item">BackupPC_zcat</a></strong></dt>
3565
3566+<dt id="BackupPC_zcat">BackupPC_zcat</dt>
3567 <dd>
3568-<p>For each file name argument it inflates (uncompresses) the file and
3569-writes it to stdout. To use BackupPC_zcat you could give it the
3570-full file name, eg:</p>
3571-<pre>
3572- __INSTALLDIR__/bin/BackupPC_zcat __TOPDIR__/pc/host/5/fc/fcraig/fexample.txt &gt; example.txt</pre>
3573-<p>It's your responsibility to make sure the file is really compressed:
3574-BackupPC_zcat doesn't check which backup the requested file is from.
3575-BackupPC_zcat returns a non-zero status if it fails to uncompress
3576-a file.</p>
3577+
3578+<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>
3579+
3580+<pre><code> __INSTALLDIR__/bin/BackupPC_zcat __TOPDIR__/pc/host/5/fc/fcraig/fexample.txt &gt; example.txt</code></pre>
3581+
3582+<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>
3583+
3584 </dd>
3585-<dt><strong><a name="backuppc_tarcreate" class="item">BackupPC_tarCreate</a></strong></dt>
3586-
3587+<dt id="BackupPC_tarCreate">BackupPC_tarCreate</dt>
3588 <dd>
3589-<p>BackupPC_tarCreate creates a tar file for any files or directories in
3590-a particular backup. Merging of incrementals is done automatically,
3591-so you don't need to worry about whether certain files appear in the
3592-incremental or full backup.</p>
3593+
3594+<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>
3595+
3596 <p>The usage is:</p>
3597-<pre>
3598- BackupPC_tarCreate [options] files/directories...
3599+
3600+<pre><code> BackupPC_tarCreate [options] files/directories...
3601 Required options:
3602 -h host host from which the tar archive is created
3603 -n dumpNum dump number from which the tar archive is created
3604@@ -1633,25 +1137,22 @@
3605 -w writeBufSz write buffer size (default 1048576 = 1MB)
3606 -e charset charset for encoding file names (default: value of
3607 <a href="#_conf_clientcharset_">$Conf{ClientCharset}</a> when backup was done)
3608- -l just print a file listing; don't generate an archive
3609- -L just print a detailed file listing; don't generate an archive</pre>
3610-<p>The command-line files and directories are relative to the specified
3611-shareName. The tar file is written to stdout.</p>
3612-<p>The -h, -n and -s options specify which dump is used to generate
3613-the tar archive. The -r and -p options can be used to relocate
3614-the paths in the tar archive so extracted files can be placed
3615-in a location different from their original location.</p>
3616+ -l just print a file listing; don&#39;t generate an archive
3617+ -L just print a detailed file listing; don&#39;t generate an archive</code></pre>
3618+
3619+<p>The command-line files and directories are relative to the specified shareName. The tar file is written to stdout.</p>
3620+
3621+<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>
3622+
3623 </dd>
3624-<dt><strong><a name="backuppc_zipcreate" class="item">BackupPC_zipCreate</a></strong></dt>
3625-
3626+<dt id="BackupPC_zipCreate">BackupPC_zipCreate</dt>
3627 <dd>
3628-<p>BackupPC_zipCreate creates a zip file for any files or directories in
3629-a particular backup. Merging of incrementals is done automatically,
3630-so you don't need to worry about whether certain files appear in the
3631-incremental or full backup.</p>
3632+
3633+<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>
3634+
3635 <p>The usage is:</p>
3636-<pre>
3637- BackupPC_zipCreate [options] files/directories...
3638+
3639+<pre><code> BackupPC_zipCreate [options] files/directories...
3640 Required options:
3641 -h host host from which the zip archive is created
3642 -n dumpNum dump number from which the tar archive is created
3643@@ -1664,1239 +1165,967 @@
3644 -r pathRemove path prefix that will be replaced with pathAdd
3645 -p pathAdd new path prefix
3646 -c level compression level (default is 0, no compression)
3647- -e charset charset for encoding file names (default: cp1252)</pre>
3648-<p>The command-line files and directories are relative to the specified
3649-shareName. The zip file is written to stdout. The -h, -n and -s
3650-options specify which dump is used to generate the zip archive. The
3651--r and -p options can be used to relocate the paths in the zip archive
3652-so extracted files can be placed in a location different from their
3653-original location.</p>
3654+ -e charset charset for encoding file names (default: utf8)</code></pre>
3655+
3656+<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>
3657+
3658 </dd>
3659 </dl>
3660+
3661 <p>Each of these programs reside in __INSTALLDIR__/bin.</p>
3662-<p>
3663-<a href="#__index__"><small>Back to Top</small></a>
3664-</p>
3665+
3666 <hr />
3667-<h1><a name="archive_functions">Archive functions</a></h1>
3668-<p>BackupPC supports archiving to removable media. For users that require
3669-offsite backups, BackupPC can create archives that stream to tape
3670-devices, or create files of specified sizes to fit onto cd or dvd media.</p>
3671-<p>Each archive type is specified by a BackupPC host with its XferMethod
3672-set to 'archive'. This allows for multiple configurations at sites where
3673-there might be a combination of tape and cd/dvd backups being made.</p>
3674-<p>BackupPC provides a menu that allows one or more hosts to be archived.
3675-The most recent backup of each host is archived using BackupPC_tarCreate,
3676-and the output is optionally compressed and split into fixed-sized
3677-files (eg: 650MB).</p>
3678-<p>The archive for each host is done by default using
3679-__INSTALLDIR__/bin/BackupPC_archiveHost. This script can be copied
3680-and customized as needed.</p>
3681-<p>
3682-</p>
3683-<h2><a name="configuring_an_archive_host">Configuring an Archive Host</a></h2>
3684-<p>To create an Archive Host, add it to the hosts file just as any other host
3685-and call it a name that best describes the type of archive, e.g. ArchiveDLT</p>
3686-<p>To tell BackupPC that the Host is for Archives, create a config.pl file in
3687-the Archive Hosts's pc directory, adding the following line:</p>
3688-<p><a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = 'archive';</p>
3689-<p>To further customise the archive's parameters you can adding the changed
3690-parameters in the host's config.pl file. The parameters are explained in
3691-the config.pl file. Parameters may be fixed or the user can be allowed
3692-to change them (eg: output device).</p>
3693-<p>The per-host archive command is <a href="#_conf_archiveclientcmd_">$Conf{ArchiveClientCmd}</a>. By default
3694-this invokes</p>
3695-<pre>
3696- __INSTALLDIR__/bin/BackupPC_archiveHost</pre>
3697+<h1 id="Archive-functions">Archive functions</h1>
3698+
3699+<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>
3700+
3701+<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>
3702+
3703+<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>
3704+
3705+<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>
3706+
3707+<h2 id="Configuring-an-Archive-Host">Configuring an Archive Host</h2>
3708+
3709+<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>
3710+
3711+<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>
3712+
3713+<p><a href="#_conf_xfermethod_">$Conf{XferMethod}</a> = &#39;archive&#39;;</p>
3714+
3715+<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>
3716+
3717+<p>The per-host archive command is <a href="#_conf_archiveclientcmd_">$Conf{ArchiveClientCmd}</a>. By default this invokes</p>
3718+
3719+<pre><code> __INSTALLDIR__/bin/BackupPC_archiveHost</code></pre>
3720+
3721 <p>which you can copy and customize as necessary.</p>
3722-<p>
3723-</p>
3724-<h2><a name="starting_an_archive">Starting an Archive</a></h2>
3725-<p>In the web interface, click on the Archive Host you wish to use. You will see a
3726-list of previous archives and a summary on each. By clicking the &quot;Start Archive&quot;
3727-button you are presented with the list of hosts and the approximate backup size
3728-(note this is raw size, not projected compressed size) Select the hosts you wish
3729-to archive and press the &quot;Archive Selected Hosts&quot; button.</p>
3730-<p>The next screen allows you to adjust the parameters for this archive run.
3731-Press the &quot;Start the Archive&quot; to start archiving the selected hosts with the
3732-parameters displayed.</p>
3733-<p>
3734-</p>
3735-<h2><a name="starting_an_archive_from_the_command_line">Starting an Archive from the command line</a></h2>
3736-<p>The script BackupPC_archiveStart can be used to start an archive from
3737-the command line (or cron etc). The usage is:</p>
3738-<pre>
3739- BackupPC_archiveStart archiveHost userName hosts...</pre>
3740-<p>This creates an archive of the most recent backup of each of
3741-the specified hosts. The first two arguments are the archive
3742-host and the user name making the request.</p>
3743-<p>
3744-<a href="#__index__"><small>Back to Top</small></a>
3745-</p>
3746-<hr />
3747-<h1><a name="other_cgi_functions">Other CGI Functions</a></h1>
3748-<p>
3749-</p>
3750-<h2><a name="configuration_and_host_editor">Configuration and Host Editor</a></h2>
3751-<p>The CGI interface has a complete configuration and host editor.
3752-Only the administrator can edit the main configuration settings
3753-and hosts. The edit links are in the left navigation bar.</p>
3754-<p>When changes are made to any parameter a &quot;Save&quot; button appears
3755-at the top of the page. If you are editing a text box you will
3756-need to click outside of the text box to make the Save button
3757-appear. If you don't select Save then the changes won't be saved.</p>
3758-<p>The host-specific configuration can be edited from the host
3759-summary page using the link in the left navigation bar.
3760-The administrator can edit any of the host-specific
3761-configuration settings.</p>
3762-<p>When editing the host-specific configuration, each parameter has
3763-an &quot;override&quot; setting that denotes the value is host-specific,
3764-meaning that it overrides the setting in the main configuration.
3765-If you unselect &quot;override&quot; then the setting is removed from
3766-the host-specific configuration, and the main configuration
3767-file is displayed.</p>
3768-<p>User's can edit their host-specific configuration if enabled
3769-via <a href="#_conf_cgiuserconfigeditenable_">$Conf{CgiUserConfigEditEnable}</a>. The specific subset
3770-of configuration settings that a user can edit is specified
3771-with <a href="#_conf_cgiuserconfigedit_">$Conf{CgiUserConfigEdit}</a>. It is recommended to make this
3772-list short as possible (you probably don't want your users saving
3773-dozens of backups) and it is essential that they can't edit any
3774-of the Cmd configuration settings, otherwise they can specify
3775-an arbitrary command that will be executed as the BackupPC
3776-user.</p>
3777-<p>
3778-</p>
3779-<h2><a name="rss">RSS</a></h2>
3780-<p>BackupPC supports a very basic RSS feed. Provided you have the
3781-XML::RSS perl module installed, a URL similar to this will
3782-provide RSS information:</p>
3783-<pre>
3784- <a href="http://localhost/cgi-bin/BackupPC/BackupPC_Admin?action=rss">http://localhost/cgi-bin/BackupPC/BackupPC_Admin?action=rss</a></pre>
3785-<p>This feature is experimental. The information included will
3786-probably change.</p>
3787-<p>
3788-<a href="#__index__"><small>Back to Top</small></a>
3789-</p>
3790-<hr />
3791-<h1><a name="backuppc_design">BackupPC Design</a></h1>
3792-<p>
3793-</p>
3794-<h2><a name="some_design_issues">Some design issues</a></h2>
3795+
3796+<h2 id="Starting-an-Archive">Starting an Archive</h2>
3797+
3798+<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>
3799+
3800+<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>
3801+
3802+<h2 id="Starting-an-Archive-from-the-command-line">Starting an Archive from the command line</h2>
3803+
3804+<p>The script BackupPC_archiveStart can be used to start an archive from the command line (or cron etc). The usage is:</p>
3805+
3806+<pre><code> BackupPC_archiveStart archiveHost userName hosts...</code></pre>
3807+
3808+<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>
3809+
3810+<hr />
3811+<h1 id="Other-CGI-Functions">Other CGI Functions</h1>
3812+
3813+<h2 id="Configuration-and-Host-Editor">Configuration and Host Editor</h2>
3814+
3815+<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>
3816+
3817+<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>
3818+
3819+<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>
3820+
3821+<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>
3822+
3823+<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>
3824+
3825+<h2 id="RSS">RSS</h2>
3826+
3827+<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>
3828+
3829+<pre><code> http://localhost/cgi-bin/BackupPC/BackupPC_Admin?action=rss</code></pre>
3830+
3831+<p>This feature is experimental. The information included will probably change.</p>
3832+
3833+<hr />
3834+<h1 id="BackupPC-Design">BackupPC Design</h1>
3835+
3836+<h2 id="Some-design-issues">Some design issues</h2>
3837+
3838 <dl>
3839-<dt><strong><a name="pooling_common_files" class="item">Pooling common files</a></strong></dt>
3840-
3841-<dd>
3842-<p>To quickly see if a file is already in the pool, an MD5 digest of the
3843-file length and contents is used as the file name in the pool. This
3844-can't guarantee a file is identical: it just reduces the search to
3845-often a single file or handful of files. A complete file comparison
3846-is always done to verify if two files are really the same.</p>
3847-<p>Identical files on multiples backups are represented by hard links.
3848-Hardlinks are used so that identical files all refer to the same
3849-physical file on the server's disk. Also, hard links maintain
3850-reference counts so that BackupPC knows when to delete unused files
3851-from the pool.</p>
3852-<p>For the computer-science majors among you, you can think of the pooling
3853-system used by BackupPC as just a chained hash table stored on a (big)
3854-file system.</p>
3855-</dd>
3856-<dt><strong><a name="the_hashing_function" class="item">The hashing function</a></strong></dt>
3857-
3858-<dd>
3859-<p>There is a tradeoff between how much of file is used for the MD5 digest
3860-and the time taken comparing all the files that have the same hash.</p>
3861-<p>Using the file length and just the first 4096 bytes of the file for the
3862-MD5 digest produces some repetitions. One example: with 900,000 unique
3863-files in the pool, this hash gives about 7,000 repeated files, and in
3864-the worst case 500 files have the same hash. That's not bad: we only
3865-have to do a single file compare 99.2% of the time. But in the worst
3866-case we have to compare as many as 500 files checking for a match.</p>
3867-<p>With a modest increase in CPU time, if we use the file length and the
3868-first 256K of the file we now only have 500 repeated files and in the
3869-worst case around 20 files have the same hash. Furthermore, if we
3870-instead use the first and last 128K of the file (more specifically, the
3871-first and eighth 128K chunks for files larger than 1MB) we get only 300
3872-repeated files and in the worst case around 20 files have the same hash.</p>
3873-<p>Based on this experimentation, this is the hash function used by BackupPC.
3874-It is important that you don't change the hash function after files
3875-are already in the pool. Otherwise your pool will grow to twice the
3876-size until all the old backups (and all the old files with old hashes)
3877-eventually expire.</p>
3878-</dd>
3879-<dt><strong><a name="compression" class="item">Compression</a></strong></dt>
3880-
3881-<dd>
3882-<p>BackupPC supports compression. It uses the deflate and inflate methods
3883-in the Compress::Zlib module, which is based on the zlib compression
3884-library (see <a href="http://www.gzip.org/zlib/">http://www.gzip.org/zlib/</a>).</p>
3885-<p>The <a href="#_conf_compresslevel_">$Conf{CompressLevel}</a> setting specifies the compression level to use.
3886-Zero (0) means no compression. Compression levels can be from 1 (least
3887-cpu time, slightly worse compression) to 9 (most cpu time, slightly
3888-better compression). The recommended value is 3. Changing it to 5, for
3889-example, will take maybe 20% more cpu time and will get another 2-3%
3890-additional compression. Diminishing returns set in above 5. See the zlib
3891-documentation for more information about compression levels.</p>
3892-<p>BackupPC implements compression with minimal CPU load. Rather than
3893-compressing every incoming backup file and then trying to match it
3894-against the pool, BackupPC computes the MD5 digest based on the
3895-uncompressed file, and matches against the candidate pool files by
3896-comparing each uncompressed pool file against the incoming backup file.
3897-Since inflating a file takes roughly a factor of 10 less CPU time than
3898-deflating there is a big saving in CPU time.</p>
3899-<p>The combination of pooling common files and compression can yield
3900-a factor of 8 or more overall saving in backup storage.</p>
3901+
3902+<dt id="Pooling-common-files">Pooling common files</dt>
3903+<dd>
3904+
3905+<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>
3906+
3907+<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>
3908+
3909+<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>
3910+
3911+</dd>
3912+<dt id="The-hashing-function">The hashing function</dt>
3913+<dd>
3914+
3915+<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>
3916+
3917+<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>
3918+
3919+<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>
3920+
3921+<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>
3922+
3923+</dd>
3924+<dt id="Compression">Compression</dt>
3925+<dd>
3926+
3927+<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>
3928+
3929+<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>
3930+
3931+<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>
3932+
3933+<p>The combination of pooling common files and compression can yield a factor of 8 or more overall saving in backup storage.</p>
3934+
3935 </dd>
3936 </dl>
3937-<p>
3938-</p>
3939-<h2><a name="backuppc_operation">BackupPC operation</a></h2>
3940-<p>BackupPC reads the configuration information from
3941-__CONFDIR__/config.pl. It then runs and manages all the backup
3942-activity. It maintains queues of pending backup requests, user backup
3943-requests and administrative commands. Based on the configuration various
3944-requests will be executed simultaneously.</p>
3945-<p>As specified by <a href="#_conf_wakeupschedule_">$Conf{WakeupSchedule}</a>, BackupPC wakes up periodically
3946-to queue backups on all the PCs. This is a four step process:</p>
3947+
3948+<h2 id="BackupPC-operation">BackupPC operation</h2>
3949+
3950+<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>
3951+
3952+<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>
3953+
3954 <ol>
3955-<li>
3956-<p>For each host and DHCP address backup requests are queued on the
3957-background command queue.</p>
3958+
3959+<li><p>For each host and DHCP address backup requests are queued on the background command queue.</p>
3960+
3961 </li>
3962-<li>
3963-<p>For each PC, BackupPC_dump is forked. Several of these may be run in
3964-parallel, based on the configuration. First a ping is done to see if
3965-the machine is alive. If this is a DHCP address, nmblookup is run to
3966-get the netbios name, which is used as the host name. If DNS lookup
3967-fails, <a href="#_conf_nmblookupfindhostcmd_">$Conf{NmbLookupFindHostCmd}</a> is run to find the IP address from
3968-the host name. The file __TOPDIR__/pc/$host/backups is read to decide
3969-whether a full or incremental backup needs to be run. If no backup is
3970-scheduled, or the ping to $host fails, then BackupPC_dump exits.</p>
3971-<p>The backup is done using the specified XferMethod. Either samba's smbclient
3972-or tar over ssh/rsh/nfs piped into BackupPC_tarExtract, or rsync over ssh/rsh
3973-is run, or rsyncd is connected to, with the incoming data
3974-extracted to __TOPDIR__/pc/$host/new. The XferMethod output is put
3975-into __TOPDIR__/pc/$host/XferLOG.</p>
3976-<p>The letter in the XferLOG file shows the type of object, similar to the
3977-first letter of the modes displayed by ls -l:</p>
3978-<pre>
3979- d -&gt; directory
3980+<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>
3981+
3982+<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>
3983+
3984+<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>
3985+
3986+<pre><code> d -&gt; directory
3987 l -&gt; symbolic link
3988 b -&gt; block special file
3989 c -&gt; character special file
3990 p -&gt; pipe file (fifo)
3991- nothing -&gt; regular file</pre>
3992+ nothing -&gt; regular file</code></pre>
3993+
3994 <p>The words mean:</p>
3995+
3996 <dl>
3997-<dt><strong><a name="create" class="item">create</a></strong></dt>
3998
3999+<dt id="create">create</dt>
4000 <dd>
4001+
4002 <p>new for this backup (ie: directory or file not in pool)</p>
4003+
4004 </dd>
4005-<dt><strong><a name="pool" class="item">pool</a></strong></dt>
4006-
4007+<dt id="pool">pool</dt>
4008 <dd>
4009+
4010 <p>found a match in the pool</p>
4011-</dd>
4012-<dt><strong><a name="same" class="item">same</a></strong></dt>
4013-
4014-<dd>
4015-<p>file is identical to previous backup (contents were
4016-checksummed and verified during full dump).</p>
4017-</dd>
4018-<dt><strong><a name="skip" class="item">skip</a></strong></dt>
4019-
4020-<dd>
4021-<p>file skipped in incremental because attributes are the
4022-same (only displayed if <a href="#_conf_xferloglevel_">$Conf{XferLogLevel}</a> &gt;= 2).</p>
4023+
4024+</dd>
4025+<dt id="same">same</dt>
4026+<dd>
4027+
4028+<p>file is identical to previous backup (contents were checksummed and verified during full dump).</p>
4029+
4030+</dd>
4031+<dt id="skip">skip</dt>
4032+<dd>
4033+
4034+<p>file skipped in incremental because attributes are the same (only displayed if <a href="#_conf_xferloglevel_">$Conf{XferLogLevel}</a> &gt;= 2).</p>
4035+
4036 </dd>
4037 </dl>
4038-<p>As BackupPC_tarExtract extracts the files from smbclient or tar, or as
4039-rsync or ftp runs, it checks each file in the backup to see if it is
4040-identical to an existing file from any previous backup of any PC. It
4041-does this without needed to write the file to disk. If the file matches
4042-an existing file, a hardlink is created to the existing file in the
4043-pool. If the file does not match any existing files, the file is written
4044-to disk and the file name is saved in __TOPDIR__/pc/$host/NewFileList
4045-for later processing by BackupPC_link. BackupPC_tarExtract and rsync
4046-can handle arbitrarily large files and multiple candidate matching files
4047-without needing to write the file to disk in the case of a match. This
4048-significantly reduces disk writes (and also reads, since the pool file
4049-comparison is done disk to memory, rather than disk to disk).</p>
4050-<p>Based on the configuration settings, BackupPC_dump checks each
4051-old backup to see if any should be removed. Any expired backups
4052-are moved to __TOPDIR__/trash for later removal by BackupPC_trashClean.</p>
4053-</li>
4054-<li>
4055-<p>For each complete, good, backup, BackupPC_link is run.
4056-To avoid race conditions as new files are linked into the
4057-pool area, only a single BackupPC_link program runs
4058-at a time and the rest are queued.</p>
4059-<p>BackupPC_link reads the NewFileList written by BackupPC_dump and
4060-inspects each new file in the backup. It re-checks if there is a
4061-matching file in the pool (another BackupPC_link
4062-could have added the file since BackupPC_dump checked). If so, the file
4063-is removed and replaced by a hard link to the existing file. If the file
4064-is new, a hard link to the file is made in the pool area, so that this
4065-file is available for checking against each new file and new backup.</p>
4066-<p>Then, if <a href="#_conf_incrfill_">$Conf{IncrFill}</a> is set (note that the default setting is
4067-off), for each incremental backup, hard links are made in the new
4068-backup to all files that were not extracted during the incremental
4069-backups. The means the incremental backup looks like a complete
4070-image of the PC (with the exception that files that were removed on
4071-the PC since the last full backup will still appear in the backup
4072-directory tree).</p>
4073-<p>The CGI interface knows how to merge unfilled incremental backups will
4074-the most recent prior filled (full) backup, giving the incremental
4075-backups a filled appearance. The default for <a href="#_conf_incrfill_">$Conf{IncrFill}</a> is off,
4076-since there is no need to fill incremental backups. This saves
4077-some level of disk activity, since lots of extra hardlinks are no
4078-longer needed (and don't have to be deleted when the backup expires).</p>
4079-</li>
4080-<li>
4081-<p>BackupPC_trashClean is always run in the background to remove any
4082-expired backups. Every 5 minutes it wakes up and removes all the files
4083-in __TOPDIR__/trash.</p>
4084-<p>Also, once each night, BackupPC_nightly is run to complete some
4085-additional administrative tasks, such as cleaning the pool. This
4086-involves removing any files in the pool that only have a single
4087-hard link (meaning no backups are using that file). Again, to
4088-avoid race conditions, BackupPC_nightly is only run when there
4089-are no BackupPC_link processes running. When BackupPC_nightly is
4090-run no new BackupPC_link jobs are started. If BackupPC_nightly
4091-takes too long to run, the settings <a href="#_conf_maxbackuppcnightlyjobs_">$Conf{MaxBackupPCNightlyJobs}</a>
4092-and <a href="#_conf_backuppcnightlyperiod_">$Conf{BackupPCNightlyPeriod}</a> can be used to run several
4093-BackupPC_nightly processes in parallel, and to split its job over
4094-several nights.</p>
4095+
4096+<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>
4097+
4098+<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>
4099+
4100+</li>
4101+<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>
4102+
4103+<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>
4104+
4105+<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>
4106+
4107+<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>
4108+
4109+</li>
4110+<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>
4111+
4112+<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>
4113+
4114 </li>
4115 </ol>
4116-<p>BackupPC also listens for TCP connections on <a href="#_conf_serverport_">$Conf{ServerPort}</a>, which
4117-is used by the CGI script BackupPC_Admin for status reporting and
4118-user-initiated backup or backup cancel requests.</p>
4119-<p>
4120-</p>
4121-<h2><a name="storage_layout">Storage layout</a></h2>
4122+
4123+<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>
4124+
4125+<h2 id="Storage-layout">Storage layout</h2>
4126+
4127 <p>BackupPC resides in several directories:</p>
4128+
4129 <dl>
4130-<dt><strong><a name="installdir" class="item">__INSTALLDIR__</a></strong></dt>
4131
4132+<dt id="INSTALLDIR__">__INSTALLDIR__</dt>
4133 <dd>
4134-<p>Perl scripts comprising BackupPC reside in __INSTALLDIR__/bin,
4135-libraries are in __INSTALLDIR__/lib and documentation
4136-is in __INSTALLDIR__/doc.</p>
4137+
4138+<p>Perl scripts comprising BackupPC reside in __INSTALLDIR__/bin, libraries are in __INSTALLDIR__/lib and documentation is in __INSTALLDIR__/doc.</p>
4139+
4140 </dd>
4141-<dt><strong><a name="cgidir" class="item">__CGIDIR__</a></strong></dt>
4142+<dt id="CGIDIR__">__CGIDIR__</dt>
4143+<dd>
4144
4145-<dd>
4146 <p>The CGI script BackupPC_Admin resides in this cgi binary directory.</p>
4147+
4148 </dd>
4149-<dt><strong><a name="confdir" class="item">__CONFDIR__</a></strong></dt>
4150-
4151+<dt id="CONFDIR__">__CONFDIR__</dt>
4152 <dd>
4153-<p>All the configuration information resides below __CONFDIR__.
4154-This directory contains:</p>
4155+
4156+<p>All the configuration information resides below __CONFDIR__. This directory contains:</p>
4157+
4158 <p>The directory __CONFDIR__ contains:</p>
4159+
4160 <dl>
4161-<dt><strong><a name="config_pl" class="item">config.pl</a></strong></dt>
4162
4163+<dt id="config.pl">config.pl</dt>
4164 <dd>
4165-<p>Configuration file. See <a href="#configuration_file">Configuration file</a>
4166-below for more details.</p>
4167+
4168+<p>Configuration file. See <a href="#Configuration-File">&quot;Configuration File&quot;</a> below for more details.</p>
4169+
4170 </dd>
4171-<dt><strong><a name="hosts" class="item">hosts</a></strong></dt>
4172+<dt id="hosts">hosts</dt>
4173+<dd>
4174
4175-<dd>
4176 <p>Hosts file, which lists all the PCs to backup.</p>
4177+
4178 </dd>
4179-<dt><strong><a name="pc" class="item">pc</a></strong></dt>
4180-
4181+<dt id="pc">pc</dt>
4182 <dd>
4183-<p>The directory __CONFDIR__/pc contains per-client configuration files
4184-that override settings in the main configuration file. Each file
4185-is named __CONFDIR__/pc/HOST.pl, where HOST is the host name.</p>
4186-<p>In pre-FHS versions of BackupPC these files were located in
4187-__TOPDIR__/pc/HOST/config.pl.</p>
4188+
4189+<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>
4190+
4191+<p>In pre-FHS versions of BackupPC these files were located in __TOPDIR__/pc/HOST/config.pl.</p>
4192+
4193 </dd>
4194 </dl>
4195+
4196 </dd>
4197-<dt><strong><a name="logdir" class="item">__LOGDIR__</a></strong></dt>
4198-
4199+<dt id="LOGDIR__">__LOGDIR__</dt>
4200 <dd>
4201-<p>The directory __LOGDIR__ (__TOPDIR__/log on pre-FHS versions
4202-of BackupPC) contains:</p>
4203+
4204+<p>The directory __LOGDIR__ (__TOPDIR__/log on pre-FHS versions of BackupPC) contains:</p>
4205+
4206 <dl>
4207-<dt><strong><a name="log" class="item">LOG</a></strong></dt>
4208-
4209-<dd>
4210-<p>Current (today's) log file output from BackupPC.</p>
4211-</dd>
4212-<dt><strong><a name="log_0_or_log_0_z" class="item">LOG.0 or LOG.0.z</a></strong></dt>
4213-
4214-<dd>
4215-<p>Yesterday's log file output. Log files are aged daily and compressed
4216-(if compression is enabled), and old LOG files are deleted.</p>
4217-</dd>
4218-<dt><strong><a name="backuppc_pid" class="item">BackupPC.pid</a></strong></dt>
4219-
4220-<dd>
4221-<p>Contains BackupPC's process id.</p>
4222-</dd>
4223-<dt><strong><a name="status_pl" class="item">status.pl</a></strong></dt>
4224-
4225-<dd>
4226-<p>A summary of BackupPC's status written periodically by BackupPC so
4227-that certain state information can be maintained if BackupPC is
4228-restarted. Should not be edited.</p>
4229-</dd>
4230-<dt><strong><a name="useremailinfo_pl" class="item">UserEmailInfo.pl</a></strong></dt>
4231-
4232-<dd>
4233-<p>A summary of what email was last sent to each user, and when the
4234-last email was sent. Should not be edited.</p>
4235+
4236+<dt id="LOG">LOG</dt>
4237+<dd>
4238+
4239+<p>Current (today&#39;s) log file output from BackupPC.</p>
4240+
4241+</dd>
4242+<dt id="LOG.0-or-LOG.0.z">LOG.0 or LOG.0.z</dt>
4243+<dd>
4244+
4245+<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>
4246+
4247+</dd>
4248+<dt id="BackupPC.pid">BackupPC.pid</dt>
4249+<dd>
4250+
4251+<p>Contains BackupPC&#39;s process id.</p>
4252+
4253+</dd>
4254+<dt id="status.pl">status.pl</dt>
4255+<dd>
4256+
4257+<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>
4258+
4259+</dd>
4260+<dt id="UserEmailInfo.pl">UserEmailInfo.pl</dt>
4261+<dd>
4262+
4263+<p>A summary of what email was last sent to each user, and when the last email was sent. Should not be edited.</p>
4264+
4265 </dd>
4266 </dl>
4267+
4268 </dd>
4269-<dt><strong><a name="topdir" class="item">__TOPDIR__</a></strong></dt>
4270-
4271+<dt id="TOPDIR__">__TOPDIR__</dt>
4272 <dd>
4273-<p>All of BackupPC's data (PC backup images, logs, configuration information)
4274-is stored below this directory.</p>
4275+
4276+<p>All of BackupPC&#39;s data (PC backup images, logs, configuration information) is stored below this directory.</p>
4277+
4278 <p>Below __TOPDIR__ are several directories:</p>
4279+
4280 <dl>
4281-<dt><strong><a name="topdir_trash" class="item">__TOPDIR__/trash</a></strong></dt>
4282
4283+<dt id="TOPDIR__-trash">__TOPDIR__/trash</dt>
4284 <dd>
4285-<p>Any directories and files below this directory are periodically deleted
4286-whenever BackupPC_trashClean checks. When a backup is aborted or when an
4287-old backup expires, BackupPC_dump simply moves the directory to
4288-__TOPDIR__/trash for later removal by BackupPC_trashClean.</p>
4289+
4290+<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>
4291+
4292 </dd>
4293-<dt><strong><a name="topdir_pool" class="item">__TOPDIR__/pool</a></strong></dt>
4294-
4295+<dt id="TOPDIR__-pool">__TOPDIR__/pool</dt>
4296 <dd>
4297-<p>All uncompressed files from PC backups are stored below __TOPDIR__/pool.
4298-Each file's name is based on the MD5 hex digest of the file contents.
4299-Specifically, for files less than 256K, the file length and the entire
4300-file is used. For files up to 1MB, the file length and the first and
4301-last 128K are used. Finally, for files longer than 1MB, the file length,
4302-and the first and eighth 128K chunks for the file are used.</p>
4303-<p>Each file is stored in a subdirectory X/Y/Z, where X, Y, Z are the
4304-first 3 hex digits of the MD5 digest.</p>
4305-<p>For example, if a file has an MD5 digest of 123456789abcdef0,
4306-the file is stored in __TOPDIR__/pool/1/2/3/123456789abcdef0.</p>
4307-<p>The MD5 digest might not be unique (especially since not all the file's
4308-contents are used for files bigger than 256K). Different files that have
4309-the same MD5 digest are stored with a trailing suffix &quot;_n&quot; where n is
4310-an incrementing number starting at 0. So, for example, if two additional
4311-files were identical to the first, except the last byte was different,
4312-and assuming the file was larger than 1MB (so the MD5 digests are the
4313-same but the files are actually different), the three files would be
4314-stored as:</p>
4315-<pre>
4316- __TOPDIR__/pool/1/2/3/123456789abcdef0
4317+
4318+<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>
4319+
4320+<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>
4321+
4322+<p>For example, if a file has an MD5 digest of 123456789abcdef0, the file is stored in __TOPDIR__/pool/1/2/3/123456789abcdef0.</p>
4323+
4324+<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>
4325+
4326+<pre><code> __TOPDIR__/pool/1/2/3/123456789abcdef0
4327 __TOPDIR__/pool/1/2/3/123456789abcdef0_0
4328- __TOPDIR__/pool/1/2/3/123456789abcdef0_1</pre>
4329-<p>Both BackupPC_dump (actually, BackupPC_tarExtract) and BackupPC_link are
4330-responsible for checking newly backed up files against the pool. For
4331-each file, the MD5 digest is used to generate a file name in the pool
4332-directory. If the file exists in the pool, the contents are compared.
4333-If there is no match, additional files ending in &quot;_n&quot; are checked.
4334-(Actually, BackupPC_tarExtract compares multiple candidate files in
4335-parallel.) If the file contents exactly match, the file is created by
4336-simply making a hard link to the pool file (this is done by
4337-BackupPC_tarExtract as the backup proceeds). Otherwise,
4338-BackupPC_tarExtract writes the new file to disk and a new hard link is
4339-made in the pool to the file (this is done later by BackupPC_link).</p>
4340-<p>Therefore, every file in the pool will have at least 2 hard links
4341-(one for the pool file and one for the backup file below __TOPDIR__/pc).
4342-Identical files from different backups or PCs will all be linked to
4343-the same file. When old backups are deleted, some files in the pool
4344-might only have one link. BackupPC_nightly checks the entire pool
4345-and removes all files that have only a single link, thereby recovering
4346-the storage for that file.</p>
4347-<p>One other issue: zero length files are not pooled, since there are a lot
4348-of these files and on most file systems it doesn't save any disk space
4349-to turn these files into hard links.</p>
4350-</dd>
4351-<dt><strong><a name="topdir_cpool" class="item">__TOPDIR__/cpool</a></strong></dt>
4352-
4353-<dd>
4354-<p>All compressed files from PC backups are stored below __TOPDIR__/cpool.
4355-Its layout is the same as __TOPDIR__/pool, and the hashing function
4356-is the same (and, importantly, based on the uncompressed file, not
4357-the compressed file).</p>
4358-</dd>
4359-<dt><strong><a name="topdir_pc_host" class="item">__TOPDIR__/pc/$host</a></strong></dt>
4360-
4361-<dd>
4362-<p>For each PC $host, all the backups for that PC are stored below
4363-the directory __TOPDIR__/pc/$host. This directory contains the
4364-following files:</p>
4365+ __TOPDIR__/pool/1/2/3/123456789abcdef0_1</code></pre>
4366+
4367+<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>
4368+
4369+<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>
4370+
4371+<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>
4372+
4373+</dd>
4374+<dt id="TOPDIR__-cpool">__TOPDIR__/cpool</dt>
4375+<dd>
4376+
4377+<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>
4378+
4379+</dd>
4380+<dt id="TOPDIR__-pc-host">__TOPDIR__/pc/$host</dt>
4381+<dd>
4382+
4383+<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>
4384+
4385 <dl>
4386-<dt><strong><a name="log2" class="item">LOG</a></strong></dt>
4387
4388+<dt id="LOG1">LOG</dt>
4389 <dd>
4390+
4391 <p>Current log file for this PC from BackupPC_dump.</p>
4392-</dd>
4393-<dt><strong><a name="log_ddmmyyyy_or_log_ddmmyyyy_z" class="item">LOG.DDMMYYYY or LOG.DDMMYYYY.z</a></strong></dt>
4394-
4395-<dd>
4396-<p>Last month's log file. Log files are aged monthly and compressed
4397-(if compression is enabled), and old LOG files are deleted.
4398-In earlier versions of BackupPC these files used to have
4399-a suffix of 0, 1, ....</p>
4400-</dd>
4401-<dt><strong><a name="xfererr_or_xfererr_z" class="item">XferERR or XferERR.z</a></strong></dt>
4402-
4403-<dd>
4404-<p>Output from the transport program (ie: smbclient, tar, rsync or ftp)
4405-for the most recent failed backup.</p>
4406-</dd>
4407-<dt><strong><a name="new" class="item">new</a></strong></dt>
4408-
4409-<dd>
4410-<p>Subdirectory in which the current backup is stored. This
4411-directory is renamed if the backup succeeds.</p>
4412-</dd>
4413-<dt><strong><a name="xferlog_or_xferlog_z" class="item">XferLOG or XferLOG.z</a></strong></dt>
4414-
4415-<dd>
4416-<p>Output from the transport program (ie: smbclient, tar, rsync or ftp)
4417-for the current backup.</p>
4418-</dd>
4419-<dt><strong><a name="nnn" class="item">nnn (an integer)</a></strong></dt>
4420-
4421-<dd>
4422+
4423+</dd>
4424+<dt id="LOG.DDMMYYYY-or-LOG.DDMMYYYY.z">LOG.DDMMYYYY or LOG.DDMMYYYY.z</dt>
4425+<dd>
4426+
4427+<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>
4428+
4429+</dd>
4430+<dt id="XferERR-or-XferERR.z">XferERR or XferERR.z</dt>
4431+<dd>
4432+
4433+<p>Output from the transport program (ie: smbclient, tar, rsync or ftp) for the most recent failed backup.</p>
4434+
4435+</dd>
4436+<dt id="new">new</dt>
4437+<dd>
4438+
4439+<p>Subdirectory in which the current backup is stored. This directory is renamed if the backup succeeds.</p>
4440+
4441+</dd>
4442+<dt id="XferLOG-or-XferLOG.z">XferLOG or XferLOG.z</dt>
4443+<dd>
4444+
4445+<p>Output from the transport program (ie: smbclient, tar, rsync or ftp) for the current backup.</p>
4446+
4447+</dd>
4448+<dt id="nnn-an-integer-">nnn (an integer)</dt>
4449+<dd>
4450+
4451 <p>Successful backups are in directories numbered sequentially starting at 0.</p>
4452-</dd>
4453-<dt><strong><a name="xferlog_nnn_or_xferlog_nnn_z" class="item">XferLOG.nnn or XferLOG.nnn.z</a></strong></dt>
4454-
4455-<dd>
4456-<p>Output from the transport program (ie: smbclient, tar, rsync or ftp)
4457-corresponding to backup number nnn.</p>
4458-</dd>
4459-<dt><strong><a name="restoreinfo_nnn" class="item">RestoreInfo.nnn</a></strong></dt>
4460-
4461-<dd>
4462-<p>Information about restore request #nnn including who, what, when, and
4463-why. This file is in Data::Dumper format. (Note that the restore
4464-numbers are not related to the backup number.)</p>
4465-</dd>
4466-<dt><strong><a name="restorelog_nnn_z" class="item">RestoreLOG.nnn.z</a></strong></dt>
4467-
4468-<dd>
4469-<p>Output from smbclient, tar or rsync during restore #nnn. (Note that the restore
4470-numbers are not related to the backup number.)</p>
4471-</dd>
4472-<dt><strong><a name="archiveinfo_nnn" class="item">ArchiveInfo.nnn</a></strong></dt>
4473-
4474-<dd>
4475-<p>Information about archive request #nnn including who, what, when, and
4476-why. This file is in Data::Dumper format. (Note that the archive
4477-numbers are not related to the restore or backup number.)</p>
4478-</dd>
4479-<dt><strong><a name="archivelog_nnn_z" class="item">ArchiveLOG.nnn.z</a></strong></dt>
4480-
4481-<dd>
4482-<p>Output from archive #nnn. (Note that the archive numbers are not related
4483-to the backup or restore number.)</p>
4484-</dd>
4485-<dt><strong><a name="config_pl2" class="item">config.pl</a></strong></dt>
4486-
4487-<dd>
4488-<p>Old location of optional configuration settings specific to this host.
4489-Settings in this file override the main configuration file.
4490-In new versions of BackupPC the per-host configuration files are
4491-stored in __CONFDIR__/pc/HOST.pl.</p>
4492-</dd>
4493-<dt><strong><a name="backups" class="item">backups</a></strong></dt>
4494-
4495-<dd>
4496-<p>A tab-delimited ascii table listing information about each successful
4497-backup, one per row. The columns are:</p>
4498+
4499+</dd>
4500+<dt id="XferLOG.nnn-or-XferLOG.nnn.z">XferLOG.nnn or XferLOG.nnn.z</dt>
4501+<dd>
4502+
4503+<p>Output from the transport program (ie: smbclient, tar, rsync or ftp) corresponding to backup number nnn.</p>
4504+
4505+</dd>
4506+<dt id="RestoreInfo.nnn">RestoreInfo.nnn</dt>
4507+<dd>
4508+
4509+<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>
4510+
4511+</dd>
4512+<dt id="RestoreLOG.nnn.z">RestoreLOG.nnn.z</dt>
4513+<dd>
4514+
4515+<p>Output from smbclient, tar or rsync during restore #nnn. (Note that the restore numbers are not related to the backup number.)</p>
4516+
4517+</dd>
4518+<dt id="ArchiveInfo.nnn">ArchiveInfo.nnn</dt>
4519+<dd>
4520+
4521+<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>
4522+
4523+</dd>
4524+<dt id="ArchiveLOG.nnn.z">ArchiveLOG.nnn.z</dt>
4525+<dd>
4526+
4527+<p>Output from archive #nnn. (Note that the archive numbers are not related to the backup or restore number.)</p>
4528+
4529+</dd>
4530+<dt id="config.pl1">config.pl</dt>
4531+<dd>
4532+
4533+<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>
4534+
4535+</dd>
4536+<dt id="backups">backups</dt>
4537+<dd>
4538+
4539+<p>A tab-delimited ascii table listing information about each successful backup, one per row. The columns are:</p>
4540+
4541 <dl>
4542-<dt><strong><a name="num" class="item">num</a></strong></dt>
4543
4544+<dt id="num">num</dt>
4545 <dd>
4546-<p>The backup number, an integer that starts at 0 and increments
4547-for each successive backup. The corresponding backup is stored
4548-in the directory num (eg: if this field is 5, then the backup is
4549-stored in __TOPDIR__/pc/$host/5).</p>
4550+
4551+<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>
4552+
4553 </dd>
4554-<dt><strong><a name="type" class="item">type</a></strong></dt>
4555+<dt id="type">type</dt>
4556+<dd>
4557
4558-<dd>
4559 <p>Set to &quot;full&quot; or &quot;incr&quot; for full or incremental backup.</p>
4560+
4561 </dd>
4562-<dt><strong><a name="starttime" class="item">startTime</a></strong></dt>
4563-
4564+<dt id="startTime">startTime</dt>
4565 <dd>
4566+
4567 <p>Start time of the backup in unix seconds.</p>
4568+
4569 </dd>
4570-<dt><strong><a name="endtime" class="item">endTime</a></strong></dt>
4571-
4572+<dt id="endTime">endTime</dt>
4573 <dd>
4574+
4575 <p>Stop time of the backup in unix seconds.</p>
4576+
4577 </dd>
4578-<dt><strong><a name="nfiles" class="item">nFiles</a></strong></dt>
4579-
4580+<dt id="nFiles">nFiles</dt>
4581 <dd>
4582+
4583 <p>Number of files backed up (as reported by smbclient, tar, rsync or ftp).</p>
4584+
4585 </dd>
4586-<dt><strong><a name="size" class="item">size</a></strong></dt>
4587-
4588+<dt id="size">size</dt>
4589 <dd>
4590+
4591 <p>Total file size backed up (as reported by smbclient, tar, rsync or ftp).</p>
4592-</dd>
4593-<dt><strong><a name="nfilesexist" class="item">nFilesExist</a></strong></dt>
4594-
4595-<dd>
4596-<p>Number of files that were already in the pool
4597-(as determined by BackupPC_dump and BackupPC_link).</p>
4598-</dd>
4599-<dt><strong><a name="sizeexist" class="item">sizeExist</a></strong></dt>
4600-
4601-<dd>
4602-<p>Total size of files that were already in the pool
4603-(as determined by BackupPC_dump and BackupPC_link).</p>
4604-</dd>
4605-<dt><strong><a name="nfilesnew" class="item">nFilesNew</a></strong></dt>
4606-
4607-<dd>
4608-<p>Number of files that were not in the pool
4609-(as determined by BackupPC_link).</p>
4610-</dd>
4611-<dt><strong><a name="sizenew" class="item">sizeNew</a></strong></dt>
4612-
4613-<dd>
4614-<p>Total size of files that were not in the pool
4615-(as determined by BackupPC_link).</p>
4616-</dd>
4617-<dt><strong><a name="xfererrs" class="item">xferErrs</a></strong></dt>
4618-
4619-<dd>
4620+
4621+</dd>
4622+<dt id="nFilesExist">nFilesExist</dt>
4623+<dd>
4624+
4625+<p>Number of files that were already in the pool (as determined by BackupPC_dump and BackupPC_link).</p>
4626+
4627+</dd>
4628+<dt id="sizeExist">sizeExist</dt>
4629+<dd>
4630+
4631+<p>Total size of files that were already in the pool (as determined by BackupPC_dump and BackupPC_link).</p>
4632+
4633+</dd>
4634+<dt id="nFilesNew">nFilesNew</dt>
4635+<dd>
4636+
4637+<p>Number of files that were not in the pool (as determined by BackupPC_link).</p>
4638+
4639+</dd>
4640+<dt id="sizeNew">sizeNew</dt>
4641+<dd>
4642+
4643+<p>Total size of files that were not in the pool (as determined by BackupPC_link).</p>
4644+
4645+</dd>
4646+<dt id="xferErrs">xferErrs</dt>
4647+<dd>
4648+
4649 <p>Number of errors or warnings from smbclient, tar, rsync or ftp.</p>
4650+
4651 </dd>
4652-<dt><strong><a name="xferbadfile" class="item">xferBadFile</a></strong></dt>
4653-
4654+<dt id="xferBadFile">xferBadFile</dt>
4655 <dd>
4656+
4657 <p>Number of errors from smbclient that were bad file errors (zero otherwise).</p>
4658+
4659 </dd>
4660-<dt><strong><a name="xferbadshare" class="item">xferBadShare</a></strong></dt>
4661-
4662+<dt id="xferBadShare">xferBadShare</dt>
4663 <dd>
4664+
4665 <p>Number of errors from smbclient that were bad share errors (zero otherwise).</p>
4666+
4667 </dd>
4668-<dt><strong><a name="tarerrs" class="item">tarErrs</a></strong></dt>
4669-
4670+<dt id="tarErrs">tarErrs</dt>
4671 <dd>
4672+
4673 <p>Number of errors from BackupPC_tarExtract.</p>
4674-</dd>
4675-<dt><strong><a name="compress" class="item">compress</a></strong></dt>
4676-
4677-<dd>
4678-<p>The compression level used on this backup. Zero or empty means no
4679-compression.</p>
4680-</dd>
4681-<dt><strong><a name="sizeexistcomp" class="item">sizeExistComp</a></strong></dt>
4682-
4683-<dd>
4684-<p>Total compressed size of files that were already in the pool
4685-(as determined by BackupPC_dump and BackupPC_link).</p>
4686-</dd>
4687-<dt><strong><a name="sizenewcomp" class="item">sizeNewComp</a></strong></dt>
4688-
4689-<dd>
4690-<p>Total compressed size of files that were not in the pool
4691-(as determined by BackupPC_link).</p>
4692-</dd>
4693-<dt><strong><a name="nofill" class="item">noFill</a></strong></dt>
4694-
4695-<dd>
4696-<p>Set if this backup has not been filled in with the most recent
4697-previous filled or full backup. See <a href="#_conf_incrfill_">$Conf{IncrFill}</a>.</p>
4698-</dd>
4699-<dt><strong><a name="fillfromnum" class="item">fillFromNum</a></strong></dt>
4700-
4701-<dd>
4702-<p>If this backup was filled (ie: noFill is 0) then this is the
4703-number of the backup that it was filled from</p>
4704-</dd>
4705-<dt><strong><a name="mangle" class="item">mangle</a></strong></dt>
4706-
4707-<dd>
4708-<p>Set if this backup has mangled file names and attributes. Always
4709-true for backups in v1.4.0 and above. False for all backups prior
4710-to v1.4.0.</p>
4711-</dd>
4712-<dt><strong><a name="xfermethod" class="item">xferMethod</a></strong></dt>
4713-
4714-<dd>
4715+
4716+</dd>
4717+<dt id="compress">compress</dt>
4718+<dd>
4719+
4720+<p>The compression level used on this backup. Zero or empty means no compression.</p>
4721+
4722+</dd>
4723+<dt id="sizeExistComp">sizeExistComp</dt>
4724+<dd>
4725+
4726+<p>Total compressed size of files that were already in the pool (as determined by BackupPC_dump and BackupPC_link).</p>
4727+
4728+</dd>
4729+<dt id="sizeNewComp">sizeNewComp</dt>
4730+<dd>
4731+
4732+<p>Total compressed size of files that were not in the pool (as determined by BackupPC_link).</p>
4733+
4734+</dd>
4735+<dt id="noFill">noFill</dt>
4736+<dd>
4737+
4738+<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>
4739+
4740+</dd>
4741+<dt id="fillFromNum">fillFromNum</dt>
4742+<dd>
4743+
4744+<p>If this backup was filled (ie: noFill is 0) then this is the number of the backup that it was filled from</p>
4745+
4746+</dd>
4747+<dt id="mangle">mangle</dt>
4748+<dd>
4749+
4750+<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>
4751+
4752+</dd>
4753+<dt id="xferMethod">xferMethod</dt>
4754+<dd>
4755+
4756 <p>Set to the value of <a href="#_conf_xfermethod_">$Conf{XferMethod}</a> when this dump was done.</p>
4757+
4758 </dd>
4759-<dt><strong><a name="level" class="item">level</a></strong></dt>
4760-
4761+<dt id="level">level</dt>
4762 <dd>
4763-<p>The level of this dump. A full dump is level 0. Currently incrementals
4764-are 1. But when multi-level incrementals are supported this will reflect
4765-each dump's incremental level.</p>
4766+
4767+<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>
4768+
4769 </dd>
4770 </dl>
4771+
4772 </dd>
4773-<dt><strong><a name="restores" class="item">restores</a></strong></dt>
4774-
4775+<dt id="restores">restores</dt>
4776 <dd>
4777-<p>A tab-delimited ascii table listing information about each requested
4778-restore, one per row. The columns are:</p>
4779+
4780+<p>A tab-delimited ascii table listing information about each requested restore, one per row. The columns are:</p>
4781+
4782 <dl>
4783-<dt><strong>num</strong></dt>
4784
4785+<dt id="num1">num</dt>
4786 <dd>
4787-<p>Restore number (matches the suffix of the RestoreInfo.nnn and
4788-RestoreLOG.nnn.z file), unrelated to the backup number.</p>
4789+
4790+<p>Restore number (matches the suffix of the RestoreInfo.nnn and RestoreLOG.nnn.z file), unrelated to the backup number.</p>
4791+
4792 </dd>
4793-<dt><strong><a name="starttime2" class="item">startTime</a></strong></dt>
4794+<dt id="startTime1">startTime</dt>
4795+<dd>
4796
4797-<dd>
4798 <p>Start time of the restore in unix seconds.</p>
4799+
4800 </dd>
4801-<dt><strong><a name="endtime2" class="item">endTime</a></strong></dt>
4802-
4803+<dt id="endTime1">endTime</dt>
4804 <dd>
4805+
4806 <p>End time of the restore in unix seconds.</p>
4807+
4808 </dd>
4809-<dt><strong><a name="result" class="item">result</a></strong></dt>
4810-
4811+<dt id="result">result</dt>
4812 <dd>
4813+
4814 <p>Result (ok or failed).</p>
4815+
4816 </dd>
4817-<dt><strong><a name="errormsg" class="item">errorMsg</a></strong></dt>
4818-
4819+<dt id="errorMsg">errorMsg</dt>
4820 <dd>
4821+
4822 <p>Error message if restore failed.</p>
4823+
4824 </dd>
4825-<dt><strong><a name="nfiles2" class="item">nFiles</a></strong></dt>
4826-
4827+<dt id="nFiles1">nFiles</dt>
4828 <dd>
4829+
4830 <p>Number of files restored.</p>
4831+
4832 </dd>
4833-<dt><strong>size</strong></dt>
4834-
4835+<dt id="size1">size</dt>
4836 <dd>
4837+
4838 <p>Size in bytes of the restored files.</p>
4839+
4840 </dd>
4841-<dt><strong><a name="tarcreateerrs" class="item">tarCreateErrs</a></strong></dt>
4842-
4843+<dt id="tarCreateErrs">tarCreateErrs</dt>
4844 <dd>
4845+
4846 <p>Number of errors from BackupPC_tarCreate during restore.</p>
4847+
4848 </dd>
4849-<dt><strong><a name="xfererrs2" class="item">xferErrs</a></strong></dt>
4850-
4851+<dt id="xferErrs1">xferErrs</dt>
4852 <dd>
4853+
4854 <p>Number of errors from smbclient, tar, rsync or ftp during restore.</p>
4855+
4856 </dd>
4857 </dl>
4858+
4859 </dd>
4860-<dt><strong><a name="archives" class="item">archives</a></strong></dt>
4861-
4862+<dt id="archives">archives</dt>
4863 <dd>
4864-<p>A tab-delimited ascii table listing information about each requested
4865-archive, one per row. The columns are:</p>
4866+
4867+<p>A tab-delimited ascii table listing information about each requested archive, one per row. The columns are:</p>
4868+
4869 <dl>
4870-<dt><strong>num</strong></dt>
4871
4872+<dt id="num2">num</dt>
4873 <dd>
4874-<p>Archive number (matches the suffix of the ArchiveInfo.nnn and
4875-ArchiveLOG.nnn.z file), unrelated to the backup or restore number.</p>
4876+
4877+<p>Archive number (matches the suffix of the ArchiveInfo.nnn and ArchiveLOG.nnn.z file), unrelated to the backup or restore number.</p>
4878+
4879 </dd>
4880-<dt><strong><a name="starttime3" class="item">startTime</a></strong></dt>
4881+<dt id="startTime2">startTime</dt>
4882+<dd>
4883
4884-<dd>
4885 <p>Start time of the restore in unix seconds.</p>
4886+
4887 </dd>
4888-<dt><strong><a name="endtime3" class="item">endTime</a></strong></dt>
4889-
4890+<dt id="endTime2">endTime</dt>
4891 <dd>
4892+
4893 <p>End time of the restore in unix seconds.</p>
4894+
4895 </dd>
4896-<dt><strong>result</strong></dt>
4897-
4898+<dt id="result1">result</dt>
4899 <dd>
4900+
4901 <p>Result (ok or failed).</p>
4902+
4903 </dd>
4904-<dt><strong><a name="errormsg2" class="item">errorMsg</a></strong></dt>
4905-
4906+<dt id="errorMsg1">errorMsg</dt>
4907 <dd>
4908+
4909 <p>Error message if archive failed.</p>
4910-</dd>
4911-</dl>
4912-</dd>
4913-</dl>
4914-</dd>
4915-</dl>
4916-</dd>
4917-</dl>
4918-<p>
4919-</p>
4920-<h2><a name="compressed_file_format">Compressed file format</a></h2>
4921-<p>The compressed file format is as generated by Compress::Zlib::deflate
4922-with one minor, but important, tweak. Since Compress::Zlib::inflate
4923-fully inflates its argument in memory, it could take large amounts of
4924-memory if it was inflating a highly compressed file. For example, a
4925-200MB file of 0x0 bytes compresses to around 200K bytes. If
4926-Compress::Zlib::inflate was called with this single 200K buffer, it
4927-would need to allocate 200MB of memory to return the result.</p>
4928-<p>BackupPC watches how efficiently a file is compressing. If a big file
4929-has very high compression (meaning it will use too much memory when it
4930-is inflated), BackupPC calls the <code>flush()</code> method, which gracefully
4931-completes the current compression. BackupPC then starts another
4932-deflate and simply appends the output file. So the BackupPC compressed
4933-file format is one or more concatenated deflations/flushes. The specific
4934-ratios that BackupPC uses is that if a 6MB chunk compresses to less
4935-than 64K then a flush will be done.</p>
4936-<p>Back to the example of the 200MB file of 0x0 bytes. Adding flushes
4937-every 6MB adds only 200 or so bytes to the 200K output. So the
4938-storage cost of flushing is negligible.</p>
4939-<p>To easily decompress a BackupPC compressed file, the script
4940-BackupPC_zcat can be found in __INSTALLDIR__/bin. For each
4941-file name argument it inflates the file and writes it to stdout.</p>
4942-<p>
4943-</p>
4944-<h2><a name="rsync_checksum_caching">Rsync checksum caching</a></h2>
4945-<p>An incremental backup with rsync compares attributes on the client
4946-with the last full backup. Any files with identical attributes
4947-are skipped. A full backup with rsync sets the --ignore-times
4948-option, which causes every file to be examined independent of
4949-attributes.</p>
4950-<p>Each file is examined by generating block checksums (default 2K
4951-blocks) on the receiving side (that's the BackupPC side), sending
4952-those checksums to the client, where the remote rsync matches those
4953-checksums with the corresponding file. The matching blocks and new
4954-data is sent back, allowing the client file to be reassembled.
4955-A checksum for the entire file is sent to as an extra check the
4956-the reconstructed file is correct.</p>
4957-<p>This results in significant disk IO and computation for BackupPC:
4958-every file in a full backup, or any file with non-matching attributes
4959-in an incremental backup, needs to be uncompressed, block checksums
4960-computed and sent. Then the receiving side reassembles the file and
4961-has to verify the whole-file checksum. Even if the file is identical,
4962-prior to 2.1.0, BackupPC had to read and uncompress the file twice,
4963-once to compute the block checksums and later to verify the whole-file
4964-checksum.</p>
4965-<p>Starting in 2.1.0, BackupPC supports optional checksum caching,
4966-which means the block and file checksums only need to be computed
4967-once for each file. This results in a significant performance
4968-improvement. This only works for compressed pool files.
4969-It is enabled by adding</p>
4970-<pre>
4971- '--checksum-seed=32761',</pre>
4972+
4973+</dd>
4974+</dl>
4975+
4976+</dd>
4977+</dl>
4978+
4979+</dd>
4980+</dl>
4981+
4982+</dd>
4983+</dl>
4984+
4985+<h2 id="Compressed-file-format">Compressed file format</h2>
4986+
4987+<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>
4988+
4989+<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>
4990+
4991+<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>
4992+
4993+<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>
4994+
4995+<h2 id="Rsync-checksum-caching">Rsync checksum caching</h2>
4996+
4997+<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>
4998+
4999+<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>
5000+
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches