Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

looking for help with Automated FTP problem

Status
Not open for further replies.

gamesman

Programmer
Oct 8, 2001
223
US
Hoping someone can help or at least suggest probable directions for research.

I have an FTP process that when run manually runs correctly, but when jobbed off from a program that is executed from cron fails without error.

my /netrc is:

ftp fserv user password
macdef init
lcd user2
type binary
prompt off
cd chci
mput *.chci
bye
<<Blank line>>

fserv is if course set up in the host file.
I'm wondering if it may have something to do with the standard verbose messages. Also the job that runs off cron completes normally. It's job is to create the files. Then it calls the program that includes the FTP procedure. everything works but the FTP.

If I start it manually everything works fine. This is getting really frustating as I can't begin to imagine what difference may be when FTP runs in the background.

Any help would be appreciated. Gamesman
jhughes@barbhosp.com
MT(ASCP), MCP, CIW, CNA
 
Sorry forgot to add running AIX 4.2 on rs6000 Gamesman
jhughes@barbhosp.com
MT(ASCP), MCP, CIW, CNA
 
Why don't you try like the following. Write a script and call it by cron.

ftp -i -n fserv << END
quote user raj
quote pass raj123
lcd user2
bin
cd chci
mput *.chci
bye
END



Note :
1. at raj123 you have to give the real password.
2. use absoulte path name at cd & lcd. Ex: lcd /home/user2

Try. best of luck.

- Rajarajan.



 
Thanks. That's what I ended up doing before I saw your post. Now I've got two jobs that run off cron. One to create the files and then one to call the ftp to move them. That works but I'd still really like to know why the darn FTP wouldn't run when jobbed off from the first process while running in the background, but would when running manually.

Very annoying. Gamesman
jhughes@barbhosp.com
MT(ASCP), MCP, CIW, CNA
 
Perhaps a delay was needed. I have seen that sort of problem when using `tail -f` on a file that I created in a prior command when I only separated the two with a semicolon, like so:

/usr/local/makealogfile.ksh;tail -f /tmp/thatlogfile.txt

It works if I just wait a second or two before running tail. In my case I really should have used tee. IBM Certified -- AIX 4.3 Obfuscation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top