Hi all, I've finally hit rsync limit. As someone already addressed the problem in this list the problem regards the impossibility for rsync to rename directories. The situation is as follow: every night I backup my samba dir with this command: rsync -ab --suffix=-`date +%F-%H%M` --filter="protect *-[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]" --delete --numeric-ids --stats -h /home/samba/ /mnt/usbdisk as you can see, I simply rename the files deleted with the date they've been found deleted, hence providing a protect filter for the files with a date at the end (as you might imagine the machine serves windows clients). Obviously (!) when a directory is deleted on the source dir, all the files in the destination will be renamed, but the dir will not, and rsync tries to delete it ending with a "cannot delete a non-empty dir". I'm asking here because I need even a dirty solution to this problem. I've been addressed to rsnapshot, but seems hard to replicate the same backup type I've setup, so I gave it up. Any suggestion, solutions and such will be very much appreciated. Thank you in advance, -- Matteo 'Peach' Pescarin
Not sure if this has ever been covered, but I can't seem to find anything on Google: Is it possible to perform the following for moved files (i.e. files that already exist on destination, but are moved into a different or new dir on the source): - generate filelist including deleted files (without deleting) - during transfer, for each *new* file, check against above list for deletions. - If there is a match, and size is similar, try using that file as a basis for transfer. - finally delete all... (like --delete-after) All this would be sort of related to the --fuzzy option, but for moved files instead of renamed. This would be especially useful for scripts that deal with a few large files that sometimes change place, are dumped into archive dirs etc... I'm not sure if this can already be done with some combination of options, if not I think it would be a cool feature. Cheers Julian
On Wed, 2008-09-03 at 17:59 +0200, The Peach wrote:> I've finally hit rsync limit. As someone already addressed the > problem in this list the problem regards the impossibility for rsync > to rename directories. > The situation is as follow: > every night I backup my samba dir with this command: > > rsync -ab --suffix=-`date +%F-%H%M` --filter="protect *-[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]" --delete --numeric-ids --stats -h /home/samba/ /mnt/usbdisk > > as you can see, I simply rename the files deleted with the date > they've been found deleted, hence providing a protect filter for the > files with a date at the end (as you might imagine the machine serves > windows clients). > Obviously (!) when a directory is deleted on the source dir, all the > files in the destination will be renamed, but the dir will not, and > rsync tries to delete it ending with a "cannot delete a non-empty > dir". > > I'm asking here because I need even a dirty solution to this problem.It's not clear to me what the problem is, since the "cannot delete a non-empty dir" message is pretty harmless. Do you want the directories to be renamed? If so, should the individual files inside be renamed too? A naive implementation of either behavior that works in the absence of nonperishable protect filters would be quite easy. Note that the current behavior has the advantage or disadvantage (depending on your point of view) that all versions of the file at a given path are kept together even if an ancestor directory is deleted and recreated. Matt -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part Url : http://lists.samba.org/archive/rsync/attachments/20080904/8e1042a0/attachment.bin