Here’s the full tutorial on creating automated cPanel backups. Use this form to generate a PHP backup script that creates a cPanel backup.

If you’d like the raw code instead of filling out the form below, visit the Github repo.

To enable automatic uploads of backups to an FTP server, fill out the FTP form fields. If you wish to disable the remote FTP upload feature, simply leave the FTP server field blank and your backups will be saved in your home directory on the cPanel server (the default location).

Your cPanel URL (?):
cPanel username:
cPanel password:
 
FTP Server:
FTP Username:
FTP Password:
FTP Port:
FTP Directory:

Result:

The source code for this script generator can be found on my Github. The PHP code is an upgraded/updated version of this original script from 2006.

Subscribe
Notify of

63 Comments
Inline Feedbacks
View all comments
Ricardo Cardoso
9 years ago

Perfect!
Thank you!

9 years ago

I seem to be running into an issue since migrating my server to PHP 5.6 – the following error occurs:

HTTP/1.1 301 Moved Server: cpsrvd/11.42.1.21 Connection: close Content-length: 120 Location: https://(URL):2083/ Content-type: text/html; charset=”utf-8″

Where (URL) is the cPanel URL for my hosted server.

If I revert back to PHP 5.5, the issue is cleared up. Any help on how to update this for 5.6?

Thank you for your help!

Sam
8 years ago
Reply to  Geoffrey

I am facing same issue. I can’t change the PHP version as I am on shared hosting.

Wiseprt
9 years ago

Hi there,

I tried your script but i got this error:
“Backup
Unable to Create Backup
Failed to upload a test file using FTP because of an error: 5781._USR_LOCAL_CPANEL_BIN_FTPPUT__.JWT8ff7EUFU7xNYZ.tmp: Permission denied .

Can you help me to solve the issue?

Best Regards

Brayden C.
9 years ago

I wasn’t able to access all music using spotify because of my location. But I signed up for arcvpn and can switch between regions to access all the music.

Jack
9 years ago

If I have a reseller account and want to create backups of my client’s cPanel information, do I need to have them place the backup.php file into their own home directory and create their own cron jobs, or is this something that can be controlled from the main level reseller cPanel?

Vanessa
9 years ago

Why would you encourage people to input their cPanel credentials into an un-encrypted, third-party web form?

Lee
9 years ago
Reply to  Vanessa

No one is making you put your real credentials in there. Put placeholders and then replace them in the code after you download it.

Irene
9 years ago
Reply to  Vanessa

Well! Use fake data and then change it

marcelo
9 years ago

can you include ‘notification’ in your script?

Alberto Ferro
9 years ago

Hello,

I have a reseller account, all my clients have their cpanel password and sometimes one of them change it, what I can do? the script will not work because the password is wrong.

How can I do to send an alert when the password is incorrect?