In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Overview:
Smtp protocol is used in the document, and QQ Mail is used to send email, in which the client authorization code is when QQ Mail's smtp service is officially opened, so keep in mind!
1. Configure smtp
# Linux
Yum install-y mailx
# modify configuration file
Vi / etc/mail.rc
# append the following at the end and save
Set from=xxxxxxx@qq.com # set Sender set smtp=smtp.qq.com # set external STMP server set smtp-auth-user=xxxxxxx@qq.com # set STMP username set smtp-auth-password=xxxxxxx # client authenticator set smtp-auth=login
# Test
Echo "this is my test mail" | mail-s' mail test' xxxxxxx@qq.com
2. Set up a backup directory
Mkdir-p / home/mysql/data/backup/mysqlchown mysql:mysql / home/mysql/data/backup/mysql
3. Backup script
Cd / home/mysql/data/backup/mysqlchmod + x mysqldump.shvi mysqldump.shangxinxqldump.shangxinxxxxqldump.shangxinxxxxqldump.shangxxxxqldump.shangxxqldump.shangxxqldump.shangxqldump.shangxqldump.shangxxmysqldump.shangxxmysqldump.shangxmysqldump.shangxxmysqldump.shangxmysqldump.shangxqldump. } / $CURRENT_TIME.sql.gzFLAG=$ {BACKUP_PATH} / $CURRENT_TIME.flagLOG=$ {BACKUP_PATH} / $CURRENT_TIME.log/usr/local/mysql/bin/mysqldump-u$ {DB_USER}-p$ {DB_PW}-- socket=/home/mysql/3306/data/mysql.sock-- host=$HOST-B-- all-databases-- master-data=2-- single-transaction | gzip > $FILE_GZ # backup md5sum $FILE_ must be verified with absolute path # here GZ > ${BACKUP_PATH} / $CURRENT_TIME.flagmd5sum-c ${BACKUP_PATH} / $CURRENT_TIME.flag > ${BACKUP_PATH} / $CURRENT_TIME.log# delete backups from 7 days ago "pay attention to writing" cd $BACKUP_PATHfind $BACKUP_PATH-mtime + 7-name "* sql.gz"-exec rm-f {}\ Find $BACKUP_PATH-mtime + 7-name "* .log"-exec rm-f {}\; find $BACKUP_PATH-mtime + 7-name "* .flag"-exec rm-f {}\; # send email echo "MySQL backup result email, the attachment says OK is successful" | mail-s' mysql backup'- a $LOG xxxxxxx@qq.com
4 、 crontabl
Crontab-e # join this script path
* 23 * / bin/sh / home/mysql/data/backup/mysql/mysqldump.sh
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.