In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "how to back up data in CentOS". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Files with backup significance can usually be roughly divided into two categories:
1. Basic system setup information
two。 Content data similar to web services
The files that the operating system itself needs to back up:
1./etc/ entire directory
2./home entire directory
3./var/spool/mail
4./boot
5./root
6. If you have installed other packages, then / usr/local or / opt are also best backed up.
Database aspects of network services
1. The configuration file of the software itself, for example: / etc/ entire directory, / usr/local/ entire directory
two。 Data provided by software services, taking WWW and MySQL as examples
WWW data: / var/www entire directory or / srv/www entire directory, and the user home folder of the system
MySQL:/var/lib/mysql entire directory
3. Other database files that provide services on the Linux host
Recommended directories 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 don't have to back up)
Directories that do not require backup
1./dev
2./proc
3./mnt and / media
4./tmp
Select backup device
Storage device consideration
Backup speed requirements: think about the use of hard drives
Storage capacity: tape backup consideration
Funding and data reliability: the use of DVD can be preserved for about 10 years
Some common equipment codes:
Optical drive: / dev/cdrom (it should be / dev/sdX or / dev/hdX)
Tape drive: / dev/st0 (SCSI interface), / dev/ht0 (IDE interface)
Floppy disk drive: / dev/fd0,/dev/fd1
Hard disk: / dev/hd [a murd] [1-16] (IDE), / dev/sd [a Meip] [1-16] (SCSI/SATA)
Removable hard drive: / dev/sd [amurp] [1-16] (same as SCSI)
Printer: / dev/lp [0-2]
The type and frequency of backup and the choice of tools
How to back up:
1. Incremental backup
two。 Differential backup
Incremental backup of full backup (Incremental backup)
Consideration of reduction
Principles of incremental backup
The so-called incremental backup refers to the comparison after a period of running after the first full backup of the system.
The difference between the system and the backup files, and then the gold backs up the files that have differences.
Backup software used by incremental backup
The common tools for full backup are: dd, cpio, dupm/restore
Command for direct incremental backup: dupm
Dd if=/dev/sda of=/dev/sdb
Find /-print | cpio-covB > / dev/st0
Cpio-iduv < / dev/st0
1. Full backup
Dump-0u-f / backupdata/home.dump / home
two。 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 of full backup (differential backup)
The difference in backup value is that each backup is compared with the original full backup.
Tar-N '2009-06-01'-jpcv-f / backupdata/home.tar.bz2 / home
Rsync-av source directory destination directory
Rsync-av / home/ backupdata/ (mirror / home/ to / backupdata/home/)
Rsync-av / home / backupdata/ (it will be much faster to do it again, and almost nothing will be done if the data remains unchanged)
Critical data backup
Tar-jpcvf mysql.`date +% Ymuri% mmury% d`.tar.bz3 / var/lib.mysql
This is the end of "how CentOS backs up data". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.