Remote Backup Fail and How to Silently Copy Files
Recently I’ve run into frustrations with Iron Mountain Connected Backup so I’ve been looking for alternatives.
Alternatives: I’ve been running Jungle Disk at home and really like it. I could use that at work except I have not set up an Amazon or RackSpace account with my work credit card. But I am in Chicago and my database server/ file server is in Dallas TX. So I decided to just create a mirror on my laptop onto a shared drive on my server. There’s lots of ways to do this, but the path I chose was to use RoboCopy, a command line copy tool from Microsoft that is part of the Windows Server 2003 Resource Kit. I’m running XP and I wanted the mirroring of my machine to be invisible, silent, and scheduled. To do this I found I needed to take the following steps:
- Install RoboCopy
- Create a batch file to mirror the directory I wanted
- Create a windows script to call the batch silently
- Schedule the windows script to run automagically
Install RoboCopy: Download the Windows Server 2003 Resource Kit and install it. Very easy.
Create a batch file to run RoboCopy: I named mine c:/backup.bat and it looks something like this:
Set Source=”C:\Documents and Settings\jdlong”Set Dest=”\\myDallasServer\backup\jdlong”Robocopy %Source% %Dest% /MIR /Z /R:0 >nul
This simply sets the source and destination and then runs RoboCopy with the /MIR (mirror) and /Z (restartable) switches invoked
Create a windows script: The problem with the batch file is that it is noisy when it runs. Even piping the output to nul it still produces a CMD window that stays up until it finishes running. That’s where the Windows Script file comes into play. It calls the batch file but hides the CMD window. I created a file called c:\runBackup.vbs that has this in it:
Set WshShell = CreateObject(“WScript.Shell”)
WshShell.Run chr(34) & “C:\backup.bat” & Chr(34), 0
Set WshShell = Nothing