Simon Brown
2009-Mar-02 15:53 UTC
rsync ignores --force and will not delete non-empty directories from destination (HFS+ -> FAT32)
Hi. This is my first post to this list. I have searched the archives but cannot find anything that touches on this particular issue. My scenario: I am trying to rsync from an external HFS+ (USB2) to a FAT32 external NAS drive, using rsync version 2.6.9 protocol version 29 (as supplied with Mac OS X Tiger 10.4.11). The data being synced is MP3 music files and JPGs. The command I am issuing within my script is: rsync -ruxi "$sourcedir" "$destdir" \ --size-only --force --log-file="$synclog" --stats --delete --modify-window=2 --out-format="%i %n%L (%b)" $* >>"$logfn" 2>&1 The issue is that the sync works almost as expected, but fails to delete non-empty directories at the destination that no longer exist at the source. Running rsync with -n (dry-run) shows that extraneous directories will be deleted, but when I omit -n, only the empty directories are listed for deletion (and deleted). When I run the same command using a destination on one of my HFS+ drives it works as expected, but when the destination is FAT32 it will only delete empty directories. Readers may notice that I am not preserving Mac resource forks (-E). This is by design as the files I am syncing to not have resource fork metadata that I want to preserve (the ._* files actually cause problems for Windows software in this scenario, making it list duplicate versions of each file). I am unsure whether I should be using -u, --size-only and --modify-window together, though I do not see a connection between those options and the failure to delete. After some Googling I have tried using trailing '/." on the source directory path, that some people said improved rsync deletion behaviour, but it has not worked in this scenario. Is this problem solved in newer versions of rsync, and can I safely use any of these on my pre-Intel Mac. Thanks for reading. I've been stuck on this for a few days now so I hope someone here can help.
Matt McCutchen
2009-Mar-09 05:08 UTC
rsync ignores --force and will not delete non-empty directories from destination (HFS+ -> FAT32)
On Mon, 2009-03-02 at 15:46 +0000, Simon Brown wrote:> My scenario: I am trying to rsync from an external HFS+ (USB2) to a > FAT32 external NAS drive, using rsync version 2.6.9 protocol version 29 > (as supplied with Mac OS X Tiger 10.4.11). The data being synced is MP3 > music files and JPGs. > > The command I am issuing within my script is: > rsync -ruxi "$sourcedir" "$destdir" \ > --size-only --force --log-file="$synclog" --stats --delete > --modify-window=2 --out-format="%i %n%L (%b)" $* >>"$logfn" 2>&1 > > The issue is that the sync works almost as expected, but fails to delete > non-empty directories at the destination that no longer exist at the > source. Running rsync with -n (dry-run) shows that extraneous > directories will be deleted, but when I omit -n, only the empty > directories are listed for deletion (and deleted).I can't help with the Apple-modified rsync. In addition, that area of rsync's behavior underwent some improvements in version 3.0.0: https://bugzilla.samba.org/show_bug.cgi?id=3825 Please try the latest stable rsync, 3.0.5, which you can compile yourself or get from Fink or MacPorts among other places.> I am unsure whether I should be using -u, --size-only and > --modify-window together, though I do not see a connection between those > options and the failure to delete.That combination of options does seem odd (though unrelated to the deletion). What are you trying to accomplish? -- Matt
Seemingly Similar Threads
- [Bug 11805] New: Rsync -av source > destination does not wiite FAT of FAT32 USB stick correctly
- Fwd: rsync on OSX for transferring files using FAT32
- rsync on OSX for transferring files using FAT32
- OS X 10.6 (Snow Leopard) HFS+ File Compression
- OSX and HFS+ filesystem compression