I wrote a little script which is supposed to dial into the internet, get +
send my mail and log out again For this, I created the following entry in
30 7-23/3 * * * root /usr/local/bin/mailXchange > /var/log/fetchmail.log
When this script is started by crond, it is all done (almost) at the same
time: dialin, fetchmail, sendmal, terminate session.
When I start this script by command line, it is working well, e.g. it does
not terminate the session before finishing fetchmail + sendmail.
It seems that crond puts a "&" at the end of every line in that script.
Here is the script:
/etc/sysconfig/network-scripts/net_cnx_up > /dev/null
sleep 2 # this line is necessary, because fetchmail would start
# before dialing is complete
sendmail -q -v
/etc/sysconfig/network-scripts/net_cnx_down > /dev/null
Any idea how to get this script working right with cron?
Thanks a lot!