Amanda-Users

Script for maintaining on-disk backups

2002-12-30 07:57:35
Subject: Script for maintaining on-disk backups
From: "Georg C. F. Greve" <greve AT gnu DOT org>
To: amanda-users AT amanda DOT org
Date: Mon, 30 Dec 2002 13:12:22 +0100
Hi all,

I use amanda in a "mostly on hard disk" setup. 

Two machines are backing each other (and themselves) up every night;
since chances of simultaneous hardware failure on two machines is
probably not that high, this at least reduces the risk of on-disk
backups somewhat. Some backups are also occasionally written to CD.

In such a system, it is easy to fill up quite a lot of disk space
quickly. And a lot of the data will be filled up by data that has been
obsoleted by a later backup; finding and deleting that by hand could
quickly turn into a nightmare, so I wrote a little Python script that
will maintain the backup archive for me.

The script first catalogues all files on disk, then looks for the
obsolete ones (eg: a fresh level 1 dump makes all the preceding dumps
with equal or higher levels obsolete) and deletes them. 

An additional variable can be used to determine the wanted duplicity,
which is called "keep." Example: If keep is set to 2 and the last dump
was level 3, the program will delete all dumps with levels of 4 and
higher, while keeping the last and second-last level 3 dump.

Finally, the script will create an Index file in which a user can see
the archive and quickly find out which files exist and where to go
looking for the latest backups.

Since there are probably others running on-disk backups, the script is
appended below. It works quite well for me, maybe it will be useful to
someone, maybe not.

Regards,
Georg


Attachment: maintenance.py
Description: Binary data

-- 
Georg C. F. Greve                                       <greve AT gnu DOT org>
Free Software Foundation Europe                  (http://fsfeurope.org)
Brave GNU World                            (http://brave-gnu-world.org)

Attachment: pgpJJPYCHVn2c.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>