Backup Guide

Where data redundancy provides a way to keep going when something fails it is not a replacement for good old backup. Companies backup policies usually include an onsite backup for failure and offsite backup for disaster, this may be overkill for most but it's still worth making backups of the most important files on a medium that can be removed from the computer. This can be DVD-R for archive or even a USB hard drive can be useful as they have capacities similar to desktop drives therefore gives the chance of making fuller backups of systems, and when the backup operation is completed, unplugged from the computer and stored away. The frequency of backups is up to you and can be based on how much important data is added to the server, daily weekly or monthly.

Having a removed copy of data helps prevent against scenarios like power surges that have the ability to destroy all data on drives attached at the time and viruses that could either wipe or encrypt data from the user for a ransom. Along with physical copies to hand, backup these days can also be done in the cloud, most providers give a certain amount for free so it's worth using these for the most important of backup material. It's worth noting however that these cloud services often have a program that allows automatic syncing with specified folders on the computer, allowing the auto sync could cause issues as if a virus or corruption ruins a file locally, that corruption is automatically applied to the cloud, rendering the backup useless, therefore it's important to turn off this feature if cloud Is employed.

There is a lot of backup software available out there to download in addition to the applications included with the operating system. In its simplest form these all just copy selected files to a different location, the guide below shows how to create a small program that does this on command.

Setup Guide

In this example a backup will be made of the entire C:\inetpub folder (that usually holds websites) to a USB hard drive.

First plug in the USB drive and find out what drive letter it has been assigned, in this example it is the E:\ drive.

USB Drive Letter

Choose the folder to be backed up, in this example its C:\inetpub .

Open Notepad and type the following:

Echo On
xcopy C:\inetpub E:\inetpub /E /C /Y

To understand this script, it can be broken down into the following segments:

Echo on: Makes the script display all its actions in DOS window
xcopy: The program that copies files
C:\inetpub: Source of files to be copied, change this to the folder to back up
E:\inetpub: Destination of copied files, change the drive letter to the USB drive
/E /C /Y: Switches to tailor the program to your needs, E selects all subdirectories in the source, C continues the program if an error occurs, and Y stops the program asking to confirm overwrites therefore making the process automated.

In Notepad, save the file, name the file backup.bat, and change the Save as type to All files.

Save As .bat File

Test this by running the bat file, double click on it and watch it run.

xcopy Command Running

When it completes the DOS window will disappear, check the USB drive to ensure all files copied correctly.

Check Files Have Copied

This program can be run anytime to make a backup, or if the server is always on it can be scheduled to run at a chosen time, just remember to plug the USB drive in before it runs!

Open Control Panel and choose Scheduled Tasks.

Double click Add Scheduled Task.

Follow the wizard, when it asks to choose a program to run, click browse and choose the backup.bat created earlier

Choose Bat File

Set up the days and time to run, and enter the user credentials of an administrator account, otherwise the program will not run.

Finish the wizard and it will appear in the Scheduled Tasks window, it can be tested by right clicking the task and choosing run.

The benefit of creating these scripts are you can create many of them and are very versatile, different folders can be chosen to backup to different locations, and with scheduled tasks they can run at any time at any frequency.