While having a Linux computer, I wanted to have a monthly full backup, daily incremental backups and a weekly differential one.
I chose Flexbackup for taking backups. It has clean configuration file and enough options. A feasible backup method technology can be chosen from tar, cpio, afiodump, afio, GNU tar, cpio, star, pax, or zip. Flex handles all of them automatically and easily. Incrementals and differentials are also supported.
My setup
I equipped the backup server with Flexbackup, afio, buffer, finduitls and fileutils. Buffer is quite old software and does not support files that are having size of 2GB and more. Lucklily I don't have any large files among my work files.
On the server, I made RSA keys in order to allow the script to log in and do its work without the need to answer a password request.
Then after some fiddling, the config file looks like this (these are only the lines that I changed) :
-
$type = 'afio';
-
$set{'root'}= 'athena:/root';
-
$set{'conf'} = 'athena:/etc /boot&';
-
$set{'mysql'} = 'athena:/var/lib/mysql';
-
$set{'sven'} = 'athena:/home/sven';
-
$set{'httpd'} = 'athena:/home/httpd';
-
$set{'svn'} = 'athena:/home/svn';
-
$set{'projects'} = 'athena:/home/sven/NetBeansProjects';
-
$set{'stuff'} = 'athena:/stuff';
-
$prune{'athena:/stuff'} = 'stuff';
-
$buffer = 'buffer'; # one of false/buffer/mbuffer
-
$buffer_megs = '20'; # buffer memory size (in megabytes)
-
$device = '/home/backup';
-
$remoteshell = 'ssh'; # command for remote shell (rsh/ssh/ssh2)
-
$remoteuser = 'root'; # if non-null, secondary username for remote shells
The first $set-s are the dirs on my work computer, athena, that will be backed up, after I issue a command like 'flexbackup --set root --full' on the server. These are like short aliases.
Pruning must be inserted per directory-style and then there can also be subdirs in there.
Buffer will make copying faster and I raised the amunt of megabytes from 10 to 20.
Device can either be a directory or a tape backup device on the server itself.
Then finally there are some parameters for networking.
The first test run (flexbackup -set root -full) went fine, backing up a 132MB /root took some seconds. Then the /home was 26 GB and took about an hour to back up. /home/backup on the server got cleanly named files like this: athena-home.0.201007170538.afio-gz
Some handy commands:
Listing all the files inside a backup file:
-
flexbackup -list athena-home.0.201007170636.afio-gz
Extract just one file
-
flexbackup -extract athena-home.0.201007170538.afio-gz --onefile 'sven/pics/1/2010, July, 8/MVI_2913.AVI'
Restore some files from athena-home.0.201007170538.afio-gz listed in a text file named "filelisting"
-
flexbackup -extract athena-home.0.201007170636.afio-gz -flist filelisting
Appreciation for this inofrmatoin is over 9000-thank you!
flexbackup is nice :)
but i have a problem with exclude some directories from sets incremental, and not exclude the same dir from the same sets but "full backup"
Tomek, the script seems a bit outdated indeed. I have moved on to use Rackspace Cloud Server service for my server needs. I can take a snapshot of the server easily from Rackspace Control Panel and using their Cloud Files API, I can take regular backups of databases and files using a cronjob.