|
|
 |
| |
Domain Check
| Is your domain available? |
|
Backing Up Your Databases
It is very important for all webmasters, regardless of the host they use, to keep recent backups of their website data. This is especially true if your website is dynamic and uses frequently updated databases. It is easy to dump your MySQL database data from phpMyAdmin, however it can be hard to remember to do so every week, or however often you wish to back it up. This tutorial will thus show you how to automatically back up your database every so often.
- First you will need to download the backup PHP script, available here. You will need a decompression utility to "unzip" this file and get the script; many free ones are available from download.com.
- Once you have the script saved to your hard drive, open it up in a text editor. There are several variables at the top of the script that you will need to define, such as your database login information, whether you want the backup file sent to your email address and/or uploaded to a remote FTP server, whether you want it gzipped, removed from the local server, etc. You can set these settings however you prefer.
- Upload the file to a directory on your website, such as http://yourdomain.com/backups. This is where the backup files will be stored, unless you set the script to remove them after sending.
- CHMOD (change permissions) on this directory to make it world writable, which is 777. This is so the script can write the backup file to the directory.
- Test the script to make sure it runs properly by calling it directly in your browser (e.g. http://yourdomain.com/backups/backup.php.
- Once you have the script running the way you want, you can set up a cron job via your CPanel which will run the script automatically every so often. Log into your CPanel at http://yourdomain.com/cpanel and click on the "Cron jobs" icon.
- Click on the "Standard" experience level button, which will bring up a simple to use web-based form for setting up your cron jobs.
- In the "Command to run" box, type in the following line: php /home/username/public_html/backups/backup.php
Change "username" to your account username, and edit the path to reflect the location of your script.
- Set the time you wish the job to run with the "Minute" and "Hour" boxes. It is best to run it at a time when the server will not be very busy, such as 3:00 am, so as not to cause overload, especially if your database size is large.
- Set the frequency with which you wish the job to run. To run it once a month, select a date from the "Day" box and leave the "Month" box set at "Every Month." To run it once a week, select a day from the "Weekday" box. Do not select one of the "Every X Minutes/Hours" options, as this may cause server overload, resulting in the suspension of your account. We recommend a weekly option.
- Click the "Save Crontab" button. That's it! Your script will now run by itself at the time and frequency you have set.
If you have any problems or questions, please don't hesitate to contact our technical support department. That's what they're there for!
|
|
copyright © 2000-2004 Imbri Web
|