1

I have 2 external drives and I want to use rsync to copy the files that have been updated (modified timestamp) in the source directory to a target directory.

The files have the same filename but the timestamp is different i.e. some files have been recently updated but the filename has remained the same.

However,

rsync -rv --ignore-existing --progress /Volumes/vol1/Data/ /Volumes/vol2/Data/

does not do anything. The result is null nothing is transferred.

sending incremental file list

sent 68 bytes received 12 bytes 160.00 bytes/sec total size is 20,634 speedup is 257.93

How can I solve this?

4
  • Can you explain what you think --ignore-existing does? Also, if you rely on the timestamps, you may want to actually update the timestamps too. This is done by changing -r to -a (which includes -r).
    – Kusalananda
    Feb 14, 2022 at 15:55
  • @they I expect --ignore-existing to ignore same filenames with same timestamps. If the timestamp has changed then it should copy (update) the file.
    – seralouk
    Feb 14, 2022 at 15:57
  • The default behavior is ignoring files with identical timestamps and names (and size).
    – Kusalananda
    Feb 14, 2022 at 16:24
  • the size and timestamp have changed. only the name remains the same and the command fails to update the modified files.
    – seralouk
    Feb 14, 2022 at 16:34

1 Answer 1

3

Well, Reading The Fine Manual I find this:

        --ignore-existing       skip updating files that exist on receiver

So by definition, the options you're using are explicitly asking NOT to update already existing files.

I think you simply want to use "-a" (archive) option:

rsync -av --progress /Volumes/vol1/Data/ /Volumes/vol2/Data/
3
  • will this skip identical files with identical timestamps or will copy everything?
    – seralouk
    Feb 14, 2022 at 16:33
  • @seralouk yes it will skip files with the same exact size and timestamp.
    – wazoox
    Feb 14, 2022 at 16:37
  • thanks -- accepted.
    – seralouk
    Feb 14, 2022 at 16:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .