<>linux mysql Automatic daily backup

<> Create directory
mkdir -p /data/mysqlbak/data mkdir -p /data/mysqlbak/scripts mkdir -p
/data/mysqlbak/logs
<> Create script

cd /data/mysqlbak/scripts
vi backup.sh
#!/bin/bash # Backup directory BACKUP_ROOT=/wzq/data/mysqlbak
BACKUP_FILEDIR=$BACKUP_ROOT/data # current date DATE=$(date +%Y%m%d) mysqldump -uroot
-p123456 --default-character-set=utf8 -q --lock-all-tables --flush-logs -E -R
--triggers -B db-name | gzip > $BACKUP_FILEDIR/db-name_$DATE.sql.gz echo
----------$BACKUP_FILEDIR/db-name_$DATE.sql.gz COMPLETE---------- echo "done"
<> Set permissions
chmod 777 backup.sh
<> Add to scheduled task
00 2 * * * /data/mysqlbak/scripts/backup.sh > data/mysqlbak/logs/backup.log
2>&1

Technology
©2019-2020 Toolsou All rights reserved,
( Essence )2020 year 6 month 26 day C# Class library Exception handling help class el-select Get selected label value SpringMVC Frame in controller Layer gets the property value of the custom configuration file element-ui Of el-date-picker Component get value ( Essence )2020 year 8 month 15 day redis database StackExchange.Redis in Set type (C# edition )python primitive -- lock LockJava Thread of Sleep() Summary of usage airflow Question series 2 —— task keep running Suspended animation Summary of artificial intelligence algorithm ( Essence )2020 year 7 month 15 day Wechat applet import and include difference