Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I migrated my old documents to my new computer, the process I used time stamped all my documents with the day of the transfer (4 May 2013). I have an archive of the data still available and I would like to the retrieve originals and overwrite all the matching ones on my new machine but only for files that have a date of 4 May 2013. The process would ignore anything that has a newer file date (after 4 May 2013).

If I use rsync, the following will likely work except for the data issue? how I can add the date condition to this?

rsync -r -t -v --progress -u -s ~/Shares/Felix/Machine_Data/X201/Documents ~/Documents
share|improve this question
    
You could try using the find command to filter the files with creation/modification date 2013-05-04 and then follow it by a simple cp. –  edwin Jun 24 '13 at 19:25
    
I do not think you can do this with rsycn, use find. knowledgeexplosion.info/2008/10/… –  bodhi.zazen Jun 24 '13 at 19:27
    
Can you be more explicit on the workflow... I only want to overwrite files of the same name on the target machine that have date of 4 May 2013. I want to leave in place anything that's newer of the same name. On the target machine (the one with the files with the wrong time stamp), I ran: find . -type f -newermt 2013-05-04 ! -newermt 2013-05-05 which yielded the proper result, but I'm not sure how I would use this in conjunction with CP? –  Kendor Jun 25 '13 at 21:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.