Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Ask about .sh file

Discussion in 'General Discussion' started by hanliong, Feb 8, 2010.

  1. hanliong

    hanliong Member

    Nov 27, 2007
    Likes Received:
    Trophy Points:

    I have a .sh file to packing all user in my vps.
    The script is like below:


    ls -A /var/cpanel/users/ > users
    for account in `cat users`
    echo "***************************"
    echo "** chowning $account **"
    echo "***************************"
    echo ""

    /scripts/pkgacct.bak $account ; mv /home/cpmove-$account.tar.gz /home/home_other/backup/ ; rm -rf /home/cpmove-$account.tar.gz

    echo "***************************"
    echo "*** $account Completed ***"
    echo "***************************"
    echo ""

    With that script, it will pkgacct all user in my cpanel.
    but, if there's a user with name A-Z, i want to backup all, but 1 user not backup. So, the script must run to backup all user except 1 user (backup user_1 to user_9 and ignore user_10). How can do that?

    The other question, how to backup only selected user? So, i can backup only user_1, user_3, user_4, etc.

    I have tried to search at search engine, but i cant find the answer.
    Please help me.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice