Thursday, February 25, 2010

RoboShot - my little backup tool

OK,

I finally made it. I created my first software project on Sourceforge.net. I was very much inspired by Rsnapshot which I use extensively under Linux. You can also use it under Windows with Cygwin but it's not that convenient.

The program is called RoboShot and it's basically a Powershell script for creating automated backup snapshots. Therefor it uses Robocopy, the advanced Microsoft copying tool and hardlinks for saving storage capacity. Under Windows hardlinks ar only supported on NTFS partitions so that at least the partition where you save your backups has to be NTFS. It's a pre-alpha release so expect nothing fancy.
It's intended to be used with automated tasks which you can run daily, weekly, monthly or whatever interval you prefer. Only new files will be copied. Files that didn't change since the last backup are stored with hardlinks which basically means you only store the file once but reference it as often as possible (as long as it is changed).

You can directly download it from here .

Currently it only runs on Windows XP and you have to install the Powershell and Robocopy (at least version 026 - follow the link above) manually (in Windows 7 they are both built-in). The next release will also run under Vista and Windows 7.


The picture shows how to call RoboShot from the Powershell command line. Here the interval is daily. For automation you would put this call into an automated task to run it on a per day basis obviously.

Future plans are to create a GUI for creating the backup jobs and setting up the automated tasks. We'll see.


Cheers

4 comments:

dimm0k the drunken dragon said...

iFeLSeiFeND, I recently stumbled upon your tool and have been having difficulties getting it to run properly after making the first backup. I'm not sure if this tool is still supported or not, but the problem I'm facing is step 3 when RoboShot uses MKLINK to hardlink unchanged files.

Start-Process : Process with an Id of 20896 is not running.
At S:\PROGRAMS\TOOLS\RoboShot\roboshot.ps1:1004 char:18
+ Start-Process <<<< -FilePath "cmd.exe" -ArgumentList "/c mkl
ink /H `"$tolink`" `"$fromlink`" >> `"$logfilehardlinks`"" -Wait -NoNewWindow
+ CategoryInfo : NotSpecified: (:) [Start-Process], ArgumentExcep
tion
+ FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Co
mmands.StartProcessCommand

hopefully you still are maintaining this as this is the closest thing to rsnapshot for Windows... if not, I'd appreciate a reply so that I can begin looking elsewhere for a different solution.

iFeLSeiFeND said...

Hi dimm0k,

I just tried RoboShot on my local machine and it runs fine. Can you give me some more details on your setup? It looks from the errormessage as if on your system the cmd.exe call is not started. Can you use mklink in a standard command prompt? Sorry that I cannot help at the moment. But maybe with more information we can narrow down the possible problems.

dimm0k the drunken dragon said...

iFeLSeiFeND, so what I'm trying to do is create daily snapshots of a Windows fileserver that I've mapped as a drive on my computer, which is the computer that is running RoboShot. This computer is running Windows 7 and the destination is to a USB drive. The contents of the fileserver are littered with permissions, as they contain data for specific users on the network. Because of this, I had to make some slight modifications to your script such as:

1. adding -Force to "Remove-Item $oldestdir -Recurse"

2. adding /ZB to "robocopy.exe $Source $intervaldest /XD $exclpaths /XF $exclfiles /XJ /NDL /NFL /E /R:2 /W:1 >> $logfilemain"

3. adding /DCOPY:T /ZB to "robocopy.exe $Source $intervaldest /XD $exclpaths /XJ /NDL /NFL
/E /R:2 /W:1 /XF "*" >> $logfilemain"

4. adding /ZB to "robocopy.exe $Source $linkdest /XD $exclpaths /XF $exclfiles /XJ
/NDL /E /NOCOPY /NS /V /FFT /R:2 /W:1 /ZB >> $logfiletmpfiles"

5. adding /ZB /COPYALL to "robocopy.exe $Source $intervaldest /XD $exclpaths /XF $exclfiles
/XJ /NP /NDL /E /R:2 /W:1 >> $logfilemain"


mklink runs fine at a command prompt

iFeLSeiFeND said...

Hi dimm0k,

mhmm, I'm confused. The /ZB option shouldn't change anything specific to the copy-jobs.
Did you try to use it completely local (backup a local folder to another local folder), just to see if the script generally works?
I never used it in a scenario similar to yours and at the moment I'm afraid I'm not of any big help to you.
Let me know if you have any success. An alternative to you may be HardlinBackup:

http://www.lupinho.net/hardlinkbackup/

It's quite more advanced and configurable than my little script.

cheers