A script for downloading a backup of your cPanel hosted website.
To setup the backup script create a configuration file named .cpanelbackuprc in your home directory. You can create a skeleton by executing the following command:
./cPanelBackup.sh | tail -n +6 > cpanelbackuprc && mv cpanelbackuprc ~/.cpanelbackuprc
Edit the created configuration and change the values according to your environment.
Your cPanel username.
Your cPanel password.
URL of the cPanel site (e.g. http://domain.com:2082)
Path to the backup location. If the directory does not exists it will be created.
prefix for your backup files (e.g. domainname).
Name of the GNU sed excecutable. This should be sed on the most systems. On Mac homebrew change to gsed.
Number of days to keep old backups.