AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
  • 1.  copy a file on several servers

    Posted Mon August 27, 2007 11:38 AM

    Originally posted by: SystemAdmin


    Hello folks,

    How can I copy a file from one server to several servers automaticly.

    I want to do something like this...
    name = /home/xxx/A.sh

    ssh remote_server
    cp $name remote_server/my_home directory

    thanks


  • 2.  Re: copy a file on several servers

    Posted Mon August 27, 2007 12:00 PM

    Originally posted by: orphy


    Here's one way to do it.

    ========================
    name=/home/xxx/A.sh
    rmtsvr="host1 host2 host3 host4 etc etc etc"
    for box in $rmtsvr
    do
    ssh $box
    scp -p $name $box:/.../my_home
    done
    ========================

    If you want to automate this at a regular interval, put this in a script
    and try using cron.
    Orphy


  • 3.  Re: copy a file on several servers

    Posted Mon August 27, 2007 01:20 PM

    Originally posted by: SystemAdmin


    Thanks Orphy...I hope one day I get as good as you guys :)