add readme and status file

This commit is contained in:
2022-02-09 10:04:28 +01:00
parent a3f5acdaa5
commit b7593a6674
2 changed files with 15 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ defaultfile=/root/.my.cnf
rdir=${1:-/root/backups/mysql}
dir=${rdir}/$(date "+%Y.%m.%d")
error=0
status_file=/var/run/backup_mysql.status
mkdir -p $dir
cd $dir
@@ -33,4 +34,5 @@ while read uh; do mysql --defaults-file=${defaultfile} -BNe "show grants for $uh
if [ $error -eq 0 ] ; then
find $rdir -maxdepth 1 -type d -mtime +${rotate} -exec rm -fr {} \;
fi
echo $error > $status_file
exit $error