Bontmia was written by John Enok Vollestad in april 2003 to merge the functionality of glastree and rsync in one application with a more flexible selection of long term storage. It has later gone through some changes to enhance usability
The only reason for using tapes instead of backup to disks over network is if no network or extra machine is available.
There is a lot of remote backup software out there. I wrote Bontmia since I could not find one that did all that I wanted.
NB File in the backup directores should NOT be changed. It is outside the scope of Bontmia to protect against this. You can mount the backup device read-only to handle this.
NB Please note that it does not, just as any other program I know, in a sane manner support copying files that is currently changing. So for databases one should not copy the databasefiles but rather use the builtin functions to extract a backup and then backup those files with Bontmia.
NB When copying files from a remote host, please note that user id and group id is not necessary the same user so keep the backup directory unaccessable from ordinary users or maintain synchronization or user ids and passwords between the hosts. For the latter. PAM and LDAP is an exellent choice for small to mid-range sites.
NB Bontmia uses rsync and rsync in its current form uses quite a lot of RAM when used on large directory structures. It might speed things up considerably to divide the backup into several smaller ones.
The archives is placed in a directory structure like this:
2003/05/06/04:00/ 2003/05/07/04:00/ 2003/05/08/04:00/ 2003/05/08/05:00/ 2003/05/08/06:44/
which is YYYY/MM/DD/HH:MM/ when the backup was issued. Since the granularity of the backup archives is one minute there is not possible to run two different backups within the same minute.
Under these directories the archived files and directories is stored within a directory named the hostname backed up and absolute path. Like this:
2003/05/06/04:00/foo:/home/jev
/bar:/home/jev
/baz:/home/jev
2003/05/07/04:00/foo:/home/jev
/bar:/home/jev
/baz:/home/jev
The following shows an example of how to do backup once every day and keep the last 7 days, 4 weeks, 12 monthly and 2 years. The hostname is changed.
$ bontmia --dest ./backup --rotation \
0minutes0hours7days4weeks12month2years \
foo.bar.com:/home/jev \
foo.bar.com:/etc \
foo.bar.com:/usr/local \
foo.bar.com:/var
When this is run it outputs the following on my system (the hostname
is changed). Since the computer have not been on all the time not all
the backups have been run but the last x backups is saved for each
filter. Which filter that is active for each backup is shown. The
one removed is not longer filtered to be saved.
Making a hard-link replication of the last backup (/backup/2003/09/20/00:00) Backing up by modifying the replication foo.bar.com:/home/jev foo.bar.com:/etc foo.bar.com:/usr/local foo.bar.com:/var Deletes files that should not be in the latest snapshot Moving the complete backup into the backup archive (/backup/unfinished_backup -> /backup/ Calculates which backups to save Saving /backup/2003/06/29/19:07 by filters: month Saving /backup/2003/07/20/10:00 by filters: month Saving /backup/2003/08/26/22:30 by filters: weeks month Saving /backup/2003/09/07/00:00 by filters: weeks Removing /backup/2003/09/13/00:00 Saving /backup/2003/09/14/00:00 by filters: days weeks Saving /backup/2003/09/15/00:00 by filters: days Saving /backup/2003/09/16/00:00 by filters: days Saving /backup/2003/09/17/00:00 by filters: days Saving /backup/2003/09/18/00:00 by filters: days Saving /backup/2003/09/19/00:00 by filters: days Saving /backup/2003/09/20/00:00 by filters: days weeks month years
As one can see the last 7 days is saved, the last 4 weeks is saved and the last 3 month is saved. The backup have only run for the last 3 month and therefore there is no more month backups. Similar for the year backup.
NB! If you want to make copies of several directories then do not run Bontmia multiple times against the same '--dest' but instead list each source directory as arguments on one command or the incremental storage becomes impossible to maintain and one end up copying all the data all the time.
backups b b b b b b b b b b b filter A | | s |s | s| | s|Example 2
backups b b b b b b b b b b b b b b b b filter A | | | | | | | | | | | | | | | | | | | | | | | | | |s|s|s| |s| filter B | | |s | s| s| s| filter C | s | s| ------------------------------------------------------------------------ To save s s s s s s s
It is a single small shell script using cp -lR and rsync to maintain incremental backups and some additional shell-code to store old backups for a selected time in the same manner as ordinary tape rotation schemes. Files that does not change since the last backup become a hard-link to the version in the last file to save disk space. Making hard-links also increase the speed of the backup. Making a hard-link of a 2GB file is done equally fast as for a file of 1KB and thus avoiding transfer of files accross the network saves a lot of time when changes is rare.
The program itself is a single script and is available for download. To run it you have to have a Posix shell like Bash (sh on Solaris does not work, I will make Bontmia work with it when time), GNU date, GNU cp and ssh for remote access.
If you have any comment or suggestion you might send them to john.enok@vollestad.no or visit my webpage.
You might also rate this program by visiting the corresponding FreshMeat page.