[aklug] Re: Automating backup tests

From: Shane R. Spencer <shane@bogomip.com>
Date: Tue Aug 03 2010 - 11:27:36 AKDT

On 08/02/2010 09:22 AM, Joshua J. Kugler wrote:
> On Sunday 01 August 2010, Christopher Howard elucidated thus:
>> Just wondering if anybody else had thought along these lines before:
>> We all know it's not enough to simply run backups of important data:
>> we are also supposed to periodically pull the backup archives and
>> restore them to see if the backups themselves are good. But instead
>> of doing all that manually, what about writing backup testing scripts
>> also?
>>
>> The reason I was thinking about it is because I am a recent convert
>> to the practice of writing unit tests for my program code. So I was
>> thinking maybe we should have 'unit tests' for our file backups also.
>> Say, you write a bunch of scripts that pull some of the backup data
>> from your remote stores and MD5s them against the real data; then you
>> batch run these scripts once a month (or whenever) and see if you get
>> any bad output.
>
> With most backup systems, a restore will be all the test you need, and
> that is often very easy to script. A system such as Bacula will store
> the hash checksum of a file in the database (md5? sha1? I forget), and
> will compare it when it restores it.
>
> There is also a "verify" job that will do nothing except compare the
> checksums to the stored files. Again, very easy to script execution.
> In fact, in Bacula, you can schedule it as a job and just make it
> a "Verify" level job. You'll be notified automatically of any checksum
> mismatches.
>
> j
>

As for backups, if you can guarantee that the data will not change during the backup or
during the verification process then you can simply back up the data then verify it.
Otherwise you will never be able to verify the backup was a success. LVM snapshots are a
great method of handling this. Also rudimentary and temporary shutdowns of services and
an rsync off to a temporary location can offer you snapshot like service.

- Shane
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Tue Aug 3 11:28:00 2010

This archive was generated by hypermail 2.1.8 : Tue Aug 03 2010 - 11:28:00 AKDT