Safeguard Your Data

January 26, 2005

Formulate your own backup strategy

It's not alarmist but fact to say that, it is not a question of IF your hard drive will fail, but of WHEN. Your hard drive is a mechanical device spinning thousands of times a second. At some point it will stop spinning or the platters will become unreadable. When that happens you will loose time while you get your PC repaired or replaced but you can minimize that downtime by creating, implementing and revisiting your own backup strategy. Creating a backup strategy may sound intimidating but it is really a matter of addressing the following questions:

  • What data do you really need to backup up?
  • Where will you put that backed up data?
  • How will you backup your data?
  • When and how often do you need to backup?

Your resulting strategy must be simple to use and maintain or it won't get implemented. Preferably, it should be automatic and should only need your periodic attention when something fails or when something changes. If it isn't simple to use you won't use it. The following are my suggested answers to your backup strategy needs; they will not provide infallible protection and you should adapt them to your specific situation and circumstances:

What?

What you need to be concerned with is the data that is unique to your PC and that remains unique for extended periods of time. This will probably include any documents that you create with Microsoft Office, any local copies of websites that you maintain, propriety files from applications such as Dreamweaver, RoboHelp, Frame, Distiller, etc. It will also include local copies of files you are working on but have not committed or returned to a central environment yet. It fill also include any local folders that you use in your email program.

Do You Know Where Your Data is?

Hopefully these files are not scattered willy-nilly all over your PC's hard drive. Windows 2000+ tries to contain these files within My Documents or the application data directories. If your work files are not located within an easily identifiable substructure in your PC directory structure now would be a good time to organize you working directories.
By default your Documents and Settings directory will be on your C: drive. You should be aware that the standard applications PC does not have a lot of free space on the C: drive. The C: drive should only really be used to hold the OS and standard PC image. If possible you should install all other applications to D: and this drive should also hold your data. For details on how to move your My Documents folder from C: to D: please refer to the following article: [1].
The other area worth examining is the Application Data directory for your PC user. This directory contains settings and data for a lot of the programs you install and use on your PC.

Why not just backup everything?

The temptation is just to backup your entire PC's local disk drives. This is certainly one way to ensure that you are comprehensively insured but there are several reasons why this is not a good idea. The most obvious one is the volume of data involved. The average modern Windows PC installation can easily be made up of hundreds of thousands of files. The actual number of work files you are concerned with is more likely to number in the hundreds or thousands. It's true that disk space is cheap but trying to find what you really need from a backup if you have backed up a whole drive might be difficult. Better to sort the wheat from the chaff before you backup not when you are stressed and trying to restore your data.
Also, just because you backed up the whole drive does not mean that you will be able to just restore it and carry on where you left off. For example, copying executable or dll files from a backup to a windows PC is not a good idea. If you do suffer a catastrophic hard drive failure it is much better to reinstall your OS and applications from their original media or locations and then copy your data to that clean drive. Trying to restore a drive whole can waste much more time and effort than you may think.

Where?

We know that your UNIX home or files online areas are not large enough for the kind of backup we want to accomplish here. It also makes no sense to backup your data to a different area on the same PC drive as the original files as a drive failure is likely to result in you loosing both the original data and the backup at the same time.

For those in the Doc Ops group John Poole has setup and area on the ap700e4 server that we can use to backup our PCs to. To control usage you must ask John for a backup area and access to it before continuing. Once you have access to a backup area on ap700e4 you need to create a networked drive on your PC to this area. Make sure that when you create this networked drive you set it to reconnect at login as your backup program will need to access this drive.

How?

There is no program built into Windows 2000 that facilitates comprehensive backups. You could use the native file explorer and drag and drop the files you want to backup from your PC to your networked backup drive but this is not easily reproducible and cannot be easily scheduled to run without you there.

[RoboCopy] - This is a powerful Microsoft scripting tool that allows your to create backup jobs. The problem is that it takes time to get to know and it is not as powerful or as easy to use as a program specifically designed for backups.

[SyncBack] - I recommend the freeware program SyncBack to create and maintain your backup jobs.The download and installation is easy and simple. When you do install SyncBack, if you intend to use the scheduling feature which will automate your backups going forward, you will need to ensure that the program automatically starts every time you reboot your PC. In the preferences for the program you should also check the option s Minimize to tray and Minimize on close; this will prevent you from shutting down the program accidentally.

Once you have installed the program you will need to create a backup job. SyncBack calls these jobs profiles.

  • Create a profile of the type Backup.
  • Enter a meaningful, descriptive name for your profile i.e. Backup of My Documents is better than My Backup.
  • Enter a source for the backup. Hopefully you have moved your My Documents folder from C: to D: as discussed previously so it should be a simple matter to browse to the new location of this directory which should be something like D:\Documents and Settings\<username>.
  • Enter a destination for the backup: this should be your area of the ap700e4 server that you have requested from John. Make sure that you create a subdirectory on the server for each profile you create. If you have two profiles backing up to the same directory from different sources the last one to run will delete the data from the previously run profile.
  • Make sure that the Include all sub-directories and their files option is selected.

You could now use this backup profile, however, there are several advanced features of SyncBack? that are worth exploring and will make your backup better. To see all the options available click the Expert Mode button and you should now see two rows of tab options. Below are the ones I think are worth the time explorer:

Advanced

To keep your PC as the source of truth and to have the backup directory mirror that I recommend the following settings:
    • What to do when a file is in the source and destination, but they are not the same file: Source overwrites destination always (backup)
    • What to de when a file is in the source but not the destination: Copy file to destination
    • What to do when a file is in the destination but not the source: Delete file from destination

Filter

Even though we have specifically targeted My Documents as our source there still might be files or directories we know are just clutter and that we don't want included in our backup. For example, I filter *.tmp files from my backup jobs. These files are often automatically created by programs as cache to hold documents or data and are not useful to a user.

Subdirectories

Select the delete all empty directories in the destination option to keep the backup structure as tight as possible.

Compression

Unless we're really short of space backing up to a zip file is not a good idea. For one thing it takes a lot longer. For another, you have to restore that zip file to effectively navigate the structure of your backup making partial restores painful and time consuming.

Email

This is a great option to keep you informed of any problems with your ongoing backups and is worth taking the time to setup. I suggest checking both the Email the log file after the profile has run and the Only email the log file if an error occurs. Now you need to tell SyncBack about your email account:
Hit the Test Email Settings button and the program will send a test email to your Oracle email account. Go into your email program and check that this message arrives and that your filters don't send it to the junk or trash email folders. With these settings you will only get an email if the backup job hits a problem for some reason. By looking through the log file for red text you should be able to address any issues the backup job encounters.
Save this profile ready for use.

Profiles & Groups

The program has the restriction that one profile can only have a single source and destination. For a comprehensive backup you probably want to backup more than one area. For example, the Application Data directory mentioned previously. To do this, from the SyncBack? list of profiles window highlight the job you created previously. Now use the Profiles > Copy menu and save the profile with a new name. Highlight the copied profile and modify it; all you should need to change is the source directory and the email message topic.
Rather than having to run each job individually we can create a group to run the two profiles we have saved. Use the Profiles > New menu and select Group from the resulting dialogue window. Give it a descriptive name and use the add button to move the profiles you want to run in this group. Now hit the schedule button which brings us to the question of when you should backup.

When?

So when should your backup run? In an ideal world, every time you changed a file it would be immediately backed up. In the real world this functionality is accomplished using RAID disk arrays or mirrored disks. Although this technology is not prohibitively expensive, Development Services will not provide us such exotic, non-standard hardware. A good compromise is to backup daily.

To achieve this your PC should be left on with your user logged in 24x7 or the automated backup will not run. You can lock your PC but you should get out of the habit of logging out of your PC or shutting it down before you go home. If you are going away for more than one day and won't be using your machine it is OK to shut it down; just make sure that your backup is current.

Schedule your backup to occur sometime while you are sleeping. John will monitor the impact these jobs have on the server but, until you hear otherwise, just schedule your job to run while you are away from your PC.

Revisit

Unless something goes wrong with a job, like a locked file or the source or destinations are inaccessible, you should not hear anything and yet your data should be reasonably safe. The impulse is now to get complacent but it is worth revisiting your backup strategy and implementation at least every quarter. Look at the destination directories and files and check that all the data you expect to find is there and current. If you've started work on any new projects are their files being included in the backup? Is al your data still encompassed within My Documents and Application Data? If not you might need to add a new profile to your PC backup group.

What is it good for?

Your data is now relatively safe but there are still risks to be aware of. If I mess around with some code today and break it but it was working yesterday my backup is useful. I should be able to simply copy the backed up file to my PC and get back to where I was yesterday. If I broke the code yesterday but I don't notice it until today my backup won't be of much use as the broken file has already made it into the backup archive. For this reason some people create weekly, or monthly backups as well as, and separate from, their daily backups. If you feel that this is necessary and the space is available you can go ahead and create and schedule profiles and groups to do this. In general, however, daily backups should be sufficient.

I usually recommend that people create an optical backup (DVD or CD) each quarter if their data is precious to them. As we don't have the hardware to accomplish this in the office I can't follow my own advice at work. The reason I usually suggest an occassional optical backup is that your daily backup is very recent and you won't have much in the way of historical archives. Usually this is not a problem, however, if your PC were to get infected by a malicious worm that quietly started destroying your files in the background it could be days, weeks or months before you noticed the problem. By this time your daily backup would be of no use to you as that would contain vandalized files too. Of course, backups to other hard drives are susceptible to attack from viruses that infect the host machine too. Luckily virus and worm writers have been pretty sloppy to date and few people have experienced this kind of data deterioration as a result of malicious code. That's not to say it won't happen in the future. The Oracle PC base image contains Antivirus (Norton) and firewall (Zonealarm) applications. Be vigilant about applying upgrades to these programs and their definitions. Also, keep your OS up to date; it is worth turning on automatic updates in windows - viruses often exploit known security holes for which patches have been readily available for some time. If your machine's OS is patched and current you will be better protected.

It is also worth mentioning that antivirus and firewall applications do not protect you from all intruders. Spyware is a huge problem for any PC that can access the internet. As yet a comprehensive, protection and inoculation package for spyware has not been released. Until that is available two freeware applications are available that will help protect your machine from these threats. Without going into details it is well worth installing and learning how to use the following:

This covers your work PC. Please also think about implementing something similar on your home machine(s) if they contain any data that is precious to you. A server may not be available to you but a 250GB USB external hard drive can now be bought for less than $200.

Further Reading

Posted by mhtaylor at January 26, 2005 4:59 PM