1

I need to copy files based on timestamp.

Example:

I have folder1 and folder2.
Files from folder1 should be copied to folder2 and then once a day all files from folder2 will be uploaded to the server.

Files get accumulated in folder1 every day hence I need to copy only new files and don't touch old ones.

My point: I want to use 'copy' command conditionally i.e. current day timestamp - 1. Then every day it will copy files from the day before only. My question: how could I specify files created with timestamp = [current day] - 1 ?

2 Answers 2

3

Have you looked at Robocopy? https://technet.microsoft.com/en-us/library/cc733145(v=ws.11).aspx

This might do the job for you.

2

If you only want to copy new files and you are using Windows 7 or higher you can use robocopy, which is designed for replicating directories and by default only copy/update new files (the /E option is for copying also subdirectories):

robocopy folder1 folder2 /E

This will copy only new files from folder1 to folder2, if there is no new files it won't copy anything.

1
  • Thanks Folks, It looks that robocopy has the option /MAXAGE:n. It might work for me. I have play with it and will report later. Thanks for suggestion
    – susik
    Commented Sep 23, 2017 at 1:57

You must log in to answer this question.

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