0

I'm using this command to copy a file on a daily basis.

COPY "E:\ClipData.txt" "Clipboard\ClipData.txt"

But is there anyway without making it complicated, to copy the file after the source file has been modified?

There are standalon softwares that manages to do that, but the application must be running al the time.

So the cmd solution is much better.

2
  • Do you mean if there is a change or after there has been a change? Former is easy, latter needs the sw to be on all the time
    – Karthik T
    Nov 27, 2012 at 1:19
  • After there has been a change. Whats I have are the line inside a .bat file, and using task schdule in Windows XP to repeat it every day. Nov 27, 2012 at 1:25

3 Answers 3

0

If it is enough to check if the file has been changed before you copy it, replace copy with xcopy /D. It should now only copy the file if it has changed. If you put it in a batch file and run it every so often, it will only copy the file after it has changed

reference : http://www.computerhope.com/xcopyhlp.htm

0

There's the Archive bit that the system sets to 1 when the file has been changed. But to use it you'll need to remove this bit from all files at first, and then edit your script to remove this bit after coping a file.

0

There's robocopy: http://technet.microsoft.com/pt-br/library/cc733145(v=ws.10).aspx

http://social.technet.microsoft.com/wiki/contents/articles/1073.robocopy-and-a-few-examples.aspx

To mirror the directory "C:\directory" to "\server2\directory" excluding \server2\directory\dir2" from being deleted (since it isn't present in C:\directory) use the following command:

Robocopy "C:\Folder" "\Machine2\Folder" /MIR /XD \server2\ directory\dir2"

Robocopy can be setup as a simply Scheduled Task that runs daily, hourly, weekly etc. Note that Robocopy also contains a switch that will make Robocopy monitor the source for changes and invoke synchronization each time a configurable number of changes has been made. This may work in your scenario, but be aware that Robocopy will not just copy the changes, it will scan the complete directory structure just like a normal mirroring procedure. If there are a lot of files & directories, this may hamper performance.

You must log in to answer this question.

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