Taking and restoring a full cPanel backup
After connecting to the server over SSH as root, you can take a full backup of every cPanel account with these commands:
cd /home/
for b in $(ls /var/cpanel/users); do /scripts/pkgacct $b;done
Restoring the backups
To restore the backups:
cd /home/
for r in $(ls | grep tar.gz | cut -d- -f2 | cut -d. -f1); do /scripts/restorepkg $r;done