Category: General

* Setup file in /root folder

mkdir /var/lib/mysql_backup
vi /root/
# all db separate files

for customerdb in `mysql -uuser -e "show databases" -B -N`
        echo $customerdb
        mysqldump -uuser $customerdb > /var/lib/mysql_backup/$customerdb.sql
chmod 700 /root/

* Setup Crontab so backup runs at mighnight every night

vi /etc/crontab
0 0 * * * root  /root/

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.