Re: Problem with postalias and cron
Thomas Anders wrote:
> Hi,
> I have a problem running postalias by a cron job. I use the following
> line:
>
> 20 0 * * * postalias /services/spammail
>
> Where spammail is a file with the anti-spam email-adresses generated
> daily. My problem is, that the command has no effect. When I set
>
> 20 0 * * * touch /test.txt
>
> instead, I have a file test.txt the next morning, so I think cron is
> working correctly.
>
> Is any problem running postalias from cron known?
>
If a command writes anything to stdout or stderr (and this usually
happens if it fails) that should be mailed to root. Have you checked in
root's mailbox?
Another useful (though not foolproof) test is to become the relevant
crond user, cd into the directory where the cron job is kept and run it
manually. Usually this will smoke out quite a bit of cruft, such as not
using absolute names for programs & scripts. From the example you give
this is your problem: touch is in /bin while postalias is in /usr/sbin
which, IIRC, isn't in the default PATH for root, crond runs as root on
my system.
HTH
--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
|