The modified times of a large amount of local files are incorrect. I want to update the timestamps by syncing the timestamps on the server.

It would be time-consuming if the files themselves are synced. I know --size-only could be used to prevent the real data transferring. But I'm unaware of how to sync the timestamps.

Is there a way I can sync the timestamps only?


1 Answer 1


rsync --size-only --times (or any other option that includes those, such as rsync --size-only --archive) does what you want.

Basically, --size-only is intended for when you switch from a sync method which doesn't sync timestamps. It will transfer files that differ in size, and other than that, just transfer metadata (mtime, permissions, etc.).

Note also that if you're worried about bandwidth usage, rsync's delta algorithm will transmit very little data even without --size-only, though it'll eat a lot more disk I/O and CPU time.

You must log in to answer this question.

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