How to make full backups for all my cpanel accounts from SSH

madmanmachines

Well-Known Member
Nov 28, 2014
94
4
8
cPanel Access Level
Root Administrator
Try this:

for user in `ls /var/cpanel/users | grep -v "\."`;do /scripts/pkgacct $user;done

The backups will be created as cpmove files in the home directory.
While the above should work, parsing against `ls' output is bad form. Why not use the `/etc/trueuserdomains' file? As well, command substitution with backticks is only recommend for non-POSIX-compatible bourne-shells
BashFAQ/082 - Greg's Wiki