Linux backup mysql and Extract files (zip)

Source: Internet
Author: User

One requirement today is to back up mysql Data at every day. Because I don't know where the mysql installation directory is.

Pass:

 

[Root @ localhost root] # find/-name mysql-print
/Var/lib/mysql
/Var/lib/mysql
/Var/lock/subsys/mysql
/Etc/rc. d/init. d/mysql
/Etc/logrotate. d/mysql
/Usr/bin/mysql
/Usr/lib/mysql
/Usr/share/mysql
[Root @ localhost root] # find/usr-name mysqldump-print
/Usr/bin/mysqldump

Find the mysqldump path

Execute a shell file using vi beifen. sh on a regular basis.

/Usr/bin/mysqldump-u root-p test>/home/mysql/test. bak

Then add a task through crontab-e

* 2 *** beifen. sh

You can.

You can view all the files in the home directory using hl when checking the information on the Internet.

Originally, it was abbreviated as alias hl = 'LS-l/home.

Zip package file name. zip file to be pressurized

Zip-r compressed package file name. zip file to be pressurized

Unzip uncompress the package. Zip to the current directory

Unzip-Z file. Zip to view compressed files

 

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.