Linux Backup Policy resolution

Source: Internet
Author: User

The small partners in Linux operations know how important backups are to system security. Since it is so important, it is worth taking a long time to explain the problem. Well, let's get to the chase.

For Linux operating systems, in our daily work, if the hardware is supported and fully funded, of course we can choose to take a full backup of the whole disk. But in general, the funds are not allowed to drip, at this time we have no way to direct the full backup, then how to do? Backup key data, of course, gentlemen and listen to me slowly!

Before we talk about backup methods, let's start by saying what directories or files we need to back up :

①/boot Entire Directory

②/etc Entire Directory

③/home Entire Directory

④/root

⑤/usr/local (or/opt and/srv, etc.)

⑥/var


Then of course there are directories that do not need to be backed up:

①/dev This directory is mainly used to store our hardware equipment, the reload system is the same, backup or not can be.

②/proc the directory is a program that is currently running on the system and is not intended to be used without backup

③/mnt and/media mount the directory, if you do not put in the inside of the system related things, naturally do not have to back up

④/tmp This directory is used to store temporary files, of course, you do not need to backup drip


Backup Device Selection :

If you have the money, buy a tape drive backup and use the IDE or SATA interface hard disk If you don't have enough funds.


Backup Policy selection :

There are three types of backup strategies:

First: Full backup

Second: Incremental backup

Third: Differential backup ②


Here are the features of these three types of backups:

① Full Backup

As the name implies, is the complete backup, haha, I seem to have said a nonsense. In fact, a good understanding, such as the entire/directory backup is a full backup.

② Incremental Backup

If we had a full backup in Monday, we would just have to back up the data for Monday, and in Wednesday we would back up the portion of the data that was added to Monday and Tuesday, and so on, up to 9 times, which is incremental backup.

The advantage of an incremental backup is that the backup amount is significantly reduced and the speed is much faster. The disadvantage is also obvious, that is, recovery will be very troublesome, we need to restore the Monday full backup of the data, and then restore the Tuesday incremental part, and then restore the Wednesday increment part ...

③ differential Backup

The so-called differential backup is the search for a balance between full and incremental backups, which is easier to recover than incremental backups.

For example, in Monday we had a full backup, so in Tuesday we backed up the new section relative to the original full backup, and Wednesday was still the new part of the backup for the full backup relative to Monday (that is, the sum of the data for Tuesday and Wednesday), and so on.


Note: the most common jobs we use are still full backups and incremental backups

Let's take a look at how to make a backup:

The most common tool we back up is dump.

① For example: A full backup of the/boot partition and backup to the/root directory

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

which

The-level:0-9 represents a different backup level, where 0 represents a full backup, 1 represents the first incremental backup, and so on.

-U: Log dump time to the/etc/dumpdates file

-V: Show the process of dump

-j: Compress data to bz2 format by default

-F: followed by a compressed file name, a custom

-W: View backup status for all partitions

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/89/58/wKiom1gQKh_Co68YAACzCZINyf8418.png-wh_500x0-wm_3 -wmp_4-s_3443520645.png "title=" Qq20161026115942.png "alt=" Wkiom1gqkh_co68yaaczczinyf8418.png-wh_50 "/>


② for a single backup file or directory, there is no problem with the so-called backup level, but only with levels 0

such as: Backup/etc directory to the/root directory

Dump-0j-f/root/etc.dump.bz2/etc/

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/89/58/wKioL1gQWzuiMZnkAAC9qQYxsM4583.png-wh_500x0-wm_3 -wmp_4-s_1997611974.png "title=" Qq20161026152915.png "alt=" Wkiol1gqwzuimznkaac9qqyxsm4583.png-wh_50 "/>


Ha, good cow, you have learned how to do the backup operation. But just learning to backup is certainly not possible, after all, the ultimate goal of our backup is to be able to recover data in the event of a problem. So, next, I will teach you how to recover:

Restore "mode" option

Mode:

C: Compare the backup file and the existing file whether there is a discrepancy, if there is a discrepancy, prove that there is a problem with the existing data, consider the recovery

-T: View what data is included in the backup file

-r: Restore Backup files

Options:

-F: Follow up the backup file name


Example: Restoring a backup file/root/boot.bak.bz2

First step: mkdir Bootbak

Step Two: CD Bootbak

Step Three: Restore-r-f/root/boot.bak.bz2

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/89/58/wKioL1gQYeDSeuceAACOO-4oKBQ373.png-wh_500x0-wm_3 -wmp_4-s_2365563145.png "title=" Qq20161026155743.png "alt=" Wkiol1gqyedseuceaacoo-4okbq373.png-wh_50 "/>

Note: If it is an incremental backup, continue to restore the incremental section!

This article is from the "Brother Hong Linux World" blog, so be sure to keep this source http://zhengkangkang.blog.51cto.com/12015643/1865928

Linux Backup Policy resolution

Related Article

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.