LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ftping from a script file transfer incomplete (https://www.linuxquestions.org/questions/linux-newbie-8/ftping-from-a-script-file-transfer-incomplete-210808/)

Pelargonium 07-28-2004 06:58 PM

ftping from a script file transfer incomplete
 
I am putting a file using ftp from within a Korn shell script. The script runs fine from the command prompt but only part of the file transfers when it is run from crontab. Any help is greatly appreciated.

Thanks,

Pelargonium

Tinkster 07-28-2004 07:12 PM

Any consistency in the length of the transfered chunks,
how many bytes are you getting, what does the crontab-
entry look like?


Cheers,
Tink

Pelargonium 07-28-2004 07:31 PM

Howdy Tink. Thanks for the reply.

Yes, I am consistenly getting 1k of the file transferred. The crontab entry is:
18 16 * * * time -p /mypath/myscript.sh.

The script is running but the file gets chopped. The code within is script is:

#!/bin/ksh

echo "
user <username> <password>
bin
pass
hash
put <filename>.sh
" | ftp -i -v -n <hostname> >> <logfile on unix box> 2>&1


Phew! Did you catch all that?

Pelargonium 07-29-2004 12:56 PM

I found the problem. When you use crontab your environment variables change. Therefore you need to explicitly set the path for the file you are sending (putting). Otherwise it may use one in a different directory. Thanks for all the help!

Ciao!


All times are GMT -5. The time now is 05:33 PM.