Backup Commands in Linux & Unix with Usage and Examples

Unix and Linux backup and restore can be done using backup commands tar, cpio ufsdump, dump and restore. Though these commands may be sufficient for small setups in order to take a enterprise backup you have to go in for some custom backup and restore solutions like Symatic netbackup, EMC networker or Amanda.
Any backup solution using these commands depends on the type of backup you are taking as these backup commands offers different capabilities.

In this article learn about :

1. backup command tar – how to use tar for backing up unix and linux files
2. backup command cpio – how to use cpio for backing up unix and linux files
3. backup commands ufsdump and restore for Solaris filesystem
4. backup commands dump and restore for taking Linux file system backup.

Backup restore using tar command

tar features:

1. Used for single or multiple files backup .
2. Can’t backup special character & block device files ( 0 byte files ).
3. Works only on mounted file system.
Backing up all files in a directory including subdirectories to a  tape device (/dev/rmt/0),

tar cvf /dev/rmt/0 *

Viewing a tar backup on a tape

tar tvf /dev/rmt/0

Extracting tar backup from the tape

tar xvf /dev/rmt/0

(Restoration will go to present directory or original backup path depending on
relative or absolute path names used for backup )

Compressing file/s

compress -v file_name
gzip filename

To uncompress a file

uncompress file_name.Z
or
gunzip filename
NEXT >> Backup restore using cpio command

Share

Pages: 1 2 3 4

Leave a Reply

Your email address will not be published. Required fields are marked *