Copy Veeam backups to USB drive

As we are still rolling out VMware and Veeam B&R throughout our offices, we are not yet in a position to set up replication.

Until we are ready, I thought it was a good idea to at least backup the Veeam backup repository to USB3 drives, which would be rotated and taken offsite daily.

Initially I setup a ‘Veeam File Copy’ job, but later noticed it was taking ages to copy the new incremental files. It seems ‘Veeam File Copy’ jobs do not just copy the new files, but all files every time; not what I wanted.

The solution was to create a batch file that could be run once the Veeam backup job had finished:

The extra benefit here is that the batch file will run immediately after the backup job finishes. With the File Copy job, I had to set a fixed schedule.

Here’s the batch file I used, which mirrors the Veeam backup repository to the USB3 drive:

::Copy all files from sourcepath to destinationpath using Robocopy
::Last updated on 23/02/2012 by Adam Rush
::(E)mpty folders included in copy
::(R)etry each copy up to 15 times
::(W)ait 5 seconds between attempts
::(LOG) creates log file
::(NP) do not include progress txt in logfile; this keeps filesize down
::(MIR)rors a directory tree

::Source path
set sourcepath=E:\Backups

::Destination path
set destinationpath=F:\Backups

::Log path
set logpath=E:\Logs\Robocopy\

::Include format in log filename
set filename=Robocopy_%date:~-4,4%-%date:~-7,2%-%date:~-10,2%#%time::=-%.txt

::Run command
robocopy %sourcepath% %destinationpath% /E /R:15 /W:5 /LOG:”%logpath%%filename%” /NP /MIR

Robocopy will only copy new files, and delete old incremental files from the USB3 drive, once the Veeam retention policy removes them from the backup repository on the Veeam server.

This is the quickest method I can think of, and is perfect until replication is set up. In fact, we’ll probably still use this as well as replication; you can’t be too careful!