Flexbackup Mini Howto for linux. (I am using ubuntu 7.10 and KDE)  :-)                                                                                 Back to Main Page

This is a very short version, and if you want to know more, go to the Internet etc.

This howto is without any guarantee, and you may use it on your own responsibility only.

There may be errors, but I do not want to use too much time to  write this minihowto.

To check specific words or items you may try to Search in:  http://en.wikipedia.org/wiki/Main_Page/    or    http://www.google.com/



Index Of Page:

 
My setup

To make the first full backup

To make following backups

To restore all the data

To restore only a single directory


                                                                                                                                                                                                                                               
Flexbackup is a simple command line backup program for linux.

It can be installed with synaptic.

I use an external usb harddisk for my backups.

My external harddisk is /dev/sdc1 on /media/sdc1 - I always connect my external harddisk in the same way and always unmount it when finished in order to keep

the same names, which are set up in the /etc/flexbackup.conf configuration file.

I open a konsole and create a backup directory on the external harddisk:

"sudo mkdir /media/sdc1/flexbackup_hp_710" (you may use a different name, but remember to use the same name in the "/etc/flexbackup.conf" file).

It is best to keep your backups as "root"  (for safety reasons).                                                                                                                    Back to Index

Then i open the /etc/flexbackup.conf file as sudo:

"sudo kate /etc/flexbackup.conf " (I use the kate text editor).

Here comes a snippet of my "flexbackup.conf" configuration file with my setup in yellow:

snippet begin >
...
# Configure backup "sets".
# Not needed if you use "-dir <dir>" to backup one tree at a time.
# Each set is a simple space-separated list of filesystems
# Remote filesystems should denoted as 'host:dir'
# You can use anything (other than 'all') as set names
#
# Example:
#  $set{'set1'} = "/home /usr";                                                                                                                                                                               
#  $set{'set2'} = "/dir3 machine2:/dir4 machine3:/dir5";
#
# "-set all" will back up all defined sets. If you are doing a full backup
# using tapes, each "set" will go onto a different tape and you will be
# prompted for tape change in between.
#
#$set{'backup'} = "/home";
$set{'backup'} = "/boot /root /etc /home ";

# Subtree pruning
# A space-separated list of directories to prune from each backup.
# Key is a filesystem or host:dir spec as outlined above
# regular expressions allowed (not shell-type wildcards!)                                                                                                                                                Back to Index
#$prune{'/'} = "tmp proc";
$prune{'/'} = "tmp proc";

# Compression
$compress = 'false'; # one of false/gzip/bzip2/lzop/zip/compress/hardware
#$compr_level = '4'; # compression level (1-9) (for gzip/bzip2/lzop/zip)

# Buffering program - to help streaming.  The use of buffer or mbuffer
# when writing to tape is recommended to avoid excessive drive wear.
$buffer = 'false';         # one of false/buffer/mbuffer
$buffer_megs = '10';        # buffer memory size (in megabytes)
$buffer_fill_pct = '75';    # start writing when buffer this percent full
$buffer_pause_usec = '100'; # pause after write (tape devices only)

# Device to backup to.  -->> non-rewinding version, please! <<--
#
# Examples:
#    Linux SCSI: /dev/nst0     Linux IDE: /dev/nht0
#    Linux ftape: /dev/nqft0   FreeBSD SCSI: /dev/nrsa0 (4.x compat device node)                                                                                       
#                              FreeBSD SCSI: /dev/nsa0  (5.x)
#
# If a directory, will archive to files in that directory rather than a device
# If "host:/dev/tapedevice", will use remote tape drive via rsh/ssh
#
#$device = '/dev/nst0';
$device = '/media/sdc1/flexbackup_hp_710';


# Block size (in kilobytes!) to use for archive programs and dd. Default is
# 10 for most things.  Some tape drives need 32 or 64.  Set to '0' to                                                                                                                        Back to Index
# disable all blocking
$blksize = '10';
...
snippet end>

I have marked the parts of the setup which I use, with yellow:
                                                                                                                                                                                                  
$set{'backup'} = "/boot /root /etc /home ";

Means that the "/boot", "/root", "/etc" and "/home" directories will be backed up (you can make your own choice)

$compress = 'false';

Means that the backup will not be compressed, to speed up things (with modern harddisks, size is normally not a problem)

$device = '/media/sdc1/flexbackup_hp_710';

Means the backup is done to the "/media/sdc1/flexbackup_hp_710" directory (the directory on the external harddisk).

That's all you need to set-up flexbackup (remember to save the file, when finished the setup).                                                                        

To make the first full backup of everything open a konsole and run the following command:

"sudo flexbackup -set all"   (4.1 gb on my system took about 20 minutes)

To make following backups run:

"sudo flexbackup -set all -level incremental" (takes only a few minutes depending of how much data to backup)

To restore all the data, make an empty directory called restore:                                                                                                            Back to Index

"mkdir /home/user1/restore"

Change directory to that directory:

cd /home/user1/restore (which brings to the "restore" directory):

Then run:

"sudo flexbackup -extract" (which extracts everything to the "restore" directory).

From the "restore" directory you can copy any of the files/directories to anywhere you want.

To restore only a single directory e.g. the "/etc" directory, again create an empty directory and cd to that directory (same principle as above), then run:

"tar -xvf /media/sdc1/flexbackup_hp_710/etc.0.200712062353.tar" (which is the tar file you want restored - note the date and time suffixex of the file)

Only that particular directory "/etc" is restored, and you can copy files from there.

Always restore to an intermediate directory as shown above, and then copy files to their proper places (to avoid any problems, and it also give you a

chance to check the files before restoring to their proper places).

I find "flexbackup" one of the easist backup programs, as I feel it give a good overview over the backup'ed directories.                            

From time to time, you can empty the backup directory (/media/sdc1/flexbackup_hp_710) and then begin a new backup, wiht the same configuration file - to save

space.

See "man flexbackup" - "/usr/share/doc/flexbackup/faq.html" - "/usr/share/doc/README.gz" for further info.                                                    Back to Index


12/2007