Server Maintenance

Killing cPanel Backups via Command Line / Shell

Updated November 2026 20,558 views 3 min read
Server Maintenance | Updated November 2026

When a cPanel backup process hangs or runs too long, it can consume significant disk I/O and CPU, impacting server performance. This guide shows how to identify and kill stuck backup processes from the command line.

Quick Kill
# Find backup PIDs
ps aux | grep -E '(cpbackup|backup|pkgacct)' | grep -v grep

# Kill all backup processes
killall cpbackup 2>/dev/null
kill $(pgrep -f pkgacct) 2>/dev/null

01. Identify Running Backup Processes

cPanel backups involve several processes. Check for all of them:

# cPanel backup daemon
ps aux | grep cpbackup | grep -v grep

# Individual account packaging
ps aux | grep pkgacct | grep -v grep

# Compression processes (often the bottleneck)
ps aux | grep -E '(gzip|pigz|bzip2)' | grep -v grep

# MySQL dumps
ps aux | grep mysqldump | grep -v grep

Check how long the backup has been running:

ps -eo pid,etime,cmd | grep -E '(cpbackup|pkgacct)' | grep -v grep
Check Backup Logs

Before killing, check what account is being backed up:

tail -20 /usr/local/cpanel/logs/cpbackup/*

02. Kill the Backup Process

Kill in this order to clean up properly:

  1. Kill child processes first (mysqldump, gzip, tar):
    kill $(pgrep -f pkgacct)
    kill $(pgrep -f "mysqldump.*--routines")
  2. Kill the parent backup process:
    killall cpbackup
  3. If processes refuse to die, use SIGKILL:
    kill -9 $(pgrep -f cpbackup)
    kill -9 $(pgrep -f pkgacct)
  4. Verify everything is stopped:
    ps aux | grep -E '(cpbackup|pkgacct|mysqldump)' | grep -v grep
SIGKILL as Last Resort

kill -9 does not allow the process to clean up. It can leave lock files, partial tar archives, and orphaned MySQL connections. Always try a normal kill first and wait 30 seconds before escalating to -9.

03. Clean Up Partial Backups

# Remove partial backup files (check the backup destination first)
ls -lh /backup/*/accounts/
# Delete any .tar.gz files with today's date that are incomplete

# Remove lock files
rm -f /var/cpanel/backups/*.lock

# Check disk space recovered
df -h /backup

04. Preventing Stuck Backups

  • Exclude large accounts - in WHM > Backup Configuration, exclude accounts with large mailboxes or file stores that regularly time out
  • Stagger backup times - do not run all backups at once. Use incremental backups where possible
  • Check disk space before backup runs. A full backup partition causes hangs:
    df -h /backup
  • Set backup timeout - configure maximum backup time in WHM to auto-kill hung processes
  • Monitor backup completion - check /usr/local/cpanel/logs/cpbackup/ for failures

Need Help With Backup Configuration?

If backups are consistently failing or causing performance issues, our team can help optimize your backup strategy.

Open a Support Ticket

Frequently Asked Questions

How do I find a stuck cPanel backup process?

As root, list running backup processes with ps, for example ps aux piped to grep for cpbackup or pkgacct, to see the process IDs and how long they have run. High disk I/O or CPU from these processes is the sign a backup has hung.

How do I kill a hung cPanel backup?

Once you have the process ID, stop it with kill, and if it does not exit use kill -9 as a last resort. Kill the parent cpbackup process so its children stop too. This requires root access on a VPS or dedicated server.

Is it safe to kill a running backup?

Yes, but the backup will be incomplete, so clean up any partial backup files it left behind and let the next scheduled backup run cleanly. Killing a stuck backup is safe for your live site and data; it only abandons the in-progress archive.

How do I stop cPanel backups from hanging in the future?

Schedule backups during low-traffic hours, exclude very large or unnecessary directories, and make sure the destination has enough free space. Most stuck backups come from disk space running out or an enormous account being archived during peak load.

Quick Recap

  1. Find processes: ps aux | grep cpbackup
  2. Kill children first: pkgacct, mysqldump, gzip
  3. Kill parent: killall cpbackup
  4. Clean up: remove partial archives and lock files
  5. Prevent: exclude large accounts, check disk space, stagger schedules

19,065 users found this article useful · Last updated November 2026 · Browse all Server Maintenance articles

Share: X in Reddit f Email
  • 134 Users Found This Useful

Was this answer helpful?

Related Articles

VPS Time Not Correct with Time Server

Server Maintenance | Updated March 2026 When a VPS or dedicated server's system clock drifts...

Create CXS Quarantine Directory

Server Maintenance | Updated January 2026 ConfigServer eXploit Scanner (CXS) quarantines...

How to Lock Down Your VPS or Dedicated Server Behind Cloudflare

Server Maintenance | Updated October 2026 Cloudflare can only filter the traffic that...

cPanel Max Defers Occurring for an Account

Server Maintenance | Updated November 2026 When cPanel reports max defers occurring for an...

ModSecurity: collection_store: Failed to access DBM file /var/cpanel/secdatadir/ip: Permission denied

Server Maintenance | Updated November 2026 The error collection_store: Failed to access DBM...



Save 30% on web hosting - Use coupon code Hosting30