Mysql5.7 regularly back up databases in the CentOS environment

Source: Internet
Author: User

Let's create a directory dedicated to the backup files for MySQL. /data/mysql_bak. Write a shell script that backs up the test once every minute.

Script code:

755 /testdir/backup.sh       //Give script permission

Then perform a timed task

* * * * * * */usr/sbin/ntpdate pool.ntp.org >/dev/null2>&1*/1 * * * * * */data/mysql_bak/mysql_bak.sh    // This is used to backup every minute
Service Crond Restart   // habitual Restart services          

Refresh the directory every few minutes to view the files.

Ok. Some formatting commands for timed tasks Please refer to this link for detailed instructions.

Additional information about the deletion of old data, you can refer to some other online posts, this article does not explain the HA ~

Http://www.cnblogs.com/wt645631686/p/6868672.html

Mysql5.7 regularly back up databases in the CentOS environment

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.