FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Cron Job to Backup MySQL Database





php_wizard_l33t
How would I use a cron job to backup my MySQL database(s)?

Please explain this would be helpful.
n0obie4life
Look. Instant support. This host is great eh?

Code:
mysqldump --add-drop-table -u <user> -p <pass> <dbname> > phpbb_sql_backup-$(date +1m1d1Y).sql
php_wizard_l33t
Yes you are so great.

I replaced the user, pass, and dbname with their real stuff and now I just gonna test and make sure its doing it. Oh and Im a little confused, was I supposed to also remove the < > marks when inputting the names?

Where is the .sql file saved to?
foggy
I'm not n0obie4life, but I think I can answer your questions.

First, yes, I believe that you should remove the <> characters in the cron job command.

And if I'm not mistaking, unless you specify otherwise the file will probably get saved to your root directory. Obviously, you can change this by editing the command as such:
Code:
mysqldump --add-drop-table -u <user> -p <pass> <dbname> > /mysqlbackups/phpbb_sql_backup-$(date +1m1d1Y).sql


I hope I can be so great too. Just joking. Rolling Eyes
php_wizard_l33t
Okay thank you.

Please close this topic.
Related topics
cron jobs
Cron Folder Backup
Mysql database problem
cron job
How to run a cron job on a server
Need help how to move a forum - Offer 100 frih$!!
PHPBB MYSQL Database Question.
MySQL database for a forum
Mysql database size?
Connect to MySql database
A very good PHP MySQL Tutorial
Cron job
Is there a better way to restore mysql database?
Easy script to backup mysql database, and can attached to ow
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.