Re: TFTP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@remoteserver "/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@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux