Department of Physics and Astronomy - Computer Facilities

Backing up Personal PCs to the Public Backup Server for Linux

On Linux OS you will first need to Samba mount your home directory on the disk to some mount point of your choice. I will refer to it from now on as /external. Please make that directory if you do not have it on your system (ex. mkdir /external). You can do so by using mount command as root:

mount -t smbfs -o username=yourusername,password=yourpassword, //home/yourname /external

where the yourname is your username, similarly for the password.

You can make this permanent on machines permanently connected in the Department by adding following line to the end of your /etc/fstab:

//home/yourusername /external smbfs username=yourusername,password=yourpassword, 0 0

Free program that we will support is called Backup and can be downloaded either from our own location: Backup 4.31 or from its website Backup 4.31 website, where you can find additional support as well. These two links will provide you with the default package as provided by the author Tony Sanderson. We have prepared package in which the configuration file is already prepared with the typical complete backup of the Linux system in mind, assuming that you will backup to NFS mounted carpathia disk at /external using commands suggested below. Such backup will allow you to completely restore your Linux system after total loss by performing basic Linux installation and than recovering from the backup (this would include OS updates, extra packages installed and definitely your own data). This package is located at Customized Backup

For the original distribution package, please refer to installation instruction at their website (which is not much different than for our customized package). Installation process for our customized package:

Create directory somewhere for unpacking the archive and download Customized Backup there. Extract the files from the archive:

mkdir /home/backup
cd /home/backup
tar xvf backup_rutgers.tar

Now move the backup script and the fsplit program to a directory in your PATH, such as /usr/local/bin. Copy the rules/exclusions file bex to the working directory, where resulting backup files will be stored. In our case it is /external, where carpathia disk space is mounted (if you make different choice for mounting point, adjust bex file content accordingly!).

cp backup /usr/local/bin
cp fsplit /usr/local/bin
cp bex /
cp bex /external

To backup or retrieve one or more files, the basic procedure is to have carpathia disk mounted on /external and than follow these suggestions or customize them to your needs.

Suggested use to backup the whole system is as follows:

cd /
backup -D/external -s4.7

To backup less than the whole system either cd to the top of the directory tree you want to backup (ex. cd /home to do backup of everything in the /home) or edit the exclusions file /external/bex (or do both). Command backup -D/external -s4.7 is still to be used in such case.

And to restore the whole system by doing:

cd /
backup -r -f

and just follow the instructions (if you backed up less than whole system, ex. just /home, cd to that location before extraction process). Be aware of two facts: Files are archived with path (directory) information rather than just as simple file names and these paths will always be re-created as the files are pulled out; Files are archived with path (directory) information rather than just as simple file names and these paths will always be re-created as the files are pulled out. This provides you with the flexibility to either immediately replace existing (damaged?) files or get backed up versions to place somewhere else...

Option -f will force overwritting existing files. Without it existing files will be left as they are.

To restore just some files enter appropriate string for the find command to define files you wish to restore, eg. some/dir/example/* into the backup -p option (this would get all files in some/dir/example folder):

cd /
backup -r -p 'some/dir/example/*'

Don't include a leading path-slash. The backup script uses find and cpio in such a way that file locations are recorded by cpio in relative form, to provide the most flexible retrieval. So specifying a name using a leading path slash in a pattern will always fail.

You can also allways specify working location and bex file location in the backup command line, using options -D(working directory) and -B(bex file location directory). To learn about all backup command options try using:

backup -h

which will explain the details of usage.

Typing backup "as is" (ie: with no parameters) will create (in /external) an archive of your whole system (from root down) via a set of 600+Mb archive chunks to suit CD-Rs, looking something like this:

-rw-r--r--    1 root     root     665845760 Aug 11 00:49 200208111625.cpio.000
-rw-r--r--    1 root     root     665845760 Aug 11 00:54 200208111625.cpio.001
-rw-r--r--    1 root     root     665845760 Aug 11 00:59 200208111625.cpio.002
-rw-r--r--    1 root     root     665845760 Aug 11 01:04 200208111625.cpio.003
-rw-r--r--    1 root     root     199999488 Aug 11 01:06 200208111625.lastcpio.004
-rw-r--r--    1 root     root          162 Aug 11 17:37 Log.backup
-rw-r--r--    1 root     root           37 Aug 11 00:40 find_errors
-rw-r--r--    1 root     root           15 Aug 11 16:45 errors
-rw-r--r--    1 root     root      3424867 Aug 11 00:40 list

Although we do not recommend using it this way, this is a good example to know. If you use compression (-g or -b options), the string .gz or .bz2 will also be included in your chunk names, so eg. the chunk called 200208111625.cpio.000 would be 200208111625.cpio.gz.000.

Another useful option is -s. As seen from the example above this backup process accomodates backup files that can be burned to CDRW or DVDRW. As carpathia has DVD writter, you can increase backup file sizes to DVD size by using -s4.7 which will result in file chunks of 4.7GB size, appropriate for burning to DVD. You don't need to burn your backup to a DVD. It will exist and be recoverable just as it is on hard drive of carpathia. But, this option allows you to burn files to DVD if you wish additional level of protection (third copy). Even when not planning to burn backup files to DVD it is recommended to use this option to increase efficiency by reducing the number of file chunks saved.

Once a full backup has been made, many subsequent backups may then be done as incrementals. So, for example, if you last did a full backup 4 weeks (28 days) ago, you could now cover yourself with a incremental backup via:

backup -n 29

This will pick up only those files that have been touched in the last 29 days (I usually add +1 or so to play safe).

You can do a number of incremental backups over a period of weeks or months, and provided you always specify a number of 'days' for the incremental that at least covers the period of time since your last full backup, you can then stage a recovery via the original full backup followed a 2nd, minor 'refresh' recovery using your latest incremental backup.

It is wise practice to (at least for your first usage of backup) check if archives are recoverable and that nothing have went wrong. To check, with carpathia disk mounted on /external, do

backup -t

If this runs to completion with no complaints and generates the log file (called rlist - ie: the recovery list), your archive set is indeed capable of being strung together at any time in the future and used for a recovery. The first one or two times you use backup, I'd also strongly recommend that you do a full restore from the archive set into an empty spare directory somewhere. This will verify that everything will indeed work for a full-scale recovery but without actually replacing anything in the original area. Check your spare disc space first via df -k to make sure that you have got enough room to hold such a full restore.

Please refere to the authors website mentioned above for any additional help.

Please send any comments on this page to Richard Vaughn.