--compare-dest weirdness

Kevin Murray k.d.murray.91 at gmail.com
Thu Jul 15 22:10:17 MDT 2010

Hi All,

I am writing a backup program for my computer. brief outline is as follows.

Running ubuntu 10.04
2 main partitions, / and /home, both ext3. 1 external usb hdd, ext3,
mounted to /backups/main.
once every couple of days, rsync backs up, using following command,
everything worth backing up in / and /home partitions to a folder
/backups/main/Full. command: "rsync -vrhRupElog --delete-during
--delete-excluded --exclude-from=/backups/.config/full.exclude
--log-file=/backups/.logs/full.rlog / /backups/main/Full/". this works

now what i want to do, is every few hours, rsync ONLY the files
changed in the last few days to a folder in
/backups/main/Incremental/YYYYMMddTHHmm, where the yyyy... is a string
representing the date and time. (and then tar.gz the previous
directory to save space) the command i am using for this is : "rsync
-vrhRupElog --delete-during --delete-excluded
--compare-dest=/backups/main/Full/ /
/backups/main/Incremental/Full/20100716T1355" the incremental.exclude
differs from the full.exclude only in that i also exclude .mp3, .avi
and other large and non-critical file types.

the problem is that rsync is behaving as though it is ignoring the
compare-dest option. it throws no error about this dir not existing,
and i have tried giving it as a relative dir to the destination with
same result.

interestingly, i tried to see if something was wrong with my statments by doing:
mkdir ~/rsynctest/dir1
mkdir ~/rsynctest/dir2
mkdir ~/rsynctest/dir3

nano ~/rsynctest/dir1/file1 (wrote the line hello world and saved)
nano ~/rsynctest/dir1/file2 (wrote the line hello and saved)

cp ~/rsynctest/dir1/file* ~/rsynctest/dir2/

checked md5sums of both files in both dirs to ensure they were identical

the did rsync -rvu --compare-dest=/home/kevin/rsynctest/dir2/
/home/kevin/rsynctest/dir1/ /home/kevin/rsynctest/dir3/

the two files from dir1 were copied to dir3, even though identical
copies, with the same names, existed in dir2.

i also tried this again with the compare dir relative to the dest dir,
i.e.: rsync -rvu --compare-dest=../dir2/ /home/kevin/rsynctest/dir1/
/home/kevin/rsynctest/dir3/ again with same result

is this a bug, or have i got the wrong end of the stick regarding --compare-dir?

thanks all.

Kevin Murray
-------------- next part --------------
A non-text attachment was scrubbed...
Name: full.exclude
Type: application/octet-stream
Size: 2465 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/rsync/attachments/20100716/aae7b0ca/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: incremental.exclude
Type: application/octet-stream
Size: 4063 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/rsync/attachments/20100716/aae7b0ca/attachment-0001.obj>

More information about the rsync mailing list