LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-28-2004, 07:58 PM   #1
Pelargonium
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.

Thanks,

Pelargonium
 
Old 07-28-2004, 08:12 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

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


Cheers,
Tink
 
Old 07-28-2004, 08:31 PM   #3
Pelargonium
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/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?

Last edited by Pelargonium; 07-28-2004 at 08:34 PM.
 
Old 07-29-2004, 01:56 PM   #4
Pelargonium
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!

Ciao!
 
  


Reply


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


All times are GMT -5. The time now is 12:35 PM.

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