Linux Data Backup and recovery

Source: Internet
Author: User
Tags bz2

1, the Linux system needs to back up the data

/root/Directory:

/home/directory:
/var/spool/mail/directory:

/etc/Directory: Other directories:

2, the installation of services data

Data that Apache needs to back up

configuration files, Web page home directories, log files

MySQL needs to back up the data = Source Package installed mysql:/usr/local/mysql/data/

RPM Package Installation of mysql:/var/lib/mysql/

3. Full backup, incremental backup, differential backup

(01), Backup command and dump [option] File name original file or directory after backup

Options:

-level: That's what we're talking about. 0-9 is a backup level

-F file Name: Specify the file name after backup

-U (Common): After the backup is successful, log the backup time in the/etc/dumpdates file

-V: Show more procedures

-j (Common): Call Bzlib Library Compressed backup file, in fact, is to compress the backup file into. bz2 format

-W: Displays the backup level and backup time of the partition allowing dump

Example: Backup partition

Dump-0uj-f/root/boot.bak.bz2/boot/

#备份命令. Perform a full backup first, and compress and update the backup time

Cat/etc/dumpdates

#查看备份时间文件

CP install.log/boot/

#复制日志文件到/boot partition

Dump-1uj-f/root/boot.bak1.bz2/boot/

#增量备份/boot partition, and compress dump–w #查询分区的备份时间及备份级别的

Example: Backing up a file or directory = = dump-0j-f [FileName]/root/etc.dump.bz2/etc/

#完全备份/etc/directory, use only 0 levels for full backups and no longer support incremental backups

(02), Restore command = restore [mode options] [options]

Mode options: There are four modes commonly used by the restore command, and these four modes cannot be mixed

-C: Compare backup data and actual data changes

-I: Enter interactive mode, manually select the files that need to be recovered

-T: view mode for viewing what data is in the backup file

-R: Restore Mode for data restore,

Options:

-F: Specifies the file name of the backup files

Linux Data Backup and recovery

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.