List of Complete Unix Command Line and Software for Backup


Simple Local Copies

The simplest form of backup is to make simple copies of your files and directories. You might make those copies to local disk, to removable disk, to tape, or to some other media. Some file copy programs will properly duplicate modification and access times, and copy owner and protection information, if you are the superuser or if the files belong to you. They seldom recreate links, however. Examples include:

cp
The standard command for copying individual files. Some versions support a -R or -r option to copy an entire directory tree.

dd
This command can be used to copy a whole disk partition at one time by specifying the names of partition device files as arguments. This process should be done with great care if the source partition is mounted: in such a case, the device should be for the block version of the disk rather than the character version. Never copy onto a mounted partition—unless you want to destroy the partition and cause an abrupt system halt!

Be careful when backing up live filesystems! If you're not going to bring your system down to single-user mode during backups (and few users are willing to tolerate this kind of downtime), you should be aware of how your backup procedure will handle attempts to back up a file that's in use by another process, particularly a process that may lock the file, write to the file, or unlink the file during the backup process. In some cases, you may need to write a script to temporarily stop certain processes (such as relational databases) during the backup and restart them afterwards in order to be sure that the backup file is not corrupted.

Simple Archives

There are several programs that are available to make simple archives packed into disk files or onto tape. These are usually capable of storing all directory information about a file, and restoring much of it if the correct options are used. Running these programs may result in a change of either (or both) the atime and the ctime of items archived, however.

ar
Simple file archiver. Largely obsolete for backups (although still used for creating Unix libraries).

tar
Simple tape archiver. Can create archives to files, tapes, or elsewhere. This choice seems to be the most widely used and simple archive program.

cpio
Another simple archive program. This program can create portable archives in plain ASCII of even binary files, if invoked with the correct options.

pax
The portable archiver/exchange tool, which is defined in the POSIX standard. This program combines tar and cpio functionality. It uses tar as its default file format.

Specialized Backup Programs

There are several dedicated backup programs:

dump/restore
This program is the "classic" one for archiving a whole partition at once, and for the associated file restorations. Many versions of this program exist; all back up from the raw disk device, thus bypassing calls that would change any of the times present in inodes for files and directories. This program can also make the backups quickly.

On Linux and BSD-based systems, a "no dump" file attribute can be set on files and directories to exclude them from dump. From a security standpoint, this is probably a bad idea; it's too easy to fail to notice the file attribute until you need to restore a file and discover that you'd made it "no dump." If you are concerned about backing up confidential files, encrypt your backups.

backup
Some SVR4-based systems have a suite of programs named, collectively, backup. These are also designed specifically to do backups of files and whole filesystems.

Network Backup Systems
A few programs can be used to do backups across a network link. Thus, you can do backups on one machine and write the results to another. An obvious example would be using a program that can write to stdout, and then piping the output to a remote shell. Some programs provide for compression (to improve backup speed on slower networks) and/or encryption of the data stream:

rdump/rrestore
A network version of the dump and restore commands. It uses a dedicated process on a machine that has a tape drive, and sends the data to that process. Thus, it allows a tape drive to be shared by a whole network of machines.

rsync
A program designed to remotely synchronize two filesystems. One filesystem is the master; changes in that one are propagated to the slave. rsync is optimized for use with logfiles: if a 100 MB file has 1 megabyte appended, rsync can detect this and copy only over the last megabyte.

scp
Enables you to copy a file or a whole directory tree to a remote machine using the SSH protocol, which avoids sending cleartext passwords over the network and can encrypt the data stream. It is based on the older rcp command, which is unsecure.

unison
Designed for two-way synchronization between two or more filesystems. When unison first runs, it creates a database that describes the current state of both filesystems. Thereafter, it can automatically propagate file additions, changes, and deletions from one filesystem to the other.

source: Practical Unix & Internet Security, 3rd Edition By Simson Garfinkel, Alan Schwartz, Gene Spafford


Trackback URL for this post:

http://www.desktopauditing.com/trackback/118

User login

Who's new

  • toolwerx
  • Papabaz
  • onendoclame
  • RakvallWeet
  • invijah

Who's online

There are currently 0 users and 1 guest online.