Setting up a Cron Job on GoDaddy
Set up GoDaddy Cron Job
- Log Into your GoDaddy.com account.
- Choose “My Hosting Account” from the “Hosting & Servers” menu on the top navigation bar.
- In the Hosting Account list, click the Open link beside the account you want to use for your website.
- In the Hosting Manager window, click the Cron Manager icon or “Cron Manager” menu item under content menu.
- Now you are on the page where you need to setup two cron jobs: one to run daily for the daily backups and one to run monthly for the monthly backups. The monthly one can run on any date of the month, just as long as the time it runs at is after the daily backup run.
- You need to know the following:
- Host Name: (Usually localhost but in case of godaddy account it will be look like mysql123.secureserver.net)
- Database Name: Name of the your database.
- User Name: User name of the database. In case of godaddy account it will be same as db name.
- DB Password: Database user password for authentication.
- Use the various drop downs to schedule your Cron job and enter the Cron Command Line you have created.
The command line should be something like:
mysqldump –opt -Q -h (hostname) –user=(user-name) –password=(password) (database-name) > (full path of backup file)
For example if you did daily backups and wanted to keep one month’s worth (after 1 month it would be overwritten):
mysqldump –opt -Q -h some.thing.com –user=mywebdb –password=thePassword mywebdb > /home/content/b/a/b/babychep/html/backups/bak_`date +%d`.sql