SOLVED Backup Full Reseller account

furquan

Well-Known Member
Jul 27, 2002
473
4
168
Hello Everyone,

I hope this is the correct section to post in for this query !

I would like to backup ONLY ONE RESELLER completely with all his accounts,

Can somebody let me know is there is a way to do this via WHM or if there is handly
one line via CLI to do this.

Thank you for your time.
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
806
156
168
New Jersey
cPanel Access Level
DataCenter Provider
There is no way to do it via WHM unless you plan to update the list of users everytime 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/
 
  • Like
Reactions: cPanelMichael

furquan

Well-Known Member
Jul 27, 2002
473
4
168
Hey Jcats,

Man Thank you a bunch once again :)

You are wonderful !
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
806
156
168
New Jersey
cPanel Access Level
DataCenter Provider
You can also change 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
That would store all the backups in a folder called /backup - this might be handy if you have a backup drive mounted to the server
 

furquan

Well-Known Member
Jul 27, 2002
473
4
168
Is it possible to change the destination folder, and do the accounts get compressed all in one file ?

I just wanted to be clear before i commit one :)


Thank you,
 

furquan

Well-Known Member
Jul 27, 2002
473
4
168
Got It,

I missed your last update.

thank you for the clarification :)
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
806
156
168
New Jersey
cPanel Access Level
DataCenter Provider
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:

Code:
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
ok Ill stop now :)

and do the accounts get compressed all in one file ?
No, each account would have its own compressed file.
 

furquan

Well-Known Member
Jul 27, 2002
473
4
168
You are the best !
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,215
363
Hello @furquan,

I'm glad to see the information you were provided was helpful. I'm marking this thread as solved.

Thanks!