This is a simple script created from the cPanel process that generates full account backups, only in PHP form. This makes the task of backing up your site much easier and more reliable by allowing you to create and maintain your own full site backups.

$domain = "The domain name where cPanel is run, usually without the www's";

$skin = "cPanel skin that you are currently running, which will usually be 'x3' ";

The next section will set up the FTP options to upload the backup tarball to a server. If the FTP location is the same as the server the has the account you are backing up, leave these blank.

$ftpuser = "";// Username for your FTP site

$ftppass = "";// Password for your FTP site

$ftphost = "FTP hostname";// (usually ftp.yourdomainname.com)

$ftpmode = "The mode in which you would like to have the file transferred.";// We would recommend "passive" mode, especially for larger sites.

$notifyemail = "";// The email address that the backup confirmation should be sent to once the backup is complete

$secure = "";// Whether or not to allow the script to access your cPanel through its secure ports

$debug = "Whether or not to show the detailed backup results in your confirmation email";

3. Once the php file has been configured, upload it to your server. It is very important that you upload the file outside of your document root (public_html) with permissions of 600.

4. Now, all you need to do is set the crontab. Log into your cPanel and go to the "Cron Jobs" section and choose "Standard." Here is where you will create the actual cron job to run the script whenever you want. The command may vary depending on the setup of PHP on your server, but your Cron command will be as follows:

php -q /home/username/cpanel_backup.php

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)

The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.

How did you find this article?

Please tell us how we can improve this article:

Email Address

Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!