0% found this document useful (0 votes)
39 views2 pages

Exp No 7

Good EXP of System Administration

Uploaded by

leninantony2008
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views2 pages

Exp No 7

Good EXP of System Administration

Uploaded by

leninantony2008
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Experiment No : 7

Back up and Recovery Commands in Linux

AIM
Demonstrate backup and recovery management using commands tar, cpio, dump

Commands
1) tar

The `tar` command in Linux is used to create, manipulate, or extract archive files in the tar format,
which is a commonly used archive format in Unix-like operating systems.

Here's a breakdown of the `tar` command and its common options:

a. Create an archive:

tar -cvf archive.tar files/directories

-c stands for "create."


-v stands for "verbose" mode, which displays the progress and details of the operation.
-f specifies the file name of the archive.

b. Extract an archive:

tar -xvf archive.tar


-x stands for "extract."

c. List contents of an archive


tar -tvf archive.tar
-t stands for "list contents."

d. Append files to an existing archive:


tar -rvf archive.tar files/directories
-r stands for "append."

It's a versatile tool for archiving and managing files in the Linux environment.

2) cpio

The cpio command in Linux is used to create, extract, and manipulate archives of files. It can
work in conjunction with other commands like find or ls to back up or restore files, transfer data,
or create archives in different formats (including backups). Unlike tar, which is more widely used
for archiving, cpio is more flexible when working with other commands to manage file streams.

Syntax
cpio [options] [< archive >]

General Modes of cpio:


cpio has three primary modes of operation:
a. Copy-Out Mode (-o):
Used to create an archive. You typically pipe the output from another command like find or ls
into cpio to specify which files should be archived.

Options:
• -o: Create an archive (copy-out mode).
• -v: Verbose mode (lists the files being archived).
• -O [file]: Directs the output to the specified file (e.g., -O archive.cpio).

b. Copy-In Mode (-i):


Used to extract files from an archive.
This extracts the contents of archive.cpio into the current directory.

Options:
• -i: Extract files from an archive (copy-in mode).
• -d: Create directories as needed when extracting.
• -v: Verbose mode (lists the files being extracted).
• -t: List the contents of the archive without extracting.
3) dump
The dump command in Linux is used for backing up file systems to a storage device. It is a low-
level backup tool that copies entire filesystems, rather than individual files. It is often used to create
full or incremental backups of a filesystem.

Backup Levels: dump uses numbered levels to define the type of


backup:
• Level 0: A full backup that copies everything from the specified filesystem.
• Level 1-9: Incremental backups, which only back up files that have changed since the last
lower-level dump. For example, a Level 1 backup backs up files that have changed since the
last Level 0 backup, while a Level 2 backup backs up files changed since the last Level 1 or
0 backup.
Result
Executed the commands and obtained the result.

You might also like