BASTRAMA - Backup Strategy Manager
bastrama.pl -n2 -k2 -l0 "backup*.gz" bastrama.pl -n2 -k2 -l0 --calc 1000
The Backup Strategy Manager is a command-line tool to manage sets of backup files that are stored on random access memory (eg. hard drives). You could also call this ``Virtual Tape Rotation''. It implements an infinite grandfather-father-son strategy by deleting a defined subset of all backup files, therefore saving storage space.
Bastrama does so by numbering (adding [BASTRAMAnnnnn] suffix to the filename) all files that match the specified fileglob according to their modification date. Then some of the files are deleted (depending on the specified backup strategy). The oldest and the latest file will always be kept.
It is a good idea to play around with the --calc option to get a feeling about how Bastrama works prior to using it for backup file management.
Bastrama takes as argument one or more fileglobs, each fileglob describing files that are to be treated as one set of backup files. (Remember to quote the globs, so that they won't be expanded by the shell.)
Bastrama by default uses a n=3, k=3, l=0 strategy. This is not very much more than a random pick and it by no means implies that this setting will suit your needs.
As said at other places, the --calc parameter is very useful to experiment with different setting of n, k and l.
Once you have chosen your settings, stick to them. Especially: DON'T CHANGE N AFTER YOU'VE BEEN USING BASTRAMA FOR SOME TIME! This defeats the whole purpose of Bastrama which is CONTROLLED deletion of a DEFINED SUBSET of all files. Be sure that you understand what you are doing, before you change k and l, either!
Bastrama takes great care in the handling of your precious backup files. Files are not deleted, just renamed per default. Only if the --delete option is specified, files are deleted. If Bastrama detects potential problems (missing recommended parameters, time inconsistency, file size suspiciously small) files are not deleted unless --delete *and* --force are specified.
The set of files that Bastrama is working on should not be in use by another program since Bastrama renames all and deletes some of them.
Running two Bastrama instances on the same set of files at the same time is asking for trouble.
It should be safe to kill the Bastrama process at any time.
Of course there is no warranty of any kind (see also section WARRANTY). On my box Bastrama is not deleting any more files than it should, though.
(Subject to change)
Copyright (C) 2002 Thiemo Nagel (email@example.com)
Your feedback is greatly appreciated!
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA