Hi -
I'm trying to scp some files from one machine to multiple machines through
a crontab but am not having success. My crontab basically invokes a
bourne shell script. In my script I copy a file from machine1 to my machine
(machine0) and then copy it from my machine to other machines. Something
like this:
#!/bin/sh
scp -p machine1:/file1 ./file1
scp -p file1 machine2:/file1
scp -p file1 machine3:/file1
scp -p file1 machine4:/file1
...
I've been able to get it to work with scp1 (1.2.27) using .shosts, BUT
only by executing it on the command line. It just doesn't do anything
when I try to execute the script through a crontab.
There's been some posts in recently on using crontabs. I followed the
instructions and generated a null passphrase, putting it on the machine i
want to copy to, etc. I was able to scp this way also, but again only on
the command line.
Question, what am I missing? Can I not put it in a shell script? Do I
have to put the scp line in the crontab itself?
I would actually like to use scp2 instead of scp1 to do this. I did some
research a while back and it seems like we can't use shosts anymore in
ssh2? I can't quite remember where I read it and couldn't find it in the
archives. I think there was another way to do it without giving passwords.
If anyone can point me to the instructions, I would greatly appreciate it.
On a side note, when I use ssh2 (on unix machine) to connect to a host and
decide to Ctrl-C or Ctrl-D the connection at the password prompt, my
terminal starts scrolling tons of password prompts. I essentially have to
disconnect and reconnect. This only happens w/ ssh2. Is it suppose to do
that?
Thanks
--
Nancy