Automating Backups with Cron or API

Regular backups are essential for disaster recovery. You can automate backups through WHM’s native tools or via custom cron jobs.

WHM Backup Configuration

Navigate to Backup → Backup Configuration and enable automated backups. Set schedule, retention, and destination (local, S3, etc).

Using Cron for Custom Backups

Add a cron job like:

0 2 * * * /scripts/pkgacct username /home/backups

This creates a cPanel backup for username every night at 2 AM.

Remote Sync

Combine with rsync or rclone to push backups off-server for added safety.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Using UAPI and API Tokens in WHM/cPanel

cPanel's UAPI (Universal API) allows secure programmatic access to functions like creating email...