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

How to install and configure Apache2 for Webhosting on Linux (Ubuntu 14.04)

How to set Java Path if you want to put your java any directory in linux Computer

Make autoservice for Tomcat