Quick and dirty backup script [windows]

If your usual backup software takes ages to make a decent backup of your computer and you need a quick (and dirty) way to backup you project directory you could use robocopy.

The syntax is easy enough:

robocopy  SOURCE  DESTINATION  /parameters

For example, you need to backup your local development webserver:

robocopy “c:\xampp\htdocs” “e:\dev-server\” /E /COPYALL

This would copy everything newer or changed from your local htdocs directory to the ‘dev-server’ directory on drive e:

The parameters:

/E – includes subdirectories

/COPYALL – includes file information

For a detailed list type in robocopy /?

I made myself a backup.bat on c:\ and put all robocopy commands i need executed in it. So i can type ‘backup’ on the command line and every backup i need is made.

Backup your XNA game projects on a USB drive.

[YOUR USERNAME] = Windows account you use to develop (executing user must have reading rights on files, can be done as admin)

X: = Letter your USB drive gets assigned in explorer. You can change it there, but there’s usually no need for that.

robocopy “c:\Users\[YOUR USERNAME]\Documents\Visual Studio 2010\Projects” X:\MyProjects\VS2010 /E /COPYALL

robocopy “c:\Users\[YOUR USERNAME]\Documents\Visual Studio 2008\Projects” X:\MyProjects\VS2008 /E /COPYALL

Put these two lines in a filename.bat to backup XNA3.1 and XNA4.0 at the same time.

Advertisements

One response to “Quick and dirty backup script [windows]

  1. Pingback: Execute batch script on windows 7 logout or login « The gnomigames blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: