Rsync and the resulting time stamps

published Feb 10, 2016 06:30   by admin ( last modified Feb 10, 2016 06:33 )

I needed a way of getting rsync to timestamp the transferred files in such a way that the time stamp on the destination side reflects when the file appeared in its current form on the destination side.

This is so that I can find the files that are new or modified with a "find -cmin n" command, that should get all files that have appeared new or modified during the last n minutes, and burn them to disc.

I tested with no flags (besides -r), with -t flag, with the -u flag and with the -c flag. Both the -u and -c flags seem to do the job. -r flag was switched on for all.

no flags (besides -r)
All files get the timestamp of the most recent transfer, whether they are new/modified or not.

-t flag
All files get the timestamp they have on the source side

-u flag
New files get the timestamp of the transfer time, old files keep the timestamp of when they were transferred. Files with an updated modification date (e.g. with touch), get an updated date

-c flag
New files get the timestamp of the transfer time, old fileskeep the timestamp of when they were transferred. Files with an updated modification date (e.g. with touch), and no other changes will not get an updated date