Category: Linux

vi /path/backup.sh

#/bin/sh
# all db separate files

for customerdb in `mysql -uusername -ppassword -e "show databases" -B -N`
do
        echo $customerdb
        mysqldump -uusername -ppassword $customerdb > /path/$customerdb.sql
done

Add cron job

vi /etc/crontab

* 0 * * * root  /path/backup.sh

 

Tags:

Linux

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.