Link to home
Start Free TrialLog in
Avatar of pcarlow
pcarlow

asked on

Need a backup batch file

I have USB flash drive.

I get to work in the morning and copy all the data from the USB to the Work PC.  At the end of the day, I copy the entire folder from the Work PC back to the USB.

I take the USB home and make updates, change files, write to the USB directly.  Bring it back tomorrow and repeat the whole process.

Problem is my USB is getting full and it takes along time to copy back and forth all the files between the USB and Work PC.  I only want to copy the files that have changed each time.

Assuming on the Work PC the files are at C:\Folder and the USB is F: please provide a script and/or batch file that will solve my problem without causing data loss.
Avatar of robrandon
robrandon

I think you can use the XCOPY command to accomplish this.  Just put the text below into a batch file like USBCopy.bat to copy from your C:\Folder tot eh USB drive.  It will copy only newer files than what is on the destination.



XCOPY C:\FOLDER\*.* F:\ /D /E /Q /Y



Avatar of pcarlow

ASKER

I'll actually need 2 scripts, one to copy the changes from the night before off the USB and then another to copy the changes from that day back to the USB.  And I need it to work for sure, because this is very important data to me.

The other direction would be:

XCOPY F:\ C:\FOLDER\*.* /D /E /Q /Y



Test it first.  Put a current copy of all your files in a temporary folder and test it in both directions.  If something screws up you still have your backup in a temproary folder.

ASKER CERTIFIED SOLUTION
Avatar of craylord
craylord

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial