#!/bin/bash
# 00 20 * * * /backups/xtrabackup/script/xtrbackup_script.sh
type xtrabackup >/dev/null 2>&1 || { echo >&2 "I require xtrabackup but it's not installed. Aborting."; exit 1; }
### 变量定义
## 设置自动登录,隐藏密码
## /data/mysqldb/mysql-8.0.23/bin/mysql_config_editor set --login-path=local --host=localhost --user=root --password
## mysql --login-path=local
XTRABACKUP_ETL='xtrabackup --login-path=local'
# 日期换算
# 年
# 本周一日期
THISMONDAY=`date -d "this monday" +%Y%m%d`
if [ `date -d "this monday" +%
1