Here is the bash shell script that makes archived dumps of your database server. All databases are separated from each other and stored into date based folders.
#!/bin/bash MyUSER="root" MyPASS="" MyHOST="localhost" NOW="$(date +"%d-%m-%Y")" STOREDIR="/home/storage/backup/database/by_dates/$NOW" DBLIST="$(mysql -u $MyUSER -h $MyHOST -Bse 'show databases')" [ ! -d $STOREDIR ] && mkdir -p $STOREDIR || : for db in $DBLIST do FILE="$STOREDIR/$db.gz" mysqldump -u $MyUSER -h $MyHOST $db | gzip -9 > $FILE done

