A simple Linux data backup solution

Source: Internet
Author: User
Article Title: A simple Linux data backup solution. Linux is a technology channel of the IT lab in China. Linux data backup, including desktop applications, Linux system management, kernel research, embedded systems, open source, and other basic categories, usually uses tar commands. It is difficult for beginners to understand more complex Linux data backup solutions. This article introduces a "silly backup solution" for users who are new to Linux servers.
1. First, we need to know what data needs to be backed up.
Generally, the database and website data are included. In this example, the database is located in the/var/lib/mysql/directory, and the website is located in the/www/users/directory.
2. determine where to back up data and create a directory in this partition.
Select a partition with a large space, for example,/var.
Type the following command:
Cd/var
Mkdir backup
3. After creating the Backup Directory, go to the backup directory.
Cd/var/backup
4. Generally, the database should be completely backed up. We recommend that you name each backup as the current date.
Tar-czvf mysql20051015.tar.gz/var/lib/mysql /*
This command generates a backup in the current directory. The backup content is all the content in the/var/lib/mysql/directory.
5. If there is not much website data, you can completely back up the website data each time.
Tar-czvf users20051015.tar.gz/www/users /*
6. If there is a large amount of website data(Especially for systems with a large volume of Files updated every day, such as E-station communication and mall operations), we recommend that you perform a full backup every month and update the backup every day (or every week. This backup method is called "differential backup". Differential backup requires that each updated backup be based on the last full backup time.
For example, a full backup will be performed on January 1, October 15:
Tar-czvf users20051015.tar.gz/www/users /*
Before the next full backup, update and back up the full backup on April 9 (for example, once a week ):
Tar-czvf users20051015.tar.gz/www/users/* -- newer 10/15/2005/
After "differential backup", if you need to recover data, you should first restore the full backup, and then overwrite the latest update backup.
I hope this Linux data backup solution is relatively simple and helpful for beginners.
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.