This commit is contained in:
Naum Soloveychik
2020-01-10 22:33:20 +03:00
parent 151316e0bd
commit dce1d56dc9
2 changed files with 5 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ Feature rich MySQL / MariaDB backup script.
## Example
**Usage:** `mysql_backup.sh -d /backup/dir/ -n daily [-c 10 -s -a -e test@domain.org]`
**Usage:** `mysql_backup.sh -d /backup/dir/ -n daily [-c 10 -s -z -e test@domain.org]`
## Options
@@ -30,7 +30,7 @@ compress dump using gzip
## Setup script in crontab
`20 01 * * * root /bin/sh /path/to/mysql_backup.sh -d /backup/dir/ -n daily -c 10 -e admin@email.com -a`
`20 01 * * * root /bin/sh /path/to/mysql_backup.sh -d /backup/dir/ -n daily -c 10 -e admin@email.com -z`
## .my.cnf example

View File

@@ -49,7 +49,7 @@ while [ "$1" != "" ]; do
-s | --single-transaction )
singletrans=1
;;
-z | --compress ) archive=1
-z | --compress ) compress=1
;;
-q | --quiet ) quiet=1
;;
@@ -152,10 +152,10 @@ dump_file_name="${dir}/mysqldump.${name}.${date}.sql" ;
mysqldump ${mysqlparams} > ${dump_file_name} ;
if [ "${archive}" ] ; then
if [ "${compress}" ] ; then
if [ ! "${quiet}" ] ; then
echo "Archiving dump (`date +\"%Y-%m-%d %H:%M:%S\"`)..." ;
echo "Compressing dump (`date +\"%Y-%m-%d %H:%M:%S\"`)..." ;
fi
gzip ${dump_file_name} ;