File systems Backup Management

What is it? Backup commands. other issues Media, Hardware

Why do we need backups?
In order to recover lost files we need to have backups. Why do we use computers? so that we can store and manipulate our data. So if our data is lost computers are of no use. Thus giving us a reason to copy the data into a backup media, from which we can recover our lost files after disaster. Before backing up the files, a systems administratore needs to decide.
  • Which files need to be backed up? decide on incremental backup or full backup.
  • When to perform a backup? what time of day, check for system load, etc.
  • How to restore ? does the user needs corrupted file now or in few days.
  • How to backup Which media (tape, disk, etc), commands(tar, cpio, dump, restore, mt, mc), etc.
back to top
Back to main page


Important Backup Commands

These are common backup and restore commands used in all favours of Unix.
Backup and restore (storage) Commands
compress uncompress, cpio,dump, restore , pack, tar, mt.


Compress command.
Compress command compresses a file and returns the original file with .z extension, to uncompress this filename.Z file use uncompress filename command. syntax for compress command is
compress options files


Uncompress command.
Uncompress file uncompresses a file and return it to its original form.
syntax is
uncompress filename.Z this uncompresses the compressed file to its original name.


Cpio command.
cpio command is useful to backup the file systems. It copy file archives in from or out to tape or disk, or to another location on the local machine. Its syntax is
cpio flags [options]


Dump command is useful to backup the file systems.
dump command copies all the files in filesystem that have been changed after a certain date. It is good for incremental backups. This information about date is derived from /var/adm/dumpdates and /etc/fstab .
syntax for HP-UX dump is
/usr/sbin/dump [option [argument ...] filesystem]


Restore command.
Restore and ufsrestore command restores files backed up with dump command.
Syntax is
restore options arguments files-dirs


Pack command.
pack command compacts each file and combine them together into a filename.z file. The original file is replaced. Pcat and unpack will restore packed files to their original form.
Syntax is
Pack options files


Tar command.
tar command creates an archive of files into a single file.
Tar copies and restore files to a tape or any storage media. Synopsis of tar is
tar [options] [file]

Examples:
tar cvf /dev/rmt/0 /bin /usr/bin creates an archive of /bin and /usr/bin, and store on the tape in /dev/rmt0.
tar tvf /dev/rmt0 will list the tape's content in a /dev/rmt0 drive.
tar cvf - 'find . -print' > backup.tar will creates an archive of current directory and store it in file backup.tar.



Mt command

Mt command is used for tape and other device functions like rewinding, ejecting, etc. It give commands to tape device rather than tape itself. Mt command is BSD command and is seldom found in system V unix versions.
syntax is
mt [-t tapename] command [count]


back to top of storage commands
back to top of page back to top
Back to main page


Other issues

These following are some other issues concerning backups.

  1. An effective backup strategy is an ongoing process.
  2. The simpliest backup scheme is to copy all the files on a media, called full backup.
  3. Copy only those files which were changed since last backup, called incremental backup.
  4. Always label on media before what you are going to backup in that media.
  5. Know where the media is and keep a handy procedure on "how to backup and restore."
  6. Write protect media.
  7. Take security of media into account. A stolen/lost tape of full backup is full access to system.
back to top
Back to main page

Physical media

Magnetic Tape

Magnetic tapes are the most used media for backup. 8mm and 4mm tapes are most common backup medium for Unix systems. 8mm tapes were originally designed for video uses (8mm video camcorder), media holds upto 2GB of data. If your system needs more then 1 tape for backup then a stacker which can hold upto ten tapes along with software is very common. 4mm tapes which are smaller can hold more data since it is newer technology, upto 4GB. Another type of very famous upcoming media is DLT tapes, DLT tapes normally comes with all the hardware and software. All you have to do is make sure that there are enough tapes and schedule the backup.


Floppy disks

Floppy disks are found on most computer systems. Very inexpensive and reliable but their capacity is very small. Floppy disks are only good for emergency booting of system. Backup on floppies can run into several hundred or thousands of floppies each time.


Hard Disks

Disk mirroring capabilities make it a very fast and reliable backup system.


back to top
Back to main page





Fundamentals of Unix Unix commands User Accounts Shell Programming
File Systems Networking Backups Security
Installing software Installing Hardware Performance and Tuning Some Useful Scripts

Your suggestions and comments are welcome. Please e-mail me
Copyright reserved with Sandeep S Bajwa.