This script will create a backup for every database in $DEST folder.
#!/bin/sh
NOW=$(date +”%u”)
DEST=/backup/$HOSTNAME
echo “######################## Start Backup ”
mkdir -p $DEST
DBS=”$(mysql -Bse ‘show databases’)”
for db in $DBS
do
mysqldump $db > $DEST/$db-$NOW.sql
echo $db “Status : ” $?
done