Backing Up a MySQL Database Using a Cron Job in cPanel
This simple method allows you to automatically back up a MySQL database from any cPanel server using a cron job. Just update the placeholders with your actual details.
Cron Job Command
curl http://cPanelusername:password@domain.com:2082/getsqlbackup/DB.gz \
--output /home/username/DB.gz
Replace the placeholders:
cPanelusername– your cPanel usernamepassword– your cPanel passworddomain.com– your domain nameDB– the MySQL database name (e.g.,username_dbname)username– the Linux/cPanel account username
After the cron runs, the backed-up database file (DB.gz) will appear in the home directory of your hosting account.
You can access it via FTP or File Manager.