Sabahattin Gucukoglu
2007-Mar-02 06:37 UTC
--delete --force Won't Remove Directories With Dotnames
--delete --force Won't Remove Directories With Dotnames rsync 2.6.9 Me, personally, I reckon this to be an irritant ... but perhaps (and having thought about this a bit I decided it's a good chance) this is an intentional and useful behaviour. But it's a nuisance if you call your --partial-dir .partial, as I happen to do, since now if you remove a directory which was aborted in a recent transfer on source (leaving a .partial mirror at dest) the .partial directory won't go away on next rsync, ever. You'd have to look for it, even when the rsync command is identical and the tree copied has the same name as before. Rsync just sees right through .dirs, as if they weren't part of the source and therefore don't need deleting at dest (even if they clearly are under a directory which is). Example: rsync --partial-dir=.partial /foo /bar. Abort the transfer, and /foo/biguns/bigfile gets left in /bar/foo/biguns/.partial/bigfile. Now remove /foo/biguns and do the transfer again, to completion. The /bar/foo/biguns/.partial/bigfile is still there. What do we think? Cheers, Sabahattin -- Sabahattin Gucukoglu <mail<at>sabahattin<dash>gucukoglu<dot>com> Address harvesters, snag this: feedme@yamta.org Phone: +44 20 88008915 Mobile: +44 7986 053399
Matt McCutchen
2007-Mar-02 15:37 UTC
--delete --force Won't Remove Directories With Dotnames
On 3/2/07, Sabahattin Gucukoglu <mail@sabahattin-gucukoglu.com> wrote:> --delete --force Won't Remove Directories With Dotnames > > if you remove a > directory which was aborted in a recent transfer on source (leaving a > .partial mirror at dest) the .partial directory won't go away on next > rsync, ever. > > Example: rsync --partial-dir=.partial /foo /bar. Abort the transfer, and > /foo/biguns/bigfile gets left in /bar/foo/biguns/.partial/bigfile. Now > remove /foo/biguns and do the transfer again, to completion. The > /bar/foo/biguns/.partial/bigfile is still there.Rsync is leaving .partial around because it's a partial dir, not because its name begins with a dot. As the explanation of --partial-dir in the man page says, to get rsync to delete old partial dirs, supply your own rule --filter='R .partial/' and use --delete-after to avoid deleting partial dirs until after rsync has gotten what it needs from them. Maybe rsync should automatically delete a directory's partial dir when it finishes processing files immediately in that directory. Matt
Possibly Parallel Threads
- Rsync 2.6.9 Develops Conflict Between --stats, I think --delete-after and Local Filesystem Replication
- A Couple Of Issues (APOP Causes Auth SIGSEGV, Umask Setting Ineffective)
- Pegasus Mail 4.41 OK With Dovecot
- Removing Duplicates
- question about dovecot imap outlook clients