The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SOLVED Backup Full Reseller account

Discussion in 'Data Protection' started by furquan, Jul 6, 2017.

Tags:
  1. furquan

    furquan Well-Known Member

    Joined:
    Jul 27, 2002
    Messages:
    461
    Likes Received:
    3
    Trophy Points:
    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.
     
  2. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    588
    Likes Received:
    88
    Trophy Points:
    153
    Location:
    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/
     
    cPanelMichael likes this.
  3. furquan

    furquan Well-Known Member

    Joined:
    Jul 27, 2002
    Messages:
    461
    Likes Received:
    3
    Trophy Points:
    168
    Hey Jcats,

    Man Thank you a bunch once again :)

    You are wonderful !
     
  4. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    588
    Likes Received:
    88
    Trophy Points:
    153
    Location:
    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
     
  5. furquan

    furquan Well-Known Member

    Joined:
    Jul 27, 2002
    Messages:
    461
    Likes Received:
    3
    Trophy Points:
    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,
     
  6. furquan

    furquan Well-Known Member

    Joined:
    Jul 27, 2002
    Messages:
    461
    Likes Received:
    3
    Trophy Points:
    168
    Got It,

    I missed your last update.

    thank you for the clarification :)
     
  7. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    588
    Likes Received:
    88
    Trophy Points:
    153
    Location:
    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 :)

    No, each account would have its own compressed file.
     
  8. furquan

    furquan Well-Known Member

    Joined:
    Jul 27, 2002
    Messages:
    461
    Likes Received:
    3
    Trophy Points:
    168
    You are the best !
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello @furquan,

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

    Thanks!
     
Loading...

Share This Page