Skip to main content

Backup Full Reseller account

Comments

8 comments

  • Jcats
    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:
    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/
    0
  • furquan
    Hey Jcats, Man Thank you a bunch once again :) You are wonderful !
    0
  • Jcats
    You can also change the location to where the backups get stored like so:
    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
    0
  • furquan
    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,
    0
  • furquan
    Got It, I missed your last update. thank you for the clarification :)
    0
  • Jcats
    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
    ok Ill stop now :)
    and do the accounts get compressed all in one file ?

    No, each account would have its own compressed file.
    0
  • furquan
    You are the best !
    0
  • cPanelMichael
    Hello @furquan, I'm glad to see the information you were provided was helpful. I'm marking this thread as solved. Thanks!
    0

Please sign in to leave a comment.