Backup and CronTab

Technical support for webhosting Resellers, and questions which directly relate to their services.

Moderator: Admins

Post Reply
jprice
newbie
Posts: 5
Joined: Sun Aug 17, 2003 12:21 pm
Location: Tennessee
Contact:

Backup and CronTab

Post by jprice »

How can I set up CPanel to automaticaly make a backup using crontab?
Matt
Site Admin
Posts: 9
Joined: Wed Jul 03, 2002 11:07 pm
Location: Charlottesville, VA
Contact:

Post by Matt »

jprice,

Going through your CPanel access page you choose Cron jobs. Then "Standard". Then you choose how often you want to make the backup. We make weekly backups of every account, so my assumption is that you want a daily backup. Then choose what you want to back and input the command as so:

/bin/tar zcf ~/backup.tar.gz directory_to_backup directory2_to_backup file_i_want_as_well.html yet_another_directory_to_backup

This will create a backup.tar.gz file in your main directory that includes those 3 directories and the 1 html file. In your case, you probably only want:

/bin/tar zcf ~/backup.tar.gz public_html

That will backup your entire webpage to backup.tar.gz. You can then download this file through FTP. This backup.tar.gz file will be updated daily and overwrite itself. Be careful not to go over your quota by having 2 copies of everything on your webpage in your directory though. Always be sure to leave room for your backup.

-Matthew
matt@prioritycolo.com
jprice
newbie
Posts: 5
Joined: Sun Aug 17, 2003 12:21 pm
Location: Tennessee
Contact:

Post by jprice »

Thanks Matt
4dtv
newbie
Posts: 6
Joined: Sat Jan 24, 2004 8:34 pm

Database Backup

Post by 4dtv »

I have a related question about backups. Do you also perform the database backups weekly and is there an option to backup daily?
Matt
Site Admin
Posts: 9
Joined: Wed Jul 03, 2002 11:07 pm
Location: Charlottesville, VA
Contact:

Post by Matt »

The sql databases are backed up weekly along with your directories. Everything is placed together in one compressed file. We don't currently do daily backups because it puts an incredible load on the server and most customers don't have a need for a daily backup. If you want to backup your database daily that is easily accomplished with a crontab script that you can setup. The easiest way would be to set a crontab to dump your database at a given time and compress the resulting file. Then if you want to get advanced you can even set a crontab to mail that compressed file to an offsite e-mail address to ensure your database is completely safe.

Hopefully I've answered everything for you. If you have any other questions please let us know.

-Matthew
matt@prioritycolo.com
ZeroFill
newbie
Posts: 32
Joined: Wed May 28, 2003 1:59 am

Post by ZeroFill »

Here are some free scripts used with crontab that I like to use.

MySQL Backups - Full Backups
Files/Directory Backup - Incremental Backups
Post Reply