diff --git a/install b/install index cced54a..596b4a6 100755 --- a/install +++ b/install @@ -25,8 +25,5 @@ chmod 600 "$BACKUP_DIR" # Inform the user about important manual steps echo "mysqlbkup is installed" -echo "Make sure to edit /etc/mysqlbkup.cnf and /etc/mysqlbkup.config for your needs" - -echo "Lastly, configure a crontab to execute the backup script periodically" -echo "For example, to schedule the script to run once daily" -echo "1 2 * * * /usr/local/bin/mysqlbkup.sh 1>> /var/log/mysqlbkup.log 2>>/var/log/mysqlbkup-err.log" +echo "Setup cron to run once a day" +echo "3 3 * * * /usr/local/bin/mysqlbkup.sh 1>> /var/www/mysql_database/mysqlbkup.log 2>> /var/www/mysql_database/mysqlbkup-err.log" diff --git a/mysqlbkup.cnf.sample b/mysqlbkup.cnf.sample index 497d2ed..37cbbbe 100644 --- a/mysqlbkup.cnf.sample +++ b/mysqlbkup.cnf.sample @@ -1,14 +1,17 @@ [mysql] -host=dbhost +host=localhost user=dba password=dba_passwd [mysqldump] -host=dbhost +host=localhost user=dba password=dba_passwd force opt routines triggers -max_allowed_packet=250M +default-character-set=utf8mb4 +max_allowed_packet=1G +single_transaction +skip_lock_tables diff --git a/mysqlbkup.config.sample b/mysqlbkup.config.sample index 2c68fba..e1f6db2 100644 --- a/mysqlbkup.config.sample +++ b/mysqlbkup.config.sample @@ -5,9 +5,9 @@ DEFAULTS_FILE=/etc/mysqlbkup.cnf -BACKUP_DIR=/var/mysqlbkup +BACKUP_DIR=/var/www/mysql_database -MAX_BACKUPS=3 +MAX_BACKUPS=5 DATE_FORMAT= @@ -18,5 +18,5 @@ DATE_FORMAT= DB_EXCLUDE_FILTER= # Compression library -BKUP_BIN=gzip # Change this to xz if you wish, for tighter compression -BKUP_EXT=gz # Change this to xz if you wish, for tighter compression +BKUP_BIN=lz4 # Change this to xz if you wish, for tighter compression +BKUP_EXT=lz4 # Change this to xz if you wish, for tighter compression diff --git a/mysqlbkup.sh b/mysqlbkup.sh index f73f53c..44c9d84 100755 --- a/mysqlbkup.sh +++ b/mysqlbkup.sh @@ -84,7 +84,7 @@ do done # the date is used for backup file names -date=$(date +%F) +date=$(date +"%m-%d_%I-%M-%S_%p") if [ ! -z $DATE_FORMAT ]; then date=$(date "$DATE_FORMAT") fi