LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   how to use rsync to update date/time only (http://www.linuxquestions.org/questions/linux-software-2/how-to-use-rsync-to-update-date-time-only-445015/)

coontie 05-15-2006 10:40 AM

how to use rsync to update date/time only
 
Hi, everybody. I've 2 machines and I rsync data from a->b. I accidentally reset the modification times (recursively) on the entire /home/user directory on A. Now, whenever I try to rsync a->b it wants to rsync everything, since every file on A has now become older than the exact same file on B. Switching to checksum-based rsyncing is not an option because it literally takes over 8 days to process the files.

I'm thinking there's got to be a way to use rsync to go b->a, setting all the modification datetime on A to match those on B.

Any way to do that?

Thanks in advance..

macemoneta 05-15-2006 11:08 AM

Since rsync uses the timestamp and filesize to determine what has to be transferred, transferring only the timestamp would be a nonsensical operation for rsync.

You'll need to create a script to reset the timestamps on the files, using an ls/find output from the source system as a data source. You can reset a file's modification timestamp with the touch command.

coontie 05-15-2006 11:13 AM

Quote:

Originally Posted by macemoneta
Since rsync uses the timestamp and filesize to determine what has to be transferred, transferring only the timestamp would be a nonsensical operation for rsync.

You'll need to create a script to reset the timestamps on the files, using an ls/find output from the source system as a data source. You can reset a file's modification timestamp with the touch command.


yea, that's what I figured.

thx.


All times are GMT -5. The time now is 08:31 PM.