File Copy CMD
Posted on 2013-01-28
We have a Win 2k8 R2 Domain controller which we are backing up with Windows Server Backup.
The backups run daily to a local drive on the server and what we are looking to do is create a scheduled batch script to copy the backups to a USB flash drive which is offsited on a daily basis.
The backups are saved in the following location
I want them to be copied to the follwing location
However I cannot simply run a copy as it will fill the flash drive with backups as it copies the folder structure and not overwrite.
So I am looking for a script which will allow me to take the VHD files from A:\Windowsimagebackup\Servername\ and save them without a folder structure onto G:\backups and consequently overwrite these files each week.
I have tried the following cmds but they seem to copy only one VHD and then freeze:
for /R A:\Windowsimagebackup\servername %f in (*.VHD) do copy "%f" G:\Backup\
ROBOCOPY A:\Windowsimagebackup\servername G:\Backup\ *.VHD /E
I appreciate any help and am willing to provide more information if possible.