Use Shadow Copy Like Features on Any Windows Machine. Macgyver-Esque and Free! ~ Ask The Admin

Thursday, May 22, 2008

Use Shadow Copy Like Features on Any Windows Machine. Macgyver-Esque and Free!

Good backups happen in the background without the user knowing about it or requiring any intervention. Most of us regularly backup, some of us have admins that do it for us and then there are the few the proud and the brave Stupid... Yes we are talking about the ones that, fly by the seat of their pants, and don't regularly backup.

These are the guys that throw me a laptop and promise me their first born to retrieve some files they inadvertently deleted and emptied from the recycle bin... Something about a presentation that they have to give in... oh say, 10 minutes. And this happens twice a week at a minimum!

But us admins don't get bitter we get scripting.

This little Macgyver trick does not use any new technology and I have been using it all the way back to Windows NT and 98 (Gasp....) Do I hear the young whipper-snappers out there saying what are those? Well this is not a discussion fight reason to preach about my old school roots it's a little tip for you to add to your toolbox, shadow copy style...

On Windows 2003 servers you have a little feature called Shadow Copy that allows your system to backup different versions of your files. It creates a snapshot of a specific time so you can easily revert back.

So what if you are not using Server 2003 or Vista Premium business Something or Other? Here is where AtA comes in with this little bit of batch scripting and scheduled task ingenuity...

Locate the data you want "Shadow Copied"
Create temp folders to backup your data to.
We will be keeping two copies of the folder Order-Control on two separate machines.
It will be backed up twice a day leaving us with 3 copies of the data from 3 different times.
Create your scheduled jobs to kick off the scripts at specific times daily.

The batch script is one line of code and to schedule the task is even easier.

xcopy e:\data\order-control\*.* e:\users\mis\backup /D /Y

The /D command overwrites the backup location if the source file is newer. Saves time and bandwidth.

The /Y command suppresses the confirmations to overwrite making the script automated.

and then we create one more for the 6pm backup

xcopy e:\users\order-control\*.* z:\oc_backup6PM /D /Y

As you can see we have a second folder on our local machine and another on a mapped drive somewhere on our network. Limiting our points of failure... Sure SCSI drives have redundancy and your backup tapes can be queried and restored... But isn't it easier to have another copy of your data ready to go instantly if need be? With drive space being as cheap as it is and all you AtA admins out there know how to secure your data why not add this layer of security to your data??

Now when booby Betty calls and says she overwrote the main inventory file with her shopping list you can copy and paste a backup copy over her shopping list and walk away a virtual hero. Sound good?

Do you have a Macgyver Tip For AtA? Hook us up and you might just get some swag. (Our swag pile has gotten pretty big an unruley. I keep hearing barking and whineing from it...There might have been a puppy in one of those boxes. Let's just hope that it was just an Aibo...)