8

What are the flags to make sure rsync ignore modification time and use checksum only?

Ken
  • 81
  • 1
  • 1
  • 2

2 Answers2

10

From the rsync(1) man page:

    -c, --checksum              skip based on checksum, not mod-time & size
       ...
    -I, --ignore-times          don’t skip files that match size and time

As always, -n will help you make sure you have the options you need.

Ignacio Vazquez-Abrams
  • 45,939
  • 6
  • 79
  • 84
  • 3
    I have a hard time understanding "don't skip" in this context, but I wouldn't deny that it's not clear. – geneorama Mar 22 '16 at 16:53
  • if working from different computers, cloning from git will set the time you cloned as the mod time... which means everything will look changed to rsync by default... checksum may be a better option in those instances. – Ray Foss May 24 '17 at 10:16
3

After some time of trying, I found this one is more useful.

Sync two folders ignoring timestamp changes:

rsync --dry-run -icrvh from_path to_path

Remove --dry-run once you like what will be synched.

  • -i is for showing information of changes. See explanation here
  • -c perform checksum check
  • -r recursive
  • -v verbose
  • -h human readable numbers. eg: 1K instead of 1,024
Kostanos
  • 171
  • 6