This is a discussion on Problem with postalias and cron within the alt.comp.mail.postfix forums, part of the Mail Servers and Related category; Hi, I have a problem running postalias by a cron job. I use the following line: 20 0 * * * postalias /services/...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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? Thanks, Thomas |
|
|||
|
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? you probably need to put the full path to postalias in, or declare a path such as PATH=/bin;/usr/bin;/usr/local/bin;....etc etc at the top of the crontab as the default path of root crontabs is quite limited -- Martin |
|
|||
|
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 | |
![]() |
| Thread Tools | |
| Display Modes | |
|
|