You are not logged in.

#1 2009-04-28 19:14:27

GregW
Member
From: 53°24'N 2°35'W
Registered: 2008-02-09
Posts: 56

[SOLVED] crontab wont email job output

Hi archers

I have the following in my users  crontab

MAILTO=myuser@my.externaldomain
00 20 * * * cd /home/user/Scripts ; ./Fetch-Updates

The job runs everyday at 20:00 and the job completes successfully every time. However, the job output is always mailed to user instead of the user at the external domain. The system is configured with exim as my smtp daemon and will email externally from the command line with mail so I cant see anything wrong with the configuration.

Any ideas?
Cheers
GregW

Last edited by GregW (2010-02-24 13:21:06)

Offline

#2 2009-04-28 20:21:30

GregW
Member
From: 53°24'N 2°35'W
Registered: 2008-02-09
Posts: 56

Re: [SOLVED] crontab wont email job output

OK, this is a bit strange. So Arch uses dcron.... wow, i'm kinda surprised by that. This explains why the environment variables are not supported. Ah well, its not the end of the world if I can get the log to an external email account. I'll live with it!

Offline

#3 2009-04-28 20:22:01

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: [SOLVED] crontab wont email job output

[redacted]

edit1: not sure what mail system dcron (cron) uses as default (and it may be a config option) but if it's using something designed only for internal system mails then you've got some more work to do.  maybe look into fcron, i know you can configure an smtp program (ssmtp or msmtp) and set fcron to use it for mails (you can probably do that for dcron too though), then you'd be good to go.

either way, good luck

edit2 i see you've found some info... try my edit1 suggestion, fcron ftw!

Last edited by brisbin33 (2009-04-28 20:27:22)

Offline

#4 2009-04-29 00:07:36

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: [SOLVED] crontab wont email job output

0 20 * * * /home/user/Scripts/Fetch-Updates | mail -s 'Cron Output' you@domain.com

Offline

Board footer

Powered by FluxBB