Click to See Complete Forum and Search --> : Sending files from server to clients
potatohead
11-29-2001, 02:33 PM
Hi,
I'm a linux admin at a high school. I need to send a file to every linux machine (60 computers) from the server. Can I do that without knowing the ip? The reason is cuz all the computers use DHCP to get the ips from the school board. Therefore, everytime a computer restarts, the ip changes. I was thinking i may have to write a script to do that... but i do not know how. Anyone knows?
bdw72
11-29-2001, 04:28 PM
There is no easy way to do this with the IP changing everytime the systems boot. Another possible consideration ( a very labor intensive one ) is to create a script on each system to rcp a file(s) from the server to the workstations and run it using cron. If there are no files in that particular dir, then no file get copied to the local workstation. Do you use DNS?
Malakin
11-29-2001, 05:34 PM
There must be a way to attempt to send the file to every ip currently leased...
potatohead
11-30-2001, 02:35 PM
Yes... we use DNS. I still don't know howta write the script. How to i incorporate rcp in the script? How does it know which machines to send to without knowing the ip?? Is there a way to find out what ips the workstations are currently using?
bdw72
11-30-2001, 03:28 PM
Do you know the host names of the clients and can you ping using the host name. If you can do this, then you can initiate the transfer from the server. I am not a very good script writer, but a script is just a bunch of commands, that you would normally type on the command line, but instead group all the command into a script. If you can ping by host name, then create a file with just the names of your clients in it. Then on the command line start you script. IE "for x in `cat hostfile` <hit enter>
do <hit enter>
rcp /tmp/filename $x:/pathname <hit enter>
done <hit enter>