Easy cPanel Backups
Backing up your website is something which everybody should do. But how can this be easily done? If your website is running on a cPanel powered hoster then you can do easy backups using the backup frontend of cPanel. If you want to do regular backups then it isn’t that easy anymore. That’s why I created a little shell script which helps you downloading the backup files to your local machine. The script is now available as open source on github.
To get the latest version of the script, execute the following command:
git clone https://github.com/code2k/cPanelBackup.git
Before you can use the script you have to configure it. The configuration is stored in a file in your homedir called .cpanelbackuprc. To create this file execute the following command:
./cPanelBackup.sh | tail -n +6 > cpanelbackuprc && mv cpanelbackuprc ~/.cpanelbackuprc
After that, just edit the generated file and adjust the values to your website environment. Then it’s time for a test run, so execute the script in the terminal:
If no error occurs you should end up with an archive containing your current website including your homedir, databases and email aliases. Congratulations!
To run the script daily just add the script to your crontab and your done.