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.

Replacing files in Multiple accounts?

Discussion in 'General Discussion' started by TitaniumHosting, Feb 20, 2005.

  1. TitaniumHosting

    TitaniumHosting Well-Known Member

    Joined:
    Dec 11, 2004
    Messages:
    157
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Ireland
    Hi.

    Is there a script that enables you to replace files on multiple accounts at the same time in WHM? I did a search and came up with nothing.
     
  2. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Not in WHM. One could be written, or if you have shell access and there aren't a lot to do, it would be easiest to just go in shell and copy.
     
  3. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    In SSH you could use a for loop to copy and replace. For example:

    (syntax may not be exact)
    for i in `ls -b /var/cpanel/users`;do 'cp file to /home/$i/filename';done

    Or to be very specific
    do
    locate filetoreplace >file.txt
    for i in `cat file.txt;do 'cp newfile $i';done

    That's one way of doing it. Please note those are examples and may not be 100% accurate.
     
  4. TitaniumHosting

    TitaniumHosting Well-Known Member

    Joined:
    Dec 11, 2004
    Messages:
    157
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Ireland
    Thanks guys. I will try those ideas. :)
     
Loading...

Share This Page