Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
vixie-cron fail to run, fail to send error
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
petterg
Guru
Guru


Joined: 25 Mar 2004
Posts: 500
Location: Oslo, Norway

PostPosted: Fri Mar 07, 2014 5:51 pm    Post subject: vixie-cron fail to run, fail to send error Reply with quote

I have a newly installed gentoo with vixie-cron where cron tasks is not running. I hope someone can help to figure out why.

The situation is that a backupscript is not being run. So I created a simple script for debug that outputs a timestamp to a file for testing. This file does not get created. (It does if I run the script manually.) Errors are probably reported in a mail to root@defaulthost.defaultdomain.
I can't figure out how to catch that mail and I can't figure out how to change that mail address.

Basically I need help to setup vixie-cron so that I can get access to the error messages.

Heres the crontab (edited using crontab -e):
Quote:

# cat /var/spool/cron/crontabs/root

# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.XXXXzcD1ix installed on Fri Mar 7 17:59:03 2014)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
02 11,13,15,18 * * 1-5 /backup/imalive


imalive is a simple script
Quote:

# cat /backup/imalive

!#/bin/bash
date >> /backup/imalive.log


the folder /backup has permission 777

I have a sign that the task is running:
Quote:

# tail -100 /var/log/messages |grep cron

Mar 7 18:02:01 localhost cron[5808]: (root) CMD (/backup/imalive)


And there is a sign that cron tries to tell me something went wrong:
Quote:

# mailq
....
2014-03-07 18:02:03 50073 bytes from <root@defaulthost.defaultdomain>
....



There are no files at the usual places to look for mail files:
/root/.maildir
/var/mail
/var/spooler/mail
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7134
Location: almost Mile High in the USA

PostPosted: Fri Mar 07, 2014 8:18 pm    Post subject: Re: vixie-cron fail to run, fail to send error Reply with quote

petterg wrote:
Quote:

# cat /backup/imalive

!#/bin/bash
date >> /backup/imalive.log



Just checking the obvious stuff here, it is #!/bin/bash and not !#/bin/bash in the file?

I've found that without sendmail or some mta installed, it won't deal with mail. Some of my machines dump a dead.letter in ~root ...
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
petterg
Guru
Guru


Joined: 25 Mar 2004
Posts: 500
Location: Oslo, Norway

PostPosted: Fri Mar 07, 2014 11:39 pm    Post subject: Reply with quote

This is embarrassing. You were spot on. Now backup runs as scheduled.

Anyway, what do I need to do to see the mails that cron will send in case of error?
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Sat Mar 08, 2014 2:56 pm    Post subject: Reply with quote

petterg wrote:
This is embarrassing. You were spot on. Now backup runs as scheduled.

Anyway, what do I need to do to see the mails that cron will send in case of error?


Set up a local mail handler, which is a real pain. I used to used smail, before it became
entirely obsolete, and now I use exim, which I've never bothered to configure properly.

Most people use POP or IMAP mail servers, and I suppose if you are constantly connected
to the internet that might be the way to go. Sendmail is the heavyweight answer, but it's
too rich for my blood.

Will
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7134
Location: almost Mile High in the USA

PostPosted: Sat Mar 08, 2014 4:12 pm    Post subject: Reply with quote

I just use sendmail. It works, even out of the Gentoo box.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
petterg
Guru
Guru


Joined: 25 Mar 2004
Posts: 500
Location: Oslo, Norway

PostPosted: Sun Mar 09, 2014 3:08 am    Post subject: Reply with quote

This is a virtual server that I try to keep as light weight as possible (without going to the extremes). Aren't there any way to see cron errors without setting up a smtp service? I see nullmailer is installed by default. Could it be useful in any way?
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Mon Mar 10, 2014 1:42 pm    Post subject: Reply with quote

petterg wrote:
This is a virtual server that I try to keep as light weight as possible (without going to the extremes). Aren't there any way to see cron errors without setting up a smtp service? I see nullmailer is installed by default. Could it be useful in any way?


AFAIK nullmailer just forwards stuff to a "real" mailer. I don't think it will handle mail itself. (If anyone knows of a lightweight SMTP MTA for local deliveries only, I'd be glad to hear of one.)

Will
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7134
Location: almost Mile High in the USA

PostPosted: Mon Mar 10, 2014 5:44 pm    Post subject: Reply with quote

I have full sendmail running on my virtual machine server as well as most of my full sized machines...

Supposedly ssmtp should be able to send mail to another machine instead of using a full MTA, but you still need some other machine that has a full MTA to deal with mail. Google pointed to

http://www.techrepublic.com/blog/it-security/use-ssmtp-to-send-e-mail-simply-and-securely/

I haven't tried using ssmtp, if someone wants to report back on how well it works, I might implement on my netbook...
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum