Discussion Locked

Copying Files

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I'm looking for a utility that will allow me to run a batch file to copy files based on dates. ie; copy any files greater than today's date, minus one. I want to use this to copy the log file created by ArcServe on an NT box for confirmation of successful backups. Any help or ideas are appreciated!

7 replies

by rsack

Not sure what you mean. Does the batch file copy the files already, and you want a utility to run batch files, or is it that the utility needs to copy the log files, and you want to run this,( if so copy from where to where)but then what is the batch file for?

by jars

Sorry, the batch file doesn't exist yet, as I need a command or utility to copy the files based on the date variable. Once the desired files are selected (using the utility or command), I will send them to a remote PC or directory. Hope this helps you in helping me!

by dnme

'copy file/s that have been changed/updated

xcopy /d c:\PATH\abcd.txt c:\Path

place the above line into a batch file to copy files that have changed since batch file was last run.

/d - files by date (if date omitted, then file that has been changed since last run.

PATH - replace with file source path

abce.txt - replace with file name to be copied

Path - replace with file destination path.

create two test files (ie ab.txt cd.txt) and run the batch file. run the batch program again - it appears nothing new has been done.
change one of the test files and run the batch file again - the file will be updated.

Hope this helps and good luck

by jars

Thanks mfahy2k. I've used XCOPY and am familiar with the date feature it has. My challenge is that the file that I'm trying to copy is newly created each day; it's not the same file. I need something that will select the newest file within a sourcedirectory and copy it to a target directory. The files names are like J0000034.log one day and J0000035.log the next. This increases incrementaly each day.

by tekcetera

There is a utility in the NT resource kit called Robocopy.
With this you can replicate only data that has changed, not the
complete copy. You can also use the at command to schedule when
robocopy will run. More info is at Microsoft web site, knowledge base
article Q160513.

by jars

Thanks DaMama! While this didn't exactly answer my question, it lead me in the right direction. Robocopy lead me to XXCopy (I read a comparison of two utilities). XXCopy has a switch that will copy only files that "were changed today only". The switch is:" /Do:.". I tested this several ways and it seems to do the trick! This Freeware has 15 different date sensitive switches available. I will definitely use this utility.

This discussion is closed to new replies.