sunnysysadm
Technical User
I have a small script that follows that I need a little help on. The purpose of the script is to scp critical files from multiple servers to my Solaris workstation. The ssh keys are working properly and so I know that is not an issue.
Here is the script
--------------------
#!/usr/bin/ksh
SERVERS="server1 server2" <--have also tried catting file here that would contain the server names and that did not work either
files=`< /mydir/critfiles` <--contains /etc/passwd /etc/shadow and /etc/system
for x in ${SERVERS}
do
/usr/local/bin/scp $x:$files /mydir/${SERVERS}
/usr/local/bin/ssh $x "/usr/sbin/vxdisk list" >> /mydir/${SERVERS}/vxdisk_list
done
The directories /mydir/server1 and /mydir/server2 exist. The script seems to work fine when I use one server name, but when I begin using more than one server name it does not function.
Any suggestions would be appreciated.
Here is the script
--------------------
#!/usr/bin/ksh
SERVERS="server1 server2" <--have also tried catting file here that would contain the server names and that did not work either
files=`< /mydir/critfiles` <--contains /etc/passwd /etc/shadow and /etc/system
for x in ${SERVERS}
do
/usr/local/bin/scp $x:$files /mydir/${SERVERS}
/usr/local/bin/ssh $x "/usr/sbin/vxdisk list" >> /mydir/${SERVERS}/vxdisk_list
done
The directories /mydir/server1 and /mydir/server2 exist. The script seems to work fine when I use one server name, but when I begin using more than one server name it does not function.
Any suggestions would be appreciated.