Mango's User Configurable Scheduled cPanel Full Backup

March 12th, 2013 Leave a comment Go to comments

Mango has always wanted to make it as easy as possible for users to make backups.  If you're a cPanel administrator, consider this script as part of your disaster recovery plan.  It will rsync a full backup anywhere the user likes, and allows the user to configure the location of the backup and how many backups will be retained.  Since its authorization is by RSA key, it does not require passwords to be stored in the configuration file.

Suggested use for users: By default, full backups are large and take a lot of server resources to create.  Why not exclude your home directory by placing a single * in cpbackup-exclude.conf, and rsync the full backup to your home directory?  Then rsync your home directory to your NAS device a few times per week.  Using rsync requires much less resources because it only copies files that have changed since the last rsync.

Here's the script:
  1. GJ
    May 2nd, 2013 at 07:22 | #1


    I am just wondering if you have a version of this script that is suitable for resellers with non root access. I would assume the only way around that would be to install a modified version of the script in each account that needs to be backed up. Do you offer such a script?

  2. May 8th, 2013 at 18:48 | #2

    Unfortunately my script requires root access.

    The only way I'm aware of to trigger a full backup, without having root access, is with the cPanel user interface.  It is possible to write a hack with cURL to automate this.  The problem is the user's cPanel password, or your reseller password, will need to be stored within the script, which presents a security risk.  Here is one such script - and it would be well worth your time to check out this excellent blog:

    Another option for you would be a semi-automated system.  You could enter your reseller password each time you wished to perform the backup.  The backup would happen automatically, but you would need to trigger it.  This would be more convenient than manually backing up each account, and secure.

    You may also be able to automate backups with WHM, though I'm not sure if you can do that without root access.  Give this a read and see if it works for you:

    Good luck,

  3. May 8th, 2013 at 18:48 | #3

    My reply above was not entirely accurate.  /scripts/pkgacct actually DOES run without root access.  However, some things did not work properly - most notably MySQL.

  4. james
    December 14th, 2014 at 12:51 | #4

    Its just not working!

    "Internal Server Error"

  5. December 14th, 2014 at 12:56 | #5

    With such a startling display of wit and intelligence, I genuinely hope you do not have root access to anything.

If you would like a reply to your comment, you must leave your email address! We receive dozens of questions every month from people who don't leave us with any way to contact them, so we have no choice but to ignore the question. We try to reply to as many questions as we can, if we know the email address of the person who asked the question. Thanks in advance for writing in :)

Allowed HTML: <b>, <i>, <em>, <strong>. All other < and > will be replaced with &lt; and &gt;.