Saturday, 31 March 2012

My Projects: History: backup scripts

This is second post in the "My Projects" series, and this time it dedicated to the World Backup Day.

Again, I will describe a project which I have quite some time ago, so some details could be missed.

It was 2004 and one of the first things I have decided to improve when come to new company was backups. Well, "improve" is not a correct word here, since there was nothing to improve – I had to create it from zero. It was quite surprising that 6-years old company doesn't have any backup system.

What we had:

No backup system. No money for that.

My experience at that time didn't allow me to propose any free backup solution, in the same time I was fascinated by writing different CMD scripts – I already did most of administrative tasks in windows using command line. So, instead of trying something that is ready, I decide to write my own bunch of scripts for backups.

Solution:


After a few days of work I've got something like following:

  • Nightly script scanned all folders listed in a text file.
  • All files with "Archive" attribute set were archived to a compressed file named like I_YYYYMMDD-HHSS.rar. After that the "Archive" attribute was cleared. This allowed me to have Incremental backups.
  • Once a month a Full backup was made.
  • Full backup older that 3 month was removed with all Incremental backups related.
  • Intelligent restore script allowed me to restore any file or folder from any day from last two month.
  • I was able to run the backup script at any moment, not just at night, and that allowed me to make several different backup copies during the day if needed.
To be honest – there is nothing special in this project. I can create something like that in few hours now. But it was quite interesting experience for a young admin that allows me to understand better how CMD scripts works.

Result:

Scripts-based backup system completely fulfilled our needs at that time. The restoring procedure was used many time during several years without a single failure.

No comments:

Post a comment