1 I don't want to
compress any file
2 Where is the GUI?
3 I do not need
that lateLinks stuff
4 Making a remote Backup with
SSH (no NFS)
5 I like this blocked file stuff
and want to use it for all files bigger than 50 MB
6 How do I
make a full backup of my GNU/Linux machine?
FAQ 1 I don't want to compress any file
I don't want to compress any file in the backup. How can I configure this?
When configuring storeBackup.pl, set option exceptSuffix to '.*', which is the pattern for ``match everything''.
Why doesn't storeBackup provide a GUI (graphical user interface)?
There are several reasons why storeBackup is command line driven:
I only want to make my backup to an external usb drive and don't want to use this new option ``lateLinks''. How can I do this?
You don't have to concern yourself with this ``highly sophisticated option'' (or with storeBackupUpdateBackup.pl) if you do not use option lateLinks. Have a look at Example 1.
Under GNU/Linux, it is also possible to back up data over an SSH connection. This has the advantage that no separate network file system has to be configured (as it is the case for NFS).
In order to mount the target directory, the sshfs program has to be used. It is shipped with most distributions, but can also be obtained from http://fuse.sourceforge.net/sshfs.html.
The command to mount the remote directory /var/backup on the computer chronos as user ``backup'' to the target directory /mnt/target is:
# sshfs backup@chronos:/var/backup /mnt/target
Now storeBackup.pl only has to be configured to place the backup in /mnt/target. After the backup, the target directory can be unmounted with fusermount -u /mnt/target.
SPEEDING UP A REMOTE BACKUP OVER SSHFS
sshfs uses an individual network request for each individual hardlink that has to be set and for each single file that has to be deleted. Since the latency for any network operation is generally several magnitudes larger than for any local operation, backing up to a remote system can therefore be very slow even if the network bandwith is as high as for a local harddisk.
For this reason, it is strongly recommended to use the lateLinks and doNotDelete options for remote backups. Their usage allows to perform the hardlinking and deletion operations on the remote system only and generally speeds up backups by a factor of 10 to 75, depending on the amount of changed data and the latency of the network.
The general procedure is as follows:
# sshfs backup@chronos:/var/backup /mnt/target
# storeBackup.pl --backupDir /mnt/target --lateLinks \
--doNotDelete [other options]
# fusermount -u /mnt/target
# ssh -T -l backup ebox.rath.org \
'storeBackupUpdateBackup.pl --backupDir /var/backup'
# ssh -T -l backup chronos \
"storeBackupDel.pl --backupDir /var/backup [other options]"
To archive the desired result, simply set:
checkBlocksSuffix = .* checkBlocksMinSize = 50MThis configuration will use blocked files for all file with a size of 50 megabyte or more. If you want another size than 50 megabyte, eg. 800 kilobyte, set the value of checkBlocksMinSize to 800k.
Explanation for the experts: storeBackup.pl will generate an internal rule from the configuration above:
'$file =~ /.*$/' and '$size >= 52428800'You can also directly use the following rule:
'$size >= &::SIZE("50M")'
to get the same result.
First of all, generate a configuration file:
storeBackup.pl -g completeLinux.confOpen the configuration file with an editor of your choice and edit the following parameters:
sourceDir = /Set sourceDir to /, so the whole file system will be saved.
backupDir=/media/driveHere, I assume your attached hard disk for the backup uses path /media/drive. You have to change this if it's mounted elsewhere. Naturally, you also can save your backups eg. on an nfs mount. If you do so, you can find an explanation how to a remote file system via nfs in configuring nfs. If you make a backup via nfs, you should read using option lateLinks. Next, configure the directories you do not want to backup. We have to include backupDir in this list to avoid recursion.
exceptDirs= tmp var/tmp proc sys mediaIf there a other directories you do not want to save (eg. nfs mounted home directories), include them into this list. Now let's say you also want to exclude the contents of all other directories called tmp or temp (upper or lower case) anywhere in the file system. So add:
exceptRule= '$file =~ m#/te?mp/#i'To avoid cached files, add all directories with cache in their names (upper or lower case) to that list. Change the line above to:
exceptRule= '$file =~ m#/te?mp/#i' or '$file =~ m#cache.*/#i'But now there have the risk, that perhaps some important files are not saved because the are stored in a directory called /tmp/, /temp/ or a directory with eg. Cache in its name.
writeExcludeLog=yesIn every backup, there will be a file called .storeBackup.notSaved.bz2 listing all these files.
cpIsGnu=yesFor making a full backup, you also have to store the boot sector. The following script assumes your system boots from drive sda. You may need to change this value to match your system. Make the directory /backup and locate the following script (pre.sh) in that directory:
#! /bin/sh rm -f /backup/MBR.prior mv /backup/MBR.copy /backup/MBR.prior # copy the boot loader dd if=/dev/sda of=/backup/MBR.copy bs=512 count=1 > /dev/null 2>&1 # copy back with: # dd if=/backup/MBR.copy of=/dev/sda bs=512 count=1Set the permissions:
chmod 755 /backup/pre.shTo call the script, set precommand in the configuration file:
precommand = /backup/pre.shTo see that something is happening during the backup, set:
progressReport = 2000 printDepth = yesLook at the keep* option and set the appropriate values and set logFile to a useful value for you.
Also set the other options to values that fit to your need.
As always, the first backup will take some time because of calculating
all the md5 sums and especially because of file compression. The next
backups will be much faster.
After making your backup, you should control which files were
not in the backup because of option exceptRule.