Backup Full Reseller account WHM/cPanel

Question: (Copied From Cpanel forums)

I would like to backup only one #Reseller completely with all his accounts.
Answered: 
There is no way to do it via WHM unless you plan to update the list of users every-time they add a new one, but you can do so using SSH like so:

Code: 
for i in $(whmapi1 listaccts searchtype=owner search=RESELLERUSERNAME want=user |grep user: | awk '{print $2}') ; do /scripts/pkgacct $i ; done


You would just change RESELLERUSERNAME with the actual resellers username, any accounts owned by that reseller will get a full cPanel account backup created in /home/


You can also changes the location to where the backups get stored like so:

Code:
for i in $(whmapi1 listaccts searchtype=owner search=RESELLERUSERNAME want=user |grep user: | awk '{print $2}') ; do /scripts/pkgacct $i /backup ; done




If we want to take it one step further then I would actually create a folder with a date first otherwise the old backups will get overwritten:

currdate=$(date +%Y-%m-%d) ; mkdir -p /backup/"$currdate" ; for i in $(whmapi1 listaccts searchtype=owner search=RESELLERUSERNAME want=user |grep user: | awk '{print $2}') ; do /scripts/pkgacct $i /backup/"$currdate" ; done

Popular posts from this blog

Setup DHCP Server on Linux

Set Manually IP Address (Ubuntu 14.04) Desktop env.

Apache Server SSL Certificate Installation online thru www.sslforfree.com/