I am using rsnapshot <http://www.rsnapshot.org/> to make snapshots of my filesystem. rsnapshot uses rsync to do all the heavy lifting. I was recently browsing my snapshots and discovered that none of the excluded files or files deleted in the source are getting deleted from the snapshot. rsnapshot calls rsync like this: /usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \ --exclude-from=/home/omen/.backup/rsnapshot \ /home/ \ /var/cache/rsnapshot/snapshots/daily.0/balrog/ When I run the same command but add '--dry-run -v -v' I get a single line about deleting files: deleting in home/. Then it moves on to showing the uptodate files. If I remove the trailing slash from '/home/' in the command, then I get the line: deleting in home deleting [snip] Followed by 30,000 lines of the other files that will get deleted. I tried applying the patch in http://www.mail-archive.com/rsync@lists.samba.org/msg13492.html but rsync then totally skips even the 'deleting in home/.' line. The log goes like this: ... [sender] excluding file [snip]~ because of pattern .*~ done delta-transmission disabled for local transfer or --whole-file [snip] is uptodate ... It seems to me that the presence of a trailing slash should not cause the files to not get deleted. Thanks, Omen -- I have not yet begun to byte!
On Thu, May 26, 2005 at 08:06:36PM -0700, Omen Wild wrote:> /usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \ > --exclude-from=/home/omen/.backup/rsnapshot \ > /home/ \ > /var/cache/rsnapshot/snapshots/daily.0/balrog/This was fixed in the latest pre-release, via this patch: http://lists.samba.org/archive/rsync/2005-April/012338.html> I tried applying the patch in > http://www.mail-archive.com/rsync@lists.samba.org/msg13492.html > but rsync then totally skips even the 'deleting in home/.' line.The code now needs to preserve FLAG_TOP_DIR when removing duplicates from the file list. The attached patch does this. The latest nightly tar file (linked on the rsync web page) has all these fixes applied (and an improved testsuite to catch problems like this in the future). Thanks for the report! ..wayne.. -------------- next part -------------- --- flist.c 25 May 2005 01:24:01 -0000 1.295 +++ flist.c 27 May 2005 18:14:01 -0000 @@ -1524,8 +1524,8 @@ static void clean_flist(struct file_list } /* Make sure that if we unduplicate '.', that we don't * lose track of a user-specified top directory. */ - if (flist->files[drop]->flags & FLAG_TOP_DIR) - flist->files[keep]->flags |= FLAG_TOP_DIR; + flist->files[keep]->flags |= flist->files[drop]->flags + & (FLAG_TOP_DIR|FLAG_DEL_HERE); clear_file(drop, flist);
Quoting Wayne Davison <wayned@samba.org> on Fri, May 27 11:16:> > The latest nightly tar file (linked on the rsync web page) has all these > fixes applied (and an improved testsuite to catch problems like this in > the future).Just to let you know, I downloaded the latest nightly and it is working perfectly. But you already knew this. :)> Thanks for the report!Thanks for the quick response! Omen -- Never let your schooling interfere with your education.