Updated: WHM / cPanel Reseller Backup Script – Now Deletes Old Backups

by Paul on January 25, 2013

cPanel Backup Script DownloadOur WHM/cPanel Reseller backup script has proven very popular.

While this script is pretty kick-ass, it was lacking one important feature.

This is our #1 most requested feature and there’s a reason it hasn’t been included until now.

Today we’re releasing an all-new version of the script that supports this much-needed feature.

And what’s this fantastic new WHM / cPanel backup feature…?

We need a WHM/cPanel Backup Script that Deletes Old Backups!

If I’ve heard this request once, I’ve heard it a thousand times.

But there’s a reason it wasn’t put into the original script.

Originally, we wanted a solution that was reliable, and the cPanel API is both mature and very reliable.

For this reason, the original program was written to use as much of the cPanel API as possible, and this meant it was ultimately restricted to what was in the API.

cPanel doesn’t include the ability to remove old backups, so in effect, neither did our automated solution.

Writing code that automatically parses FTP responses and the data it returns for file dates is a little complex… so, writing the solution to this was also going to be difficult.

We have been able to take advantage of some of the cool backup technology we’ve built in our new WordPress Backup system for multiple WordPress sites, called WorpDrive.

We extracted out some of our code that handles this FTP data and incorporated it into this new version of the WHM/cPanel Reseller backup script.

How does deleting old cPanel backups work?

We have provided the option to let you to delete backups on a remote FTP space, based on the number of days you specify.

So for example, if you specify 7 as the age for old backups, this script will connect to your remote FTP space that you specified for remote cPanel backups, find all the .ZIP files in that folder and query their last modified dates.

In this example, it will compare these file dates to the date in time 7 days before the instant the backup script is running.

If it finds any .zip files that are older than this date, the files will be immediately deleted.

This script does not discriminate files. If you are storing other files in this folder and they are older than the specified date they will also be deleted.

What other features are in this WHM/cPanel backup script?

The improvements made to this backup script are many:

  • ‘Dummy Mode’ – when enabled (turned on by default) the script will process exactly as normal, but will neither perform the backups, nor delete any old files. Instead it will just print a log of what it would do. This is perfect for testing your configuration and seeing that it works exactly as expected.
  • Supports the latest version of cPanel/WHM (v11.34 at the time of writing) with API access enabled.
  • Supports use of both secure and non-secure WHM/cPanel access using ports that you specify. You are responsible for ensuring any SSL implementation on you cPanel is working if you decide to use a secure connection.
  • Support for custom log files, or to print to STDOUT. You can chose which, and where.
  • Supports the use of domain filtering per backup run.
  • Domains that are backed-up may be filtered by an explicit list of domains, e.g. abc.com, xyz.net
  • Domains may be filtered by a regular expression. (advanced)
  • Backup files may be copied as per cPanel API options: Passive FTP, Active FTP, Secure SCP, or copying to your home directory for each domain.
  • Full support for specifying the remote FTP connection details if you chose FTP in the previous option.
  • You can specify an email address which will receive notifications of completed backups.
  • The option to automatically delete old files from FTP (see restrictions below)

What restrictions does this WHM/cPanel backup script have?

Depending on either development complexity, or cPanel API limitations, the following restrictions are in-place and should be carefully considered when deciding to purchase this script:

  • Not Supported: Secure FTP or FTPS/FTPES backup copy options. Why? They’re not supported in the cPanel API that performs the backup.
  • Not Supported: The option to delete old backup files when SCP was your copy method. This has yet to be developed, but may be added in a future release.
  • Not Supported: The option to delete old backup files when ‘homedir’ was your copy method. This has yet to be developed, but may be added in a future release.
  • Not Supported: Deleting old backup files from an FTP location other than that used to remotely backup the files in the first place.
  • Not Supported: Working around your firewalls, PHP environment, security restrictions etc. As with the 1st version of this script, a pre-requisite to purchasing this script is that you have downloaded, configured, and successfully completed a backup using the free version of our cPanel Backup script.
  • Not Supported: Copying files to Amazon S3, Dropbox, or Google etc. Why? This isn’t directly supported by the cPanel API. An alternative option for this is to use an automatic copy service such as FTP2Cloud where you FTP your backups here, and they copy it to your cloud storage account.
  • Not Supported: Future proof against cPanel / WHM updates that suddenly break the script. We use these scripts ourselves, though we rely more on WorpDrive to maintain our WordPress backups. If the script stops working, we’ll probably fix it. But this line is here so that you are aware that the license is not an ongoing license.  Updates and changes are made to the script and released solely at our discretion. We may charge for future updates, or we may not. Or both. It’s our call.

If none of these restrictions poses a problem for you, then this script is perfect for you.

Add To Cart

Use the form below to join our Developer Channel

Do you need an automated CPanel web hosting backup script? There is that and more in the Developer Channel

{ 1 comment… read it below or add one }

Christina A. Huffman July 7, 2013 at 3:49 pm

Really Good script, But i just want one more option to upload only the changed files and newly created zip folder, bcoz its start uploading all the files the one already uploaded.

Reply

Leave a Comment

Previous post:

Next post: