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 -- '{}' \;