How to manually run Cpanel backup via ssh

A lot of hosting providers and even customers use Cpanel for virtual hosted websites.  Cpanel is a powerful management system that when installed takes over your whole server and and allows a normal user to easily administer and manage a linux server.

Backups are important to have on any server.  If you loose customer data more than likely you’re going to loose that customer, so always make sure you’re backup up your server.

The other day I enabled Cpanel backups for a customers server.  Configured everything and left the backup temp directory to /backup.  I assumed Cpanel wrote individual files int the temp directory before FTPing the file to their destination.  However that’s not the case, my customers root volume filled up because Cpanel was backuping up all files before transferring to the FTP server.

So I fixed the path to be on another drive that has as much free space available as there is data to backup.

I didn’t want to wait until tomorrow for it run again, so I wanted to force the backup to run on command line so I can monitor backups during the day and not have a drive fill up over night.

First thing you’ll want to do is ssh into your Cpanel server as root, then run one of the following commands.

Run Cpanel Backup Manually


If for some reason that says backup has completed, you’re able to force the backup to run by using

/usr/local/cpanel/bin/backup --force 

Run Legacy Cpanel Backup Manually


Additionally you can add the force argument to force the backup to run if it’s already run for that day.

/usr/local/cpanel/scripts/cpbackup --force

Your backup should now be running in the background.