Tar, dump, restore backup and restore data in Linux

Source: Internet
Author: User

In the terminal, enter:

The code is as follows Copy Code

Tar-cvpzf/media/data/linux_bak.tgz–exclude=/proc–exclude=/lost+found–exclude=/media–exclude=/mnt–exclude=/sys/

Note: The last/previous one has a space

Media/data/linux_bak.tgz This is the path to my backup file save. Data is another partition on my hard drive, and you can back up the backup files to a network hard disk or on a tape drive.


To restore the system from backup:

The code is as follows Copy Code

TAR-XVPZF/MEDIA/DATA/LINUX_BAK-C/


Instance

Here is a simple example of using the tool for data backup:
  

The code is as follows Copy Code
Tar czvf-/root/code >/tmp/code_bak.tgz (Pack all program files in the/root/code directory back up to/tmp/code_bak.tgz)
  
Tar Xzvf/tmp/code_bak.tgz/root/code (restores the backed-up directory file to the specified directory)

There is also an order

Dump and restore Introduction

Both dump and restore can be run on the network, so users can back up or restore from a remote device. Dump and restore use tape drives and file devices that provide a wide range of options. However, both are limited to ext2 and Ext3 file systems. If you are using a JFS, Reiser, or other file system, you will need additional utilities, such as tar. As an example:
  

/tr>
  code is as follows copy code
dump 0f/dev/ Nst0/(Back up the ext2 file system to the first SCSI device)

Restore-xf/dev/nst0/home/code (Restore all data from the/home/code directory in the backed up SCSI device to disk)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.