I have been trouble getting BackupPC to do a proper tar incremental backup. The
problem seems to be with tar and the $incrDate format. my setup is all on
localhost, with no SSH, or other remote access.
Here is some sample log output:
----- SNIPPET OF LOG -----
Contents of file /var/lib/backuppc/pc/localhost/XferLOG.93.z, modified
2005-08-08\ 12:31:15
Running: /usr/bin/sudo /usr/local/bin/backuppc-tar -v -f - -C /bin --totals
--newer='2005-08-02 19:00:00' .
Xfer PIDs are now 11565,11564
/bin/tar: Substituting 1901-12-13 15:45:52 for unknown date format
`\'2005-08-02'
/bin/tar: 19\:00\:00': Cannot stat: No such file or directory
Total bytes written: 3164160 (3.1MiB, 2.1MiB/s)
/bin/tar: Error exit delayed from previous errors
Tar exited with error 512 () status
create 755 0/0 0 .
pool 755 0/0 625228 bash
pool 755 0/0 4 rbash
pool 755 0/0 4 sh
pool 755 0/0 13848 readlink
pool 755 0/0 11036 run-parts
pool 755 0/0 5620 tempfile
pool 755 0/0 5576 mktemp
pool 755 0/0 31404 chgrp
----- END SNIPPET OF LOG -----
As you can see, the tar command is confused by the date format. Here I've
modified the $Conf{TarIncrArgs} to put the date in single quotes. The specific
modification I made was to make the define look like this:
$Conf{TarIncrArgs} = '--newer=\'$incrDate\' $fileList';
This was because when I just used:
$Conf{TarIncrArgs} = '--newer=$incrDate $fileList';
The error log looked like something along these lines:
/bin/tar: Treating date `2005-08-02' as 2005-08-02 00:00:00 + 0 nanoseconds
/bin/tar: 19\:00\:00: Cannot stat: No such file or directory
Which led me to believe that the tar command was treating the hour portion of
the date as a file argument.
Unhappy that my incremental backups are broken, I started digging around in
Tar.pm and found the source of $incrDate. I am presently testing a modification
to timeStamp subroutine in the Lib.pm file. There, I changed the file as follows:
FROM: return sprintf("%04d-%02d-%02d %02d:%02d:%02d",
TO: return sprintf("%04d-%02d-%02d\\ %02d:%02d:%02d",
This way, my date string is not fully escaped, but the space that seemed to be
causing problems *is* escaped. This seems like a hack that shouldn't have been
necessary, but I can't figure out why my incremental backups are otherwise failing.
Can anyone provide some help?
Thanks.
Chris Horn.
PS - my localhost.pl conf file (line breaks malformatted due to email wrap):
# We're using tar to backup our files
$Conf{XferMethod} = 'tar';
# Which mount points/directories to backup
$Conf{TarShareName} =
['/bin','/boot','/etc','/home','/lib','/lost+found','/root','/sbin','/storage','/usr','/var','/work'];
# This specifies the specific tar command to use
#
# Defaults:
# $Conf{TarClientCmd} = '/usr/bin/env LC_ALL=C $tarPath -c -v -f - -C
$shareName' . ' --totals';
#
# $Conf{TarClientRestoreCmd} = '$sshPath -q -x -l root $host'
# . ' /usr/bin/env LC_ALL=C $tarPath -x -p --numeric-owner --same-owner'
# . ' -v -f - -C $shareName+';
#
$Conf{TarClientCmd} = '/usr/bin/sudo /usr/local/bin/backuppc-tar -v -f - -C
$shareName --totals';
$Conf{TarClientRestoreCmd} = '/usr/bin/sudo $tarPath -x -p --numeric-owner
--same-owner -v -f - -C $shareName';
# This is the non-shell escaped versions of the parameters
$Conf{TarIncrArgs} = '--newer=$incrDate $fileList';
--------------------
This email message is for the sole use of the intended recipient(s) and
may contain privileged information. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message.
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
BackupPC-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/