From fd3e27d2626f02da82b143542556321f3f1ed61c Mon Sep 17 00:00:00 2001 From: droplinxuser <68084306+droplinxuser@users.noreply.github.com> Date: Sat, 7 Jan 2023 09:52:37 +0800 Subject: [PATCH 01/16] Update mysqlbkup.config.sample --- mysqlbkup.config.sample | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysqlbkup.config.sample b/mysqlbkup.config.sample index 2c68fba..5cf155a 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/html/mysql_database -MAX_BACKUPS=3 +MAX_BACKUPS=5 DATE_FORMAT= From 73c7e9de951ab08308ef9df0c036c65fcb0d1aad Mon Sep 17 00:00:00 2001 From: droplinxuser <68084306+droplinxuser@users.noreply.github.com> Date: Sat, 7 Jan 2023 09:54:31 +0800 Subject: [PATCH 02/16] Update mysqlbkup.config.sample --- mysqlbkup.config.sample | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysqlbkup.config.sample b/mysqlbkup.config.sample index 5cf155a..d3cdaf1 100644 --- a/mysqlbkup.config.sample +++ b/mysqlbkup.config.sample @@ -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=xz # Change this to xz if you wish, for tighter compression +BKUP_EXT=xz # Change this to xz if you wish, for tighter compression From 2e6251a3b1bd5c1354ee1dec17fb9de2654b2f8c Mon Sep 17 00:00:00 2001 From: droplinxuser <68084306+droplinxuser@users.noreply.github.com> Date: Sat, 7 Jan 2023 09:57:29 +0800 Subject: [PATCH 03/16] Update mysqlbkup.cnf.sample --- mysqlbkup.cnf.sample | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysqlbkup.cnf.sample b/mysqlbkup.cnf.sample index 497d2ed..91f9ef4 100644 --- a/mysqlbkup.cnf.sample +++ b/mysqlbkup.cnf.sample @@ -1,10 +1,10 @@ [mysql] -host=dbhost +host=localhost user=dba password=dba_passwd [mysqldump] -host=dbhost +host=localhost user=dba password=dba_passwd force From 5b5cad504aa956f13a7c0f2b253521ac74f3686d Mon Sep 17 00:00:00 2001 From: droplinxuser <68084306+droplinxuser@users.noreply.github.com> Date: Mon, 9 Jan 2023 10:38:02 +0800 Subject: [PATCH 04/16] Update mysqlbkup.config.sample --- mysqlbkup.config.sample | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysqlbkup.config.sample b/mysqlbkup.config.sample index d3cdaf1..f93be7c 100644 --- a/mysqlbkup.config.sample +++ b/mysqlbkup.config.sample @@ -18,5 +18,5 @@ DATE_FORMAT= DB_EXCLUDE_FILTER= # Compression library -BKUP_BIN=xz # Change this to xz if you wish, for tighter compression -BKUP_EXT=xz # 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 From 4d8b91e1a32064d038608e870b449a9f6ff8fe9e Mon Sep 17 00:00:00 2001 From: droplinxuser <68084306+droplinxuser@users.noreply.github.com> Date: Mon, 9 Jan 2023 12:02:51 +0800 Subject: [PATCH 05/16] Update mysqlbkup.sh --- mysqlbkup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysqlbkup.sh b/mysqlbkup.sh index f73f53c..b2d798c 100755 --- a/mysqlbkup.sh +++ b/mysqlbkup.sh @@ -155,14 +155,14 @@ do fi # create the backup for $db - echo "Running: mysqldump --defaults-file=$DEFAULTS_FILE $db | $BKUP_BIN > $backupDir/$backupFile" + echo "Running: mysqldump --defaults-file=$DEFAULTS_FILE $db | $BKUP_BIN --fast > $backupDir/$backupFile" # Skip actual call to mysqldump in DRY mode if [ $DRY_MODE -eq 1 ]; then continue; fi - mysqldump --defaults-file=$DEFAULTS_FILE "$db" | $BKUP_BIN > "$backupDir/$backupFile" + mysqldump --defaults-file=$DEFAULTS_FILE "$db" | $BKUP_BIN --fast > "$backupDir/$backupFile" echo done From 217aa9f9c63a64b75a8b3bb6040e25cef01c30c3 Mon Sep 17 00:00:00 2001 From: droplinxuser <68084306+droplinxuser@users.noreply.github.com> Date: Mon, 9 Jan 2023 12:05:21 +0800 Subject: [PATCH 06/16] Update mysqlbkup.sh --- mysqlbkup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysqlbkup.sh b/mysqlbkup.sh index b2d798c..f73f53c 100755 --- a/mysqlbkup.sh +++ b/mysqlbkup.sh @@ -155,14 +155,14 @@ do fi # create the backup for $db - echo "Running: mysqldump --defaults-file=$DEFAULTS_FILE $db | $BKUP_BIN --fast > $backupDir/$backupFile" + echo "Running: mysqldump --defaults-file=$DEFAULTS_FILE $db | $BKUP_BIN > $backupDir/$backupFile" # Skip actual call to mysqldump in DRY mode if [ $DRY_MODE -eq 1 ]; then continue; fi - mysqldump --defaults-file=$DEFAULTS_FILE "$db" | $BKUP_BIN --fast > "$backupDir/$backupFile" + mysqldump --defaults-file=$DEFAULTS_FILE "$db" | $BKUP_BIN > "$backupDir/$backupFile" echo done From baa0f8e872babbf67db2833a30687b92cefe493b Mon Sep 17 00:00:00 2001 From: droplinxuser <68084306+droplinxuser@users.noreply.github.com> Date: Mon, 9 Jan 2023 22:17:38 +0800 Subject: [PATCH 07/16] Update mysqlbkup.cnf.sample --- mysqlbkup.cnf.sample | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mysqlbkup.cnf.sample b/mysqlbkup.cnf.sample index 91f9ef4..dad6a09 100644 --- a/mysqlbkup.cnf.sample +++ b/mysqlbkup.cnf.sample @@ -11,4 +11,7 @@ force opt routines triggers -max_allowed_packet=250M +max_allowed_packet=256M +single-transaction +quick +skip-lock-tables From 64c7dd5ece1c206e4df58fac25af49c1552b2f97 Mon Sep 17 00:00:00 2001 From: droplinxuser <68084306+droplinxuser@users.noreply.github.com> Date: Mon, 9 Jan 2023 22:21:39 +0800 Subject: [PATCH 08/16] Update mysqlbkup.cnf.sample --- mysqlbkup.cnf.sample | 1 - 1 file changed, 1 deletion(-) diff --git a/mysqlbkup.cnf.sample b/mysqlbkup.cnf.sample index dad6a09..874c0d8 100644 --- a/mysqlbkup.cnf.sample +++ b/mysqlbkup.cnf.sample @@ -13,5 +13,4 @@ routines triggers max_allowed_packet=256M single-transaction -quick skip-lock-tables From 6f937423e5177b3e32f6a91be02cb33f8e76057c Mon Sep 17 00:00:00 2001 From: droplinxuser <68084306+droplinxuser@users.noreply.github.com> Date: Mon, 9 Jan 2023 22:26:10 +0800 Subject: [PATCH 09/16] Update mysqlbkup.cnf.sample --- mysqlbkup.cnf.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysqlbkup.cnf.sample b/mysqlbkup.cnf.sample index 874c0d8..464e859 100644 --- a/mysqlbkup.cnf.sample +++ b/mysqlbkup.cnf.sample @@ -11,6 +11,6 @@ force opt routines triggers -max_allowed_packet=256M +max_allowed_packet=1024M single-transaction skip-lock-tables From 1e526cfa90ad510331cc5f11df8b6448c0062641 Mon Sep 17 00:00:00 2001 From: droplinxuser <68084306+droplinxuser@users.noreply.github.com> Date: Tue, 10 Jan 2023 20:15:30 +0800 Subject: [PATCH 10/16] Update mysqlbkup.sh --- mysqlbkup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 400276fb222dc55e3545fd30c60d6ce01873c019 Mon Sep 17 00:00:00 2001 From: droplinxuser <68084306+droplinxuser@users.noreply.github.com> Date: Thu, 12 Jan 2023 11:29:58 +0800 Subject: [PATCH 11/16] Update mysqlbkup.cnf.sample --- mysqlbkup.cnf.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysqlbkup.cnf.sample b/mysqlbkup.cnf.sample index 464e859..2b0678a 100644 --- a/mysqlbkup.cnf.sample +++ b/mysqlbkup.cnf.sample @@ -11,6 +11,6 @@ force opt routines triggers -max_allowed_packet=1024M +max_allowed_packet=1GB single-transaction skip-lock-tables From 30f879a2e29720b50aed7590811b2f2d043470a8 Mon Sep 17 00:00:00 2001 From: droplinxuser <68084306+droplinxuser@users.noreply.github.com> Date: Thu, 12 Jan 2023 13:01:50 +0800 Subject: [PATCH 12/16] Update mysqlbkup.cnf.sample --- mysqlbkup.cnf.sample | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysqlbkup.cnf.sample b/mysqlbkup.cnf.sample index 2b0678a..03f5375 100644 --- a/mysqlbkup.cnf.sample +++ b/mysqlbkup.cnf.sample @@ -12,5 +12,5 @@ opt routines triggers max_allowed_packet=1GB -single-transaction -skip-lock-tables +single_transaction +skip_lock_tables From 757ef4bfa41d161e8ca6051d698d5f3243c177d3 Mon Sep 17 00:00:00 2001 From: droplinxuser <68084306+droplinxuser@users.noreply.github.com> Date: Sun, 4 Jun 2023 14:28:22 +0800 Subject: [PATCH 13/16] Update mysqlbkup.config.sample --- mysqlbkup.config.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysqlbkup.config.sample b/mysqlbkup.config.sample index f93be7c..e1f6db2 100644 --- a/mysqlbkup.config.sample +++ b/mysqlbkup.config.sample @@ -5,7 +5,7 @@ DEFAULTS_FILE=/etc/mysqlbkup.cnf -BACKUP_DIR=/var/www/html/mysql_database +BACKUP_DIR=/var/www/mysql_database MAX_BACKUPS=5 From 2c41b22045721a530254866c30d8104e65f8f9ac Mon Sep 17 00:00:00 2001 From: droplinxuser <68084306+droplinxuser@users.noreply.github.com> Date: Tue, 30 Sep 2025 05:38:17 +0800 Subject: [PATCH 14/16] Update mysqlbkup.cnf.sample --- mysqlbkup.cnf.sample | 1 + 1 file changed, 1 insertion(+) diff --git a/mysqlbkup.cnf.sample b/mysqlbkup.cnf.sample index 03f5375..a13dfe1 100644 --- a/mysqlbkup.cnf.sample +++ b/mysqlbkup.cnf.sample @@ -11,6 +11,7 @@ force opt routines triggers +default-character-set=utf8mb4 max_allowed_packet=1GB single_transaction skip_lock_tables From 9f5574d5936029712132a6a37c88c7c45625afdb Mon Sep 17 00:00:00 2001 From: droplinxuser <68084306+droplinxuser@users.noreply.github.com> Date: Tue, 30 Sep 2025 05:48:48 +0800 Subject: [PATCH 15/16] Update mysqlbkup.cnf.sample --- mysqlbkup.cnf.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysqlbkup.cnf.sample b/mysqlbkup.cnf.sample index a13dfe1..37cbbbe 100644 --- a/mysqlbkup.cnf.sample +++ b/mysqlbkup.cnf.sample @@ -12,6 +12,6 @@ opt routines triggers default-character-set=utf8mb4 -max_allowed_packet=1GB +max_allowed_packet=1G single_transaction skip_lock_tables From 9fc3064e218d4e4b32aae829b6c0b5d744cec878 Mon Sep 17 00:00:00 2001 From: droplinxuser <68084306+droplinxuser@users.noreply.github.com> Date: Tue, 30 Sep 2025 05:57:47 +0800 Subject: [PATCH 16/16] Update install --- install | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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"