Download PuTTY from http://www.chiark.greenend.org.uk/~sgtatham/putty/.
Log in to your web site's host using SSH and create a file called
dbsave
.Paste in the following code replacing
wpdbuser
andyourpassword
with your username and password, and wordpress with the name of your database.#! /bin/sh DATE=`date | tr " " _` echo $DATE mysqldump wordpress --add-drop-table -h localhost -u wpdbuser –p yourpassword | gzip > db.$DATE.gz tar cvfz code.$DATE.gz
Save the file. Then at the command prompt type
sh dbsave
. The script should create a.gz
file containing a backup of your database.At the command prompt, type
crontab –e
.At the end of the file, enter something like this:
0 0 1,15,29 0 0 sh dbsave
Tip
Cron Jobs and Crontab
Are you curious about that row of numbers? If you'd like to learn more about how to schedule jobs to run automatically, read up on the Unix command Crontab at http://www.adminschoice.com/docs/crontab.htm.
Cron jobs are used to schedule a job...