On 2015-12-09, John McGrail <
[email protected]> wrote:
In comp.unix.bsd.openbsd.misc, you wrote:
I have installed 5.8 on to laptop and added fetchmail.
When I invoke fetchmail from the command line it just works, no hassle.
When I put it into a crontab, in my name as /usr/local/bin/fetchmail
it complains that there are no mailservers have been specified.
When I add -f /home/martin/.fetchmailrc it tells me:
/var/log/.fetchmail.pid Permission denied, obviously I dont have
From the man page (man fetchmail):
...
~/.fetchmail.pid
lock file to help prevent concurrent runs (non-root mode).
...
/var/run/fetchmail.pid
lock file to help prevent concurrent runs (root mode, Linux systems)
I find it a little odd that your pid file ended up in /var/log/.fetchmail.pid.
That aside, I'd guess that your cron job is not running as you. Are you explicitely setting the user field in the crontab entry to _you_?
Another thought -- cron tends to run with a very restricted
"PATH" environment variable. So any scripts either need to set the PATH
at the start, or include the full path to anything outside of what the
current PATH used by cron is. Running "strings `which cron` | grep PATH"
gives this:
====================================================================== PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/local/bin
PATH
PATH=
======================================================================
on a 5.5 system.
Anything out of the PATH which you find on your 5.8 system will
not be found unless you do one of the two work-arounds above. I tend to
prefer the explicit path for each command in something like:
GREP=/usr/bin/grep
and invoke it as:
${GREP}
except that GREP is where it will be found anyway. But check everything invoked from scripts involved.
Good Luck,
DoN.
--
Remove oil spill source from e-mail
Email: <
[email protected]> | (KV4PH) Voice (all times): (703) 938-4564
(too) near Washington D.C. |
http://www.d-and-d.com/dnichols/DoN.html
--- Black Holes are where God is dividing by zero ---
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)