Fli
01-26-2017, 12:47 AM
How to backup cPanel account automatically (as a cronjob) to a remote FTP server or via SCP to remote server?
If you know free solution, please kindly share it.
In my case i tried this script and it works: https://www.hostliketoast.com/developer-channel/automatic-cpanel-web-hosting-backup-script/
It took me around 20 minutes to setup it
In the tutorial is mentioned that one can setup a cron job (repeated task) to run the backup regularly and automatically, in my case the command looks like this:
php -q http://mysite.com/backup579/perform_cpanel_fullbackup.php 1>/dev/null
i personally run it weekly
I found the script seems not to delete old backups, just create new ones, so it can cause too much disk space used, so i setup these cronjobs in my source cpanel and destination FTP server (also cpanel account) to delete *.tar.gz files (cpanel full backups) older 30 days:
find /home/mycpanelnamehere -mtime +30 -type f -name "*.tar.gz" -exec rm -f {} \;
and i run it weekly
If you know free solution, please kindly share it.
In my case i tried this script and it works: https://www.hostliketoast.com/developer-channel/automatic-cpanel-web-hosting-backup-script/
It took me around 20 minutes to setup it
In the tutorial is mentioned that one can setup a cron job (repeated task) to run the backup regularly and automatically, in my case the command looks like this:
php -q http://mysite.com/backup579/perform_cpanel_fullbackup.php 1>/dev/null
i personally run it weekly
I found the script seems not to delete old backups, just create new ones, so it can cause too much disk space used, so i setup these cronjobs in my source cpanel and destination FTP server (also cpanel account) to delete *.tar.gz files (cpanel full backups) older 30 days:
find /home/mycpanelnamehere -mtime +30 -type f -name "*.tar.gz" -exec rm -f {} \;
and i run it weekly