Backup Commands in Linux & Unix with Usage and Examples

Backup restore using cpio command

cpio features

1. Used for single or multiple files backup .
2. Can backup special character & block device files .
3. Works only on mounted file system.
4. Need a list of files to be backed up .
5. Preserve hard links and time stamps of the files .

Using cpio command to back up all the files in current directory to tape.

find . -depth -print | cpio -ovcB > /dev/rmt/0

cpio expects a list of files and find command provides the list, cpio has to put these file on some destination and a > sign redirect these files to tape. This can be a file as well .

Viewing cpio files on a tape

cpio -ivtB < /dev/rmt/0

Restoring a cpio backup

cpio -ivcB < /dev/rmt/0

Compress/uncompress files :

You may have to compress the files before or after the backup and it can be done with following commands .

click for full options and details of GNU cpio 

NEXT >> Backup and Restore linux file system


Pages: 1 2 3 4

Leave a Reply

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