I'm trying to write a shell script that do ftp and download file periodically, this script should be called by a daemon running in the background.

the shell script "script.sh" is as follows: yafc [url]ftp://test:test@[/url] < commands and the "commands" files is

d Root/md5* /

if I run script.sh it will work just fine.
But when the daemon software calls the "script.sh", the script will send ftp login request to the ftp server, but will not even answer the username or anything.

I believe it is something about child process redirection, but I don't know how to deal with it.

This problem is not only with yafc, it is the same with any ftp client or any application like telnet and so.

can you help?
Thanks !

Recommended Answers

All 2 Replies

Interesting, Thanks for the help, I'll try it.
so far I found that the daemon closes all stdin stdout stderr before it makes the call to the shell script.
after openning the std I/O, it worked fine, on drawback is that I can see all the messages no the console screen.
I hope this will not be buffered after I log out from telnet.

Thanks for the help again !

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.