Site Administration Manage Backups for WordPress Files and Databases |
You can read the first part of this series here (http://www.devshed.com/c/a/Administration/How-to-Back-Up-WordPress-Files-and-Databases/). Cron to Periodically Create WordPress Database Backups This section assumes you've already filled the wordpressmysqbackup.php with your WordPress MySQL database access information. It also assumes that you've already uploaded the wordpressmysqlbackup folder to the define path on your web server (the one defined by $full_serverpath_to_backup). The path of wordpressmysqlbackup is above the web root folder. The web root folder is where your WordPress files are installed, and can be accessed via web browser. Most hosting companies use "www," "html" and "public_html" as folder names for the web root folder. Below is a screen shot of the sample correct location of the wordpressmysqlbackup folder in the hosting server:
The next thing we need to do is let cron execute this PHP script so that the WordPress database backup will be created automatically. Cron is a hosting feature that you can use to automate the execution of tasks at specified time intervals (daily, weekly, monthly, etc). The following is a simple procedure (using Agilityhoster.com cron tabs, which might be similar to other hosting environments):
Example: /home/wordpressmysqlbackup/wordpressmysqlbackup.php It will then ask when to run the cron. If you need to run it weekly, simply set: Minutes: 00 Then click "Set Cron Job". It will then generate command such as: 0 0 7 * * /home/wordpressmysqlbackup/wordpressmysqlbackup.php It is beneficial for you to configure the cron to send you an email every time it successfully executes the script. You will know from the details in the email whether or not the backup was successfully created. For other hosting environments, such as Go Daddy, the method for setting up the cron is entirely different from the approach outlined above.
/web/cgi-bin/php5 "$HOME/wordpressmysqlbackup/wordpressmysqlbackup.php" In the example above, the path to WordPress index.php (which is under the HTML folder) is: $HOME/html/index.php Here is a screen shot (for a cron to run the WordPress database backup weekly):
blog comments powered by Disqus |
|
|
|
|
|
|
|