Pages

Wednesday, 20 May 2009

Copying backup files to remote server

A very useful tool for any dba to copy database backup files is ROBOCOPY which can be freely downloaded. the tool allow you to copy a list of files from a source server to the destination and it can mirror the files in both location so that if you delete a file in the source, it will automatically be deleted in the destination server. Also, in case of network issues during the copy, it is capable of restarting from where it stopped rather than copying from scratch.

This is very useful as you dont have to worry about deleting old backup files from the second server as long as your backup job on the primary takes care of deleting old backup files, they will automatically be deleted by ROBOCOPY from the secondary server.

as an example, the following command will copy the contents of the c:\backups to another server called \\backupserver and the /MIR switch will make sure that the contents of both folders remain in sync.

The /z switch will restart the copy process in case of a network issue.

you can easily create a windows scheduled task to run overnight and execute the following line to copy your backup files to another server offline.


robocopy C:\foo \\backupserver\bar /MIR /Z

For more details http://en.wikipedia.org/wiki/Robocopy

No comments: