Backup MySQL Database From Cron

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 username
  • password – your cPanel password
  • domain.com – your domain name
  • DB – 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.

Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 16934

Need more information or have a question ?