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.

Ask about .sh file

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

  1. hanliong

    hanliong Member

    Joined:
    Nov 27, 2007
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

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

    #!/bin/sh

    ls -A /var/cpanel/users/ > users
    for account in `cat users`
    do
    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 ""
    done

    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.
    thanks.
     
Loading...

Share This Page