Fixed: Cpanel Backup Script No Longer Working?

By Ralph Vugts on Dec 15, 2014

A few of our older clients sites relied on this Automated CPanel backup solution from http://cpanelbackupscript.com/ to automatically backup their sites to Amazon S3 storage. Unfortunately Cpanel has recently updated and this has caused the script to stop functioning.

The issue is the script is now getting the incorrect file location for the backup file from the Piped Email from Cpanel. (looks like they have added the temporary backup location as well as it's final resting place)

Fortunately this is an easy fix. With your favorite editor open up the cpb_s3.php file and edit line 32:

  $arr2 = explode('.tar.gz', $arr[1]);

and change it to:

  $arr2 = explode('.tar.gz', $arr[2]);

This grabs the final backup file location instead of the temporary location and then uploads it to Amazon S3.

Upload it back to your server and you are good to go. To quickly check to see if it's working change your CRON job trigger time to something in a few mintues time and with any luck your automated backups will be working again. Woohoo!

Ralph has been developing websites and systems for nearly 20 years. Passionate and curious, he’s an a-typical developer who understands how users interact with the systems he builds. He understands that systems need to be human-friendly. Ralph loves working in an industry that is constantly changing and disrupting itself.

Get in touch, We love to talk