quinta-feira, 28 de janeiro de 2016

Automatic MySQL backups on CentOS 7

You can create automatic backups for MySQL on CentOS 7, by creating a shell script and adding it to /etc/cron.daily folder. This way, your script will be executed daily as a cron job.

Here is the script to your .sh shell script:

nano bkup.sh
mysqldump -uroot -pyourpswd yourdatabasenamehere > /home/youruser/db.$(date +%a.%H:%M).dump

You need to set the permissions to it:
chmod 700 bkup.sh

And there you go!

Don't forget to check your backups from time to time... =)




Check out my new book about R Language http://www.amazon.com/dp/B00SX6WA06

Nenhum comentário:

Postar um comentário

Leave your comment here!