1. The primary purpose is to recover data after its loss, be it by data deletion or corruption. Data loss is a very common experience for computer users. 67% of internet users have suffered serious data loss.
2. The secondary purpose of backups is to recover data from an earlier time, according to a user-defined data retention policy, typically configured within a backup application for how long copies of data are required.
Tar means tape archiving
Syn: tar [options] [FILE]
Options:
Inclined to build a profession as Linux Developer? Then here is the blog post on, explore Linux Training |
Step 1: Create some random blank files:
#touch file 1 file 2 files 3 another _file
Step 2: create a simple archive containing these files:
#tar –cvf sample.tar file1 file2 file3 another –file
When an archive is created, you can also apply compression to reduce the amount of space the archive files takes up. Although multiple types of compression are supported with the use of tar we look only at gunzip (.gz) and bzip2 (bz2) here.
Step 3: Let’s re-create the archive using the gunzip compression:
#tar -cvzf sample.tar.gz file1 file2 file3 another-file
Step 4: view the current directory to see the two current archive files:
#ls
Step 5: To see all the contents within the build file:
#tar –tvf sample.tar
Step 6: Now extract this build file verbosely:
#tar -xvf sample.tar
Step 7: To extract files on a different location
#tar – xvf sample.tar -c /root/desktop
Read these latest Linux Interview Questions that help you grab high-paying jobs |
cpio is a tool for creating and extracting archives or copying files from one place to another.
----->It handles a number of cpio formats as well as reading and writing tar files.
----->Cpio like tar but can read input from the “find” command
----->The basic structure is
:find –name file/cpio [options] [contraoller] <dest>
Options: -o (out) Controllers: O (or) > -out
-i (in) I (or) > -in
Step 1: To take the backup files
#ls file * /cpio -acvf >/root/backup.cpio
Step 2: To see the backup content:
#cpio -it </root/backup.cpio
#cpio -it -I /root/backup .cpio
Step 3: To restore the backup file:
#cpio -icuvd </root/backup.cpio
O -----> Reads the standard input
i -----> Extract files from the standard input
c -----> Read or write header information in ASCII character
d -----> Creates directories as needed
u -----> Copy unconditionally (older file will not replace a new file)
Used to take the backup of one partition to another, here source partition should be given to “if” destination partition should be passed to “of”
#dd if=/dev/hda6 of= /dev/hda7
#dd if = /dev/hda7 of=/dev/hda6
----->SCP is used to copy data from one Unix or Linux system to another Unix or Linux server.
----->SCP uses a secured shell (ssh) to transfer the data between the remote hosts.
----->The features of SCP are:
Syn: SCP [options] [user from_Host: source_file] {user to _host: Destination_file]
Options:
-r -----> Recursively
-q -----> Progress bar not displayed
-v -----> Verbose mode
-p -----> copy files using the specified port number.
----->Copy file from local host to remote server:
#scp filename root@server254.example.com:/root
----->Copy files from the remote host to the local server:
#scp root@server254.example.com:/root/backkup*
• Current directory
----->Copying a directory:
#SCP –r directory root@server254.example.com: /root
----->Improving the performance of SCP command:
Using Blowfish or Arcfour encryption will improve the performance of the SCP command
#SCP -c blowfish filename root@server254.example.com.com:
----->Specifying the port number:
#SCP -p 6001 backup-file root@server254.example.com:/tmp
For an in-depth understanding of Linux click on
You liked the article?
Like: 4
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.