Linux backups HOWTO

Jerry Winegarden

Revised 4-04-00

There are several utilities that can be used for backups under Linux. Which is the best? In part it depends on what you are backing up onto. in part it depends on what you intend to do with the backup. There isn't any one utility that is best.

List of backup utilities

There are different types of backups:

Backups can be of one directory, all or several directories.

			tar

tar ("tape archive" isn't just for tapes) is the most commonly used
backup utility. 

To produce a backup of a directory to a file on the disk (e.g. in /tmp):

tar cvf /tmp/foo.tar .     (output file by default is /dev/tape, so
				the output file name must be specified
				with the f option; here, /tmp/foo.tar)
				
			   c option = Create archive (wrap it up
					into a "tar archive")

			   v option = "verbose" - messages to screen
					when reading/writing each file

			   f option = specify output file name

			   /tmp/foo.tar = output file name specified

			  .  = source directory to create archive of
				(wraps up everything under the 
				current directory)

addition of the "z" option will gzip the output file to compress it into gzip format:

tar cvzf /tmp/foo.tar.gz

To move a directory:

cd fromdir; tar cvf - . | (cd todir; tar xvf -)

To unpack an archive of a directory:

cd destdir; tar xvf /tmp/foo.tar

Further tar options:

"Incremental" backup with tar:

tar -cvf tarfilename --after-date="sept 1, 2000" /home