Create an Automatic cPanel account Backup

Here we create a script which hepls to automatic backup of a cPanel account in user home directory and will be deleted the backup older than 3 days.

==
#!/bin/bash
tar -cvf /home/shimji/backups/wordpress_file_`date +%Y_%m_%d`.tar.gz /home/shimji/public_html
mysqldump wordpress > /home/shimji/backups/wordpress_db_`date +%Y_%m_%d`.sql
mkdir -p /home/shimji/backups/`date +%Y_%m_%d`
mv /home/shimji/backups/wordpress_file_`date +%Y_%m_%d`.tar.gz  /home/shimji/backups/`date +%Y_%m_%d`/
mv /home/shimji/backups/wordpress_db_`date +%Y_%m_%d`.sql /home/shimji/backups/`date +%Y_%m_%d`/
find /home/shimji/backups/ -type d -mtime +3 -exec rm {} \;
==

For more details : http://coolestguidesontheplanet.com/backup-website-cpanel-manual-automatically-script-cron/