Work From Home |
|
BACKUP YOUR WEBSITEUsing cPanel and Cron JobsDon't be one of the unfortunate statistics and horror stories. You’ve heard it a million times. BACKUP YOUR DATA! If you work from home then it's probably up to you and no one else to take precautionary measures and provide your own work at home insurance - backups are your insurance.
The question is, are you backing up?? If you are not, you really really do need to be doing so.
Again, let me repeat, you really need to be backing up your website.
For those with cPanel running as the administrative tool, you can easily backup your website (files and databases) with cPanel. Here’s how:
If you cPanel looks different from above don’t panic. Some web hosts setup cpanel differently. Here is an example:
The backup file will be created on your home root directory. It will be a tar.gz file. This file can then be FTPed off your server to a local drive or CD (or both!) for safe keeping. I recommended doing this weekly at the LEAST.
You will have noticed during this process something stating the following (or something similar):
While this is a true statement keep in mind the following:
What you can do is automate this a little. Set up a cron job using the following example: date=`date -I` ; tar -zcf yourbackup_$date.tar.gz ./public_html This will backup everything in your Public_html directory - the most frequently altered and accessed part of your web system. It will create a file that looks likes yourbackup_2007-09-23.tar.gz in the home directory, the directory above public_html. You can of course choose any directory to backup. All you need to do is edit the line above. Next set this to run as a cron at a frequency compatable with your web modification/addition schedule and you have a handlable file to FTP to another secure location regularly as a safeguard. There are scripts that can automatically send a copy of the file to you by email, but it depends on the size of the file generated as to whether this in reality is feasable. If you have a remote server for yor web site and a home computer that you don't leave running constantly then a manual FTP of the automated backup file each week is a small price to pay for this insurance. If you are up-loading web pages it takes little extra effort to download the already made backup file through FTP. After all it's already made for you! After a while you will end up with a number of old and probably useless files in yor home directory. To keep this under control use the following example: find yourbackup* -mtime +30 -exec rm -r {} \; This
little cron script will delete all files starting with the
term yourbackup that are over 30 days old. Edit to whatever is
applicable ie. 7 for 7 days, 14 for a fortnight etc.
To
restore you can also use cron jobs by invoking the folowing
command:
tar -zxvpf
yourbackup.tar.gz --directory /home/test/
This command restores the file 'test.backup.tar.gz' into the
directory '/home/test/'.
Please beware when executing this command! Any existing file that
also exist in the archive will be overwritten.
tar -ztvpf yourbackup.tar.gz | grep "checkforthisfile"
Above all else - BACKUP!
|
|
|
Copyright 2007 domain.e-pond.info. All Rights Reserved |
|
Privacy Policy: Your privacy is important to us. No personal information is recorded in the use of this site.
|