Taking backup of mysql database using cron

Create a file called database_backup.sh and also an empty directory called mysql_backup. The database_backup.sh script should have the following info :

————————————————-
#!/bin/sh

date=`date ‘+%m-%d-%y’`
mysqldump -u database_username -pdatabase_password database_name > ~/mysql_backup/database_name.$date
————————————————-

Run the script that performs the backup job.

————————————————-
* 23 * * * your_userid /path/to/backup/script
————————————————-

Set this script up to run every night, etc. as a cron job. It will save an sql dump of your database every night in the mysql_backup.

Facebook Comments

More Stuff

Emblematic Group and Mozilla Team Up to Showcase Next Generation o... Everything you share on the internet is a story. You read blog posts and watch videos that make you feel connected to people across the world. Virtual...
Latest Firefox Release is Faster than Ever With the introduction of the new Firefox Quantum browser in 2017 we changed the look, feel, and performance of our core product. Since then we have la...
Competing without a Marketing Budget: When All You Have is a Produ... This is a story about the power of a good landing page, PR efforts, and marketing strategy. The refreshing twist here is that instead of explaining ho...
The Ongoing Fiasco and Mysterious Afterlife of QuadrigaCX I’d say you were a little late to the cryptocurrency party if you haven’t heard about the ongoing catastrophe that’s been QuadrigaCX these past six ...
Spread the love

Posted by News Monkey