Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have music that I play in my car, from an FAT32 USB stick. The folder which I use to put songs on is stored on my EXT4 hard drive. I add/remove/retag songs regularly and occassionally want to rsync the changes to the USB stick. But for some unknown reason (maybe permissions?), rsync copies all the files every time rather than just changed ones. I am calling rsync like :

rsync -vrlptgD source dest

How can I make it work like I want it to (i.e. know when a file hasn't been changed and don't copy it)?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

Even though Javier Rivera's answer works, it still takes way too long for rsync to check and compare all file checksums. I found that using the following option worked far better for me:

$ rsync -rtv --modify-window=1 /source /dest

The --modify-window=1 option allows for a variance of ±1s on the timestamps, which makes the file comparison far more reliable.

This advice applies both to FAT and NTFS systems.

Source (ger): http://www.kai-hildebrandt.de/tutorials/rsync.html

P.S.: Please be aware that DST will cause full file transfers twice a year. See here for further details and possible solutions: http://rsync.samba.org/daylight-savings.html

share|improve this answer
add comment

Timestamps in FAT32 are too different from unix ones to rely on them to check for file changes, you should use also the -c switch, it will force rsync to compare all the files to detect changes instead of relying in timestamps. It will work, but it's slower.

Finally, there are a couple of options in your command that can't work with FAT32 file systems.

  • -l will preserve links, FAT32 has no concept of links
  • -p will try to preserve permission, again no permissions on FAT32
  • -t will try to preserve modification timestamps, there is only one timestamp on FAT32
  • -g will try to preserve group ownership, again not supported by FAT32
  • -D will try to preserver special files and devices, you now what comes here.

As htorque comments, the invalid options will no hurt you, they just will do nothing. But you must add -c switch.

This:

rsync -vrc source dest

should work (at least it works on my computer).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.