From 79e0593c501fd58046feeca20c315cc4ac283435 Mon Sep 17 00:00:00 2001 From: cbarratt Date: Sun, 23 May 2004 06:26:22 +0000 Subject: [PATCH] * Revision update for 2.1.0beta2. * $Conf{BackupFilesOnly} and $Conf{BackupFilesExclude} now apply to every share, rather than just the first, in the case where they are arrays and there are multiple shares. Suggested by Andy Evans. * fix to BackupPC::CGI::Lib in case can't read config.pl or lang strings. * minor tweak to es.pm. --- ChangeLog | 7 +- bin/BackupPC | 2 +- bin/BackupPC_archive | 2 +- bin/BackupPC_archiveHost | 2 +- bin/BackupPC_compressPool | 2 +- bin/BackupPC_dump | 2 +- bin/BackupPC_link | 2 +- bin/BackupPC_nightly | 2 +- bin/BackupPC_restore | 2 +- bin/BackupPC_sendEmail | 2 +- bin/BackupPC_serverMesg | 2 +- bin/BackupPC_tarCreate | 2 +- bin/BackupPC_tarExtract | 2 +- bin/BackupPC_trashClean | 2 +- bin/BackupPC_zcat | 2 +- bin/BackupPC_zipCreate | 2 +- cgi-bin/BackupPC_Admin | 2 +- doc-src/BackupPC.pod | 106 +++++++++++++++++++++++++++- lib/BackupPC/Attrib.pm | 2 +- lib/BackupPC/CGI/AdminOptions.pm | 2 +- lib/BackupPC/CGI/Archive.pm | 2 +- lib/BackupPC/CGI/ArchiveInfo.pm | 2 +- lib/BackupPC/CGI/Browse.pm | 2 +- lib/BackupPC/CGI/DirHistory.pm | 2 +- lib/BackupPC/CGI/EmailSummary.pm | 2 +- lib/BackupPC/CGI/GeneralInfo.pm | 2 +- lib/BackupPC/CGI/HostInfo.pm | 2 +- lib/BackupPC/CGI/LOGlist.pm | 2 +- lib/BackupPC/CGI/Lib.pm | 4 +- lib/BackupPC/CGI/Queue.pm | 2 +- lib/BackupPC/CGI/ReloadServer.pm | 2 +- lib/BackupPC/CGI/Restore.pm | 5 +- lib/BackupPC/CGI/RestoreFile.pm | 2 +- lib/BackupPC/CGI/RestoreInfo.pm | 2 +- lib/BackupPC/CGI/StartServer.pm | 2 +- lib/BackupPC/CGI/StartStopBackup.pm | 2 +- lib/BackupPC/CGI/StopServer.pm | 2 +- lib/BackupPC/CGI/Summary.pm | 2 +- lib/BackupPC/CGI/View.pm | 2 +- lib/BackupPC/FileZIO.pm | 2 +- lib/BackupPC/Lang/es.pm | 4 +- lib/BackupPC/Lib.pm | 22 +++++- lib/BackupPC/PoolWrite.pm | 2 +- lib/BackupPC/View.pm | 2 +- lib/BackupPC/Xfer/Archive.pm | 2 +- lib/BackupPC/Xfer/Rsync.pm | 23 ++---- lib/BackupPC/Xfer/RsyncDigest.pm | 2 +- lib/BackupPC/Xfer/RsyncFileIO.pm | 2 +- lib/BackupPC/Xfer/Smb.pm | 23 ++---- lib/BackupPC/Xfer/Tar.pm | 23 ++---- lib/BackupPC/Zip/FileMember.pm | 2 +- makeDist | 4 +- 52 files changed, 193 insertions(+), 112 deletions(-) diff --git a/ChangeLog b/ChangeLog index ef5db9b..cb4d6c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,7 +21,10 @@ # Version __VERSION__, __RELEASEDATE__ #------------------------------------------------------------------------ -** Add checksum caching info and file format to the docs. +* $Conf{BackupFilesOnly} and $Conf{BackupFilesExclude} now apply + to every share, rather than just the first, in the case where + they are arrays and there are multiple shares. Suggested + by Andy Evans. * On the phase 2 retry pass with rsync, verify the cached checksums if checksum caching is turned on. This will catch the case of @@ -32,7 +35,7 @@ * configure.pl now supports an optional batch mode. Command-line options are used to specify all the information that configure.pl - needs. This is useful for buidling auto-install packages. + needs. This is useful for building auto-install packages. Also, configure.pl now includes pod documentation, so you can do "perldoc configure.pl" to see all the command-line options. Suggested, tested and tweaked by Stuart Herbert for possible diff --git a/bin/BackupPC b/bin/BackupPC index 3d86d96..0469259 100755 --- a/bin/BackupPC +++ b/bin/BackupPC @@ -47,7 +47,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/bin/BackupPC_archive b/bin/BackupPC_archive index 3d9567f..8a7683a 100644 --- a/bin/BackupPC_archive +++ b/bin/BackupPC_archive @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/bin/BackupPC_archiveHost b/bin/BackupPC_archiveHost index 598347d..e2ee002 100755 --- a/bin/BackupPC_archiveHost +++ b/bin/BackupPC_archiveHost @@ -38,7 +38,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/bin/BackupPC_compressPool b/bin/BackupPC_compressPool index b903268..24be42a 100755 --- a/bin/BackupPC_compressPool +++ b/bin/BackupPC_compressPool @@ -49,7 +49,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/bin/BackupPC_dump b/bin/BackupPC_dump index 5ea4259..d2ed361 100755 --- a/bin/BackupPC_dump +++ b/bin/BackupPC_dump @@ -70,7 +70,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/bin/BackupPC_link b/bin/BackupPC_link index 8c75cde..8cc2894 100755 --- a/bin/BackupPC_link +++ b/bin/BackupPC_link @@ -39,7 +39,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/bin/BackupPC_nightly b/bin/BackupPC_nightly index b3a4802..03d5e2d 100755 --- a/bin/BackupPC_nightly +++ b/bin/BackupPC_nightly @@ -52,7 +52,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/bin/BackupPC_restore b/bin/BackupPC_restore index 483615e..5843a01 100755 --- a/bin/BackupPC_restore +++ b/bin/BackupPC_restore @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/bin/BackupPC_sendEmail b/bin/BackupPC_sendEmail index 0f3b67b..03b5aea 100755 --- a/bin/BackupPC_sendEmail +++ b/bin/BackupPC_sendEmail @@ -31,7 +31,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/bin/BackupPC_serverMesg b/bin/BackupPC_serverMesg index 9ad000f..3553b7a 100755 --- a/bin/BackupPC_serverMesg +++ b/bin/BackupPC_serverMesg @@ -43,7 +43,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/bin/BackupPC_tarCreate b/bin/BackupPC_tarCreate index 64b2b49..3254610 100755 --- a/bin/BackupPC_tarCreate +++ b/bin/BackupPC_tarCreate @@ -51,7 +51,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/bin/BackupPC_tarExtract b/bin/BackupPC_tarExtract index c18dc95..60c4abe 100755 --- a/bin/BackupPC_tarExtract +++ b/bin/BackupPC_tarExtract @@ -27,7 +27,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/bin/BackupPC_trashClean b/bin/BackupPC_trashClean index 2d8f413..2c5778e 100755 --- a/bin/BackupPC_trashClean +++ b/bin/BackupPC_trashClean @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/bin/BackupPC_zcat b/bin/BackupPC_zcat index e758193..caf5d99 100755 --- a/bin/BackupPC_zcat +++ b/bin/BackupPC_zcat @@ -32,7 +32,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/bin/BackupPC_zipCreate b/bin/BackupPC_zipCreate index 74c4bf4..973995e 100755 --- a/bin/BackupPC_zipCreate +++ b/bin/BackupPC_zipCreate @@ -51,7 +51,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/cgi-bin/BackupPC_Admin b/cgi-bin/BackupPC_Admin index 81b85ad..dfb7fcd 100755 --- a/cgi-bin/BackupPC_Admin +++ b/cgi-bin/BackupPC_Admin @@ -39,7 +39,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/doc-src/BackupPC.pod b/doc-src/BackupPC.pod index 1362a97..f4d0e4a 100644 --- a/doc-src/BackupPC.pod +++ b/doc-src/BackupPC.pod @@ -333,6 +333,35 @@ collisions with the attrib file. =item * +Adding support for FTP (via Net::FTP) and/or wget (for HTTP and FTP) +as additional XferMethods. One question with ftp is whether you can +support incrementals. It should be possible. For example, you could +use Net::FTP->ls to list each directory, and get the file sizes and +mtimes. That would allow incrementals to be supported: only backup +the files that have different sizes or mtimes for an incremental. +You also need the ls() function to recurse directories. The code +would need to be robust to the different formats returned by ls() on +different clients. + +For wget there would be a new module called BackupPC::Xfer::Wget that +uses wget. Wget can do both http and ftp. Certainly backing up a web +site via ftp is better than http, especially when there is active +content and not just static pages. But the benefit of supporting http +is that you could use it to backup config pages of network hardware +(eg: routers etc). So if a router fails you have a copy of the config +screens and settings. (And the future tripwire feature on the todo +list could tell you if someone messed with the router settings.) +Probably the only choice with wget is to fetch all the files +(either via ftp or http) into a temporary directory, then run +tar on that directory and pipe it into BackupPC_tarExtract. + +The advantage of using wget is you get both http and ftp. +The disadvantage is that you can't support incrementals +with wget, but you can with Net::FTP. Also people will +find wget harder to configure and run. + +=item * + Replacing smbclient with the perl module FileSys::SmbClient. This gives much more direct control of the smb transfer, allowing incrementals to depend on any attribute change (eg: exist, mtime, @@ -491,8 +520,7 @@ As of June 2003 the latest version is 1.13.25. If you are using rsync to backup linux/unix machines you should have version 2.5.5 or higher on each client machine. See -L. Use "rsync --version" to check your -version. +L. Use "rsync --version" to check your version. For BackupPC to use Rsync you will also need to install the perl File::RsyncP module, which is available from @@ -586,7 +614,7 @@ You can run "perldoc Archive::Zip" to see if this module is installed. To use rsync and rsyncd with BackupPC you will need to install File::RsyncP. You can run "perldoc File::RsyncP" to see if this module is installed. File::RsyncP is available from L. -Version 0.44 or later is required. +Version 0.51 or later is required. =back @@ -849,6 +877,12 @@ 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 build your own rsync, for rsync 2.6.2 it is strongly +recommended you apply the patch in the cygwin-rsync package on +L. This patch adds the --checksum-seed +option for checksum caching, and also sends all errors to the client, +which is important so BackupPC can log all file access errors. + Otherwise, to use SMB, you need to create shares for the data you want to backup. Open "My Computer", right click on the drive (eg: C), and select "Sharing..." (or select "Properties" and select the "Sharing" @@ -2721,6 +2755,72 @@ 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. +=head2 Rsync checksum caching + +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. + +Each file is examined by generating block checksums (default 2K +blocks) on the receiving side (that'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. + +This results in significant disk IO and computation for BackupPC: +every file in a full backup, or any file with non-matching attributes +in an incremental backup, needs to be uncompressed, block checksums +computed and sent. Then the receiving side reassembles the file and +has to verify the whole-file checksum. Even if the file is identical, +prior to 2.1.0, BackupPC had to read and uncompress the file twice, +once to compute the block checksums and later to verify the whole-file +checksum. + +Starting in 2.1.0, BackupPC supports optional checksum caching, +which means the block and file checksums only need to be computed +once for each file. This results in a significant performance +improvement. This only works for compressed pool files. +It is enabled by adding + + '--checksum-seed=32761', + +to $Conf{RsyncArgs} and $Conf{RsyncRestoreArgs}. + +Rsync versions prior to and including rsync-2.6.2 need a small patch to +add support for the --checksum-seed option. This patch is available in +the cygwin-rsyncd package at L. +This patch is already included in rsync CVS, so it will be standard +in future versions of rsync. + +When this option is present, BackupPC will add block and file checksums +to the compressed pool file the next time a pool file is used and it +doesn't already have cached checksums. The first time a new file is +written to the pool, the checksums are not appended. The next time +checksums are needed for a file, they are computed and added. So the +full performance benefit of checksum caching won't be noticed until the +third time a pool file is used (eg: the third full backup). + +With checksum caching enabled, there is a risk that should a file's contents +in the pool be corrupted due to a disk problem, but the cached checksums +are still correct, the corruption will not be detected by a full backup, +since the file contents are no longer read and compared. To reduce the +chance that this remains undetected, BackupPC can recheck cached checksums +for a fraction of the files. This fraction is set with the +$Conf{RsyncCsumCacheVerifyProb} setting. The default value of 0.01 means +that 1% of the time a file's checksums are read, the checksums are verified. +This reduces performance slightly, but, over time, ensures that files +contents are in sync with the cached checksums. + +The format of the cached checksum data can be discovered by looking at +the code. Basically, the first byte of the compressed file is changed +to denote that checksums are appended. The block and file checksum +data, plus some other information and magic word, are appended to the +compressed file. This allows the cache update to be done in-place. + =head2 File name mangling Backup file names are stored in "mangled" form. Each node of diff --git a/lib/BackupPC/Attrib.pm b/lib/BackupPC/Attrib.pm index 73f6f1e..0c7b264 100644 --- a/lib/BackupPC/Attrib.pm +++ b/lib/BackupPC/Attrib.pm @@ -30,7 +30,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/AdminOptions.pm b/lib/BackupPC/CGI/AdminOptions.pm index ab9b752..7c3e48f 100644 --- a/lib/BackupPC/CGI/AdminOptions.pm +++ b/lib/BackupPC/CGI/AdminOptions.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/Archive.pm b/lib/BackupPC/CGI/Archive.pm index 590dd1f..e66babe 100644 --- a/lib/BackupPC/CGI/Archive.pm +++ b/lib/BackupPC/CGI/Archive.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/ArchiveInfo.pm b/lib/BackupPC/CGI/ArchiveInfo.pm index 2ee5836..0244390 100644 --- a/lib/BackupPC/CGI/ArchiveInfo.pm +++ b/lib/BackupPC/CGI/ArchiveInfo.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/Browse.pm b/lib/BackupPC/CGI/Browse.pm index ec30256..df4f4d0 100644 --- a/lib/BackupPC/CGI/Browse.pm +++ b/lib/BackupPC/CGI/Browse.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/DirHistory.pm b/lib/BackupPC/CGI/DirHistory.pm index a7ea4bd..11de3d9 100644 --- a/lib/BackupPC/CGI/DirHistory.pm +++ b/lib/BackupPC/CGI/DirHistory.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/EmailSummary.pm b/lib/BackupPC/CGI/EmailSummary.pm index f42e385..7013f88 100644 --- a/lib/BackupPC/CGI/EmailSummary.pm +++ b/lib/BackupPC/CGI/EmailSummary.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/GeneralInfo.pm b/lib/BackupPC/CGI/GeneralInfo.pm index 8e1968a..3a79d34 100644 --- a/lib/BackupPC/CGI/GeneralInfo.pm +++ b/lib/BackupPC/CGI/GeneralInfo.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/HostInfo.pm b/lib/BackupPC/CGI/HostInfo.pm index 109e21b..e4894fd 100644 --- a/lib/BackupPC/CGI/HostInfo.pm +++ b/lib/BackupPC/CGI/HostInfo.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/LOGlist.pm b/lib/BackupPC/CGI/LOGlist.pm index 05ae3da..1c7a6d0 100644 --- a/lib/BackupPC/CGI/LOGlist.pm +++ b/lib/BackupPC/CGI/LOGlist.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/Lib.pm b/lib/BackupPC/CGI/Lib.pm index 307e441..b67be91 100644 --- a/lib/BackupPC/CGI/Lib.pm +++ b/lib/BackupPC/CGI/Lib.pm @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # @@ -408,7 +408,7 @@ sub Header priv => 1}, { link => "?action=queue", name => $Lang->{Current_queues}, priv => 1}, - @{$Conf{CgiNavBarLinks}}, + @{$Conf{CgiNavBarLinks} || []}, ); my $host = $In{host}; diff --git a/lib/BackupPC/CGI/Queue.pm b/lib/BackupPC/CGI/Queue.pm index 6b0a9cc..5bfbdd1 100644 --- a/lib/BackupPC/CGI/Queue.pm +++ b/lib/BackupPC/CGI/Queue.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/ReloadServer.pm b/lib/BackupPC/CGI/ReloadServer.pm index 27a9add..c5002ca 100644 --- a/lib/BackupPC/CGI/ReloadServer.pm +++ b/lib/BackupPC/CGI/ReloadServer.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/Restore.pm b/lib/BackupPC/CGI/Restore.pm index 11ed25b..c627712 100644 --- a/lib/BackupPC/CGI/Restore.pm +++ b/lib/BackupPC/CGI/Restore.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # @@ -87,9 +87,6 @@ EOF if ( $badFileCnt ) { ErrorExit($Lang->{Nice_try__but_you_can_t_put}); } - if ( @fileList == 1 ) { - $pathHdr =~ s/(.*)\/.*/$1/; - } $pathHdr = "/" if ( $pathHdr eq "" ); if ( $In{type} != 0 && @fileList == $In{fcbMax} ) { # diff --git a/lib/BackupPC/CGI/RestoreFile.pm b/lib/BackupPC/CGI/RestoreFile.pm index 52f3e90..38dae72 100644 --- a/lib/BackupPC/CGI/RestoreFile.pm +++ b/lib/BackupPC/CGI/RestoreFile.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/RestoreInfo.pm b/lib/BackupPC/CGI/RestoreInfo.pm index a693795..c50565c 100644 --- a/lib/BackupPC/CGI/RestoreInfo.pm +++ b/lib/BackupPC/CGI/RestoreInfo.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/StartServer.pm b/lib/BackupPC/CGI/StartServer.pm index f40910b..fd667a0 100644 --- a/lib/BackupPC/CGI/StartServer.pm +++ b/lib/BackupPC/CGI/StartServer.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/StartStopBackup.pm b/lib/BackupPC/CGI/StartStopBackup.pm index dc345a6..cbc67ca 100644 --- a/lib/BackupPC/CGI/StartStopBackup.pm +++ b/lib/BackupPC/CGI/StartStopBackup.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/StopServer.pm b/lib/BackupPC/CGI/StopServer.pm index dd22921..0332f36 100644 --- a/lib/BackupPC/CGI/StopServer.pm +++ b/lib/BackupPC/CGI/StopServer.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/Summary.pm b/lib/BackupPC/CGI/Summary.pm index a485cd3..a921a84 100644 --- a/lib/BackupPC/CGI/Summary.pm +++ b/lib/BackupPC/CGI/Summary.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/View.pm b/lib/BackupPC/CGI/View.pm index 7fc95a0..378e31e 100644 --- a/lib/BackupPC/CGI/View.pm +++ b/lib/BackupPC/CGI/View.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0beta2, released 9 May 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/FileZIO.pm b/lib/BackupPC/FileZIO.pm index 84fca36..2b6e70f 100644 --- a/lib/BackupPC/FileZIO.pm +++ b/lib/BackupPC/FileZIO.pm @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/Lang/es.pm b/lib/BackupPC/Lang/es.pm index 30dade2..0d32b38 100644 --- a/lib/BackupPC/Lang/es.pm +++ b/lib/BackupPC/Lang/es.pm @@ -715,7 +715,7 @@ EOF $Lang{Host__host_Archive_Summary} = "BackupPC: Host \$host Archive Summary"; $Lang{Host__host_Archive_Summary2} = < \$warnStr
    @@ -834,7 +834,7 @@ $Lang{DirHistory_dirLink} = "dir"; $Lang{DirHistory_fileLink} = "v"; $Lang{DirHistory_for__host} = < Esta pantalla muestra cada versión única de archivos de entre todas las copias de seguridad: diff --git a/lib/BackupPC/Lib.pm b/lib/BackupPC/Lib.pm index ad6af10..560a680 100644 --- a/lib/BackupPC/Lib.pm +++ b/lib/BackupPC/Lib.pm @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # @@ -59,7 +59,7 @@ sub new TopDir => $topDir || '/data/BackupPC', BinDir => $installDir || '/usr/local/BackupPC', LibDir => $installDir || '/usr/local/BackupPC', - Version => '2.1.0beta1', + Version => '2.1.0beta2', BackupFields => [qw( num type startTime endTime nFiles size nFilesExist sizeExist nFilesNew sizeNew @@ -1200,4 +1200,22 @@ sub cmdSystemOrEval return $out; } +# +# Promotes $conf->{BackupFilesOnly}, $conf->{BackupFilesExclude} +# to hashes and $conf->{$shareName} to an array +# +sub backupFileConfFix +{ + my($bpc, $conf, $shareName) = @_; + + $conf->{$shareName} = [ $conf->{$shareName} ] + if ( ref($conf->{$shareName}) ne "ARRAY" ); + foreach my $param qw(BackupFilesOnly BackupFilesExclude) { + next if ( !defined($conf->{$param}) || ref($conf->{$param}) eq "HASH" ); + $conf->{$param} = [ $conf->{$param} ] + if ( ref($conf->{$param}) ne "ARRAY" ); + $conf->{$param} = { map { $_ => $conf->{$param} } @{$conf->{$shareName}} }; + } +} + 1; diff --git a/lib/BackupPC/PoolWrite.pm b/lib/BackupPC/PoolWrite.pm index b8d0cdf..2cfd8dc 100644 --- a/lib/BackupPC/PoolWrite.pm +++ b/lib/BackupPC/PoolWrite.pm @@ -56,7 +56,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/View.pm b/lib/BackupPC/View.pm index 3083dfc..5d48359 100644 --- a/lib/BackupPC/View.pm +++ b/lib/BackupPC/View.pm @@ -31,7 +31,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/Xfer/Archive.pm b/lib/BackupPC/Xfer/Archive.pm index ba86fb3..a2f8248 100644 --- a/lib/BackupPC/Xfer/Archive.pm +++ b/lib/BackupPC/Xfer/Archive.pm @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/Xfer/Rsync.pm b/lib/BackupPC/Xfer/Rsync.pm index d3358c9..888117c 100644 --- a/lib/BackupPC/Xfer/Rsync.pm +++ b/lib/BackupPC/Xfer/Rsync.pm @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.1.0beta2, released 9 May 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # @@ -141,24 +141,11 @@ sub start } else { # # Turn $conf->{BackupFilesOnly} and $conf->{BackupFilesExclude} - # into a hash of arrays of files. + # into a hash of arrays of files, and $conf->{RsyncShareName} + # to an array # - $conf->{RsyncShareName} = [ $conf->{RsyncShareName} ] - unless ref($conf->{RsyncShareName}) eq "ARRAY"; - foreach my $param qw(BackupFilesOnly BackupFilesExclude) { - next if ( !defined($conf->{$param}) ); - if ( ref($conf->{$param}) eq "ARRAY" ) { - $conf->{$param} = { - $conf->{RsyncShareName}[0] => $conf->{$param} - }; - } elsif ( ref($conf->{$param}) eq "HASH" ) { - # do nothing - } else { - $conf->{$param} = { - $conf->{RsyncShareName}[0] => [ $conf->{$param} ] - }; - } - } + $bpc->backupFileConfFix($conf, "RsyncShareName"); + if ( defined($conf->{BackupFilesOnly}{$t->{shareName}}) ) { my(@inc, @exc, %incDone, %excDone); foreach my $file ( @{$conf->{BackupFilesOnly}{$t->{shareName}}} ) { diff --git a/lib/BackupPC/Xfer/RsyncDigest.pm b/lib/BackupPC/Xfer/RsyncDigest.pm index 07d5a10..fcb1bc0 100644 --- a/lib/BackupPC/Xfer/RsyncDigest.pm +++ b/lib/BackupPC/Xfer/RsyncDigest.pm @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.1.0beta2, released 9 May 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/Xfer/RsyncFileIO.pm b/lib/BackupPC/Xfer/RsyncFileIO.pm index 4d2dcb8..812cd5d 100644 --- a/lib/BackupPC/Xfer/RsyncFileIO.pm +++ b/lib/BackupPC/Xfer/RsyncFileIO.pm @@ -12,7 +12,7 @@ # #======================================================================== # -# Version 2.1.0beta2, released 9 May 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/Xfer/Smb.pm b/lib/BackupPC/Xfer/Smb.pm index 6886397..9a8919c 100644 --- a/lib/BackupPC/Xfer/Smb.pm +++ b/lib/BackupPC/Xfer/Smb.pm @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # @@ -103,24 +103,11 @@ sub start } else { # # Turn $conf->{BackupFilesOnly} and $conf->{BackupFilesExclude} - # into a hash of arrays of files + # into a hash of arrays of files, and $conf->{SmbShareName} + # to an array # - $conf->{SmbShareName} = [ $conf->{SmbShareName} ] - unless ref($conf->{SmbShareName}) eq "ARRAY"; - foreach my $param qw(BackupFilesOnly BackupFilesExclude) { - next if ( !defined($conf->{$param}) ); - if ( ref($conf->{$param}) eq "ARRAY" ) { - $conf->{$param} = { - $conf->{SmbShareName}[0] => $conf->{$param} - }; - } elsif ( ref($conf->{$param}) eq "HASH" ) { - # do nothing - } else { - $conf->{$param} = { - $conf->{SmbShareName}[0] => [ $conf->{$param} ] - }; - } - } + $bpc->backupFileConfFix($conf, "SmbShareName"); + $t->{fileIncludeHash} = {}; if ( defined($conf->{BackupFilesOnly}{$t->{shareName}}) ) { foreach my $file ( @{$conf->{BackupFilesOnly}{$t->{shareName}}} ) { diff --git a/lib/BackupPC/Xfer/Tar.pm b/lib/BackupPC/Xfer/Tar.pm index b72e5e6..6780b5a 100644 --- a/lib/BackupPC/Xfer/Tar.pm +++ b/lib/BackupPC/Xfer/Tar.pm @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # @@ -92,24 +92,11 @@ sub start } else { # # Turn $conf->{BackupFilesOnly} and $conf->{BackupFilesExclude} - # into a hash of arrays of files + # into a hash of arrays of files, and $conf->{TarShareName} + # to an array # - $conf->{TarShareName} = [ $conf->{TarShareName} ] - unless ref($conf->{TarShareName}) eq "ARRAY"; - foreach my $param qw(BackupFilesOnly BackupFilesExclude) { - next if ( !defined($conf->{$param}) ); - if ( ref($conf->{$param}) eq "ARRAY" ) { - $conf->{$param} = { - $conf->{TarShareName}[0] => $conf->{$param} - }; - } elsif ( ref($conf->{$param}) eq "HASH" ) { - # do nothing - } else { - $conf->{$param} = { - $conf->{TarShareName}[0] => [ $conf->{$param} ] - }; - } - } + $bpc->backupFileConfFix($conf, "TarShareName"); + if ( defined($conf->{BackupFilesExclude}{$t->{shareName}}) ) { foreach my $file ( @{$conf->{BackupFilesExclude}{$t->{shareName}}} ) { diff --git a/lib/BackupPC/Zip/FileMember.pm b/lib/BackupPC/Zip/FileMember.pm index debd5c3..4da1b94 100644 --- a/lib/BackupPC/Zip/FileMember.pm +++ b/lib/BackupPC/Zip/FileMember.pm @@ -33,7 +33,7 @@ # #======================================================================== # -# Version 2.1.0beta1, released 9 Apr 2004. +# Version 2.1.0beta2, released 23 May 2004. # # See http://backuppc.sourceforge.net. # diff --git a/makeDist b/makeDist index 2ed1a08..186cff5 100755 --- a/makeDist +++ b/makeDist @@ -43,7 +43,7 @@ use Getopt::Std; umask(0022); my $Version = "2.1.0beta2"; -my $ReleaseDate = "20 May 2004"; +my $ReleaseDate = "23 May 2004"; my $DistDir = "dist/BackupPC-$Version"; my @PerlSrc = qw( @@ -210,6 +210,8 @@ system("cd dist ; tar zcf BackupPC-$Version.tar.gz BackupPC-$Version"); print("Distribution written to dist/BackupPC-$Version.tar.gz\n"); unlink("pod2htmd.x~~"); unlink("pod2htmi.x~~"); +unlink("pod2htmd.tmp"); +unlink("pod2htmi.tmp"); ########################################################################### # Subroutines -- 2.20.1