From 86b074751cc919015459350465c57a2a99e6ec91 Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Wed, 7 Sep 2022 14:58:10 +0200 Subject: [PATCH] [MySQL] Simplified mysql command --- Linux/mysql_backup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Linux/mysql_backup.sh b/Linux/mysql_backup.sh index ab10c6d..30b365a 100644 --- a/Linux/mysql_backup.sh +++ b/Linux/mysql_backup.sh @@ -9,9 +9,9 @@ retention=3 mkdir -p $backup_dir # database backup -for DB in $(mysql -e 'show databases' -s --skip-column-names|grep -v 'information_schema\|performance_schema'); do +for DB in $(mysql -e 'show databases' -sN|grep -v 'information_schema\|performance_schema'); do mysqldump $DB > "$backup_dir/$date.$DB.sql"; done # delete old backups -find $backup_dir -type f -mtime +$retention -name '*.sql' -execdir rm -- '{}' \; \ No newline at end of file +find $backup_dir -type f -mtime +$retention -name '*.sql' -execdir rm -- '{}' \;