Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-28-2004, 07:58 PM   #1
LQ Newbie
Registered: Jul 2004
Posts: 3

Rep: Reputation: 0
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.


Old 07-28-2004, 08:12 PM   #2
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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

Old 07-28-2004, 08:31 PM   #3
LQ Newbie
Registered: Jul 2004
Posts: 3

Original Poster
Rep: Reputation: 0
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/

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


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

Phew! Did you catch all that?

Last edited by Pelargonium; 07-28-2004 at 08:34 PM.
Old 07-29-2004, 01:56 PM   #4
LQ Newbie
Registered: Jul 2004
Posts: 3

Original Poster
Rep: Reputation: 0
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!



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using BASH script to transfer a file via (s)ftp senther Linux - Newbie 2 07-19-2005 05:47 PM
incomplete installation - is this file important? Alfie67 SUSE / openSUSE 1 04-04-2005 06:20 AM
How can I write a shell script to transfer files and keep permissions? LancerNZ Linux - Wireless Networking 0 02-24-2005 01:19 AM
Recovering Incomplete PDF File. Claus Linux - Software 0 04-28-2004 06:43 PM
A way to script file transfer from Linux to windows? jkcunningham Linux - Networking 11 11-21-2002 08:58 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:08 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration