  | |  | TFTP | TFTP 2004-02-07 - By Pete Nesbitt
Back On February 6, 2004 08:40 am, Christian Campbell wrote:
> I 'm currently TFTPing a file via a cron job to a RedHat 8.0 server. It
> seems the only way I can TFTP the file is to touch the file on the
> receiving server first. Not a big deal except that the file that is being
> sent has a different filename every time, so I must touch the file daily
> before it is sent that night. Is there any way to TFTP without having to
> touch the file on the receiving server first?
>
> Thanks,
>
> Christian
>
Hi Christian,
You could expand the script to use the new filename as a var and prior to tftp
use ssh remote command to touch the file.
For the record, if this was not mentioned in the thread, IIRC tftp does not
create a file, only overwrite an existing one.
try adding above the tftp in the script, something like:
cd <file_location >
/bin/ls -1 * > /tmp/FILE_NAME.txt
while read CP_FILE
do
/usr/bin/ssh user@(protected) "/pathto/ <yourscript > $CP_FILE "
done < /tmp/FILE_NAME.txt
#...your existing script continues
(may require some tweaking)
This of course would need to use key based authentication in order to run as a
cron job. I have some info on this at:
http://nesbitt.yi.org/howto.shtml
(SSH/SCP via Key Authentication)
Hope that helps.
--
Pete Nesbitt, rhce
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@(protected)?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
|
|
 |