How CentOS Backup Policy

  
Backup Points
Backup Data Considerations
Problems causing system damage:
Hardware problems: Hard disk destruction
Software problems: accidental deletion, security attacks,
Different host roles, Backup tasks are different
Backup factors are considered
Which files are backed up
What backup devices are selected























Data
Files with backup meaning can usually be roughly divided into two categories:
1. System basic settings information
2. Content data similar to network services
Operating system itself needs to back up files: < Br> 1./etc/Entire directory
2./home Entire directory
3./var/spool/mail
4./boot
5./root
6. If installing Other packages, /usr/local or /opt is also best to back up
Database for network services Aspects
1. The configuration file of the software itself, for example: /etc/the entire directory, /usr/local/the entire directory
2. The data provided by the software service, taking WWW and MySQL as an example
WWW Data: /var/www The entire directory or /srv/www entire directory, and the system's user home folder
MySQL: /var/lib/mysql Entire directory
3. Other database files that provide services on Linux hosts
directory
recommended to be backed up 1./boot
2./etc
3./home
4./root



5./usr/local (or /opt and /srv, etc.)
6./var (Note: If there are some temporary directories in this directory, you can not back up)
Directory that does not need to be backed up
1./dev
2./proc
3./mnt and /media
4./tmp
Select Backup Device
Storage Device Considerations
Backup Speed ​​Requirements: Think Hard Disk Usage
Storage Capacity : Tape backup considerations
Funding and data reliability: DVD usage can be saved for about 10 years
Some common device code:
Optical drive: /dev/cdrom (In fact, it should be /dev/sdX or /Dev/hdX)
Tape drive: /dev/st0 (SCSI interface), /dev/ht0 (IDE interface)
Floppy drive: /dev/fd0, /dev/fd1
Hard disk: /dev/Hd[ad][1-16] (IDE), /dev/sd[ap][1-16] (SCSI/SATA)
Mobile Hard Disk: /dev/sd[ap][1-16] (with SCSI is the same)
Printer: /dev/lp[0-2]
Backup type, frequency and tool selection
Backup method:
1. Incremental backup
2. Difference Backup
Incremental backup of full backup































After a period of operation, compare the difference between the
system and the backup file, and then back up the files with different differences.
Backup Software for Incremental Backup
Common tools for full backup are: dd, cpio, dupm/restore
Direct incremental backup command: dupm
dd if=/dev/sda of =/dev/sdb
find /-print |  cpio -covB & gt; /dev /st0



cpio -iduv & lt; /dev /st0
1. full backup
dump -0u -f /backupdata/home.dump /home
2. Incremental backup for the first time
dump -1u -f /backupdata/home.dump.1 /home
tar -exclude /proc --exclude /mnt --exclude /tmp
--exclude /backupdata -jcvp -f /backupdata/sys.tar.bz2
Differential backup for full backups
Differential backup values ​​are: each backup is the same as the original full backup Comparison result
tar -N '2009-06-01' -jpcv -f /backupdata/home.tar.bz2 /home
rsync -av source directory target directory
rsync -av /home /backupdata/(Mirror /home/to /backupdata/home/)
rsync -av /home /backupdata/(It will be much faster, if the data has not changed, almost no operation will be done)
Key data backup
tar -jpc Vf mysql.`date +%Y-%m-%d`.tar.bz3 /var/lib.mysql

Copyright © Windows knowledge All Rights Reserved