Page 1 of 1

cron strangeness

Posted: Thu Oct 21, 2010 5:11 am
by rgmhtt
I 'detected' some strangeness with cron because I am not getting any emails to root of cron jobs, yet /var/log/cron is updated hourly with info that cron jobs are executing.

So I finally google a bit to get some tutorial on cron and find to look at /etc/crontab and lo and behold it is empty!:

# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * command to be executed

So I go over and look at an older Amahi book (my email server that I have not really touched for 1/2 a year):

# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

So obviously some differences. :)

How is cron running right now and how do I get email reports? I have added an alias for root to an email account.

Re: cron strangeness

Posted: Mon Oct 25, 2010 8:15 am
by surfrock66
I have never been able to get a cronjob to run correctly on my Amahi box. Neither as root or as a user.

I have a script that resets the permissions on my transmission downloads, and I'd love it to go every 15 minutes. I eventually compromised on a desktop launcher, but still.

Re: cron strangeness

Posted: Mon Oct 25, 2010 8:29 am
by bigfoot65
I have cron jobs set and running on my box. Recommend you try using the apache crontab. I have some there and in root. Also, ensure the cronie (I think) RPM is installed. All appear to be working fine. I also use Webmin to change them versus CLI.

Re: cron strangeness

Posted: Mon Oct 25, 2010 2:43 pm
by rgmhtt
I have cron jobs set and running on my box. Recommend you try using the apache crontab. I have some there and in root. Also, ensure the cronie (I think) RPM is installed. All appear to be working fine. I also use Webmin to change them versus CLI.
It seems from /var/log/cron that cron jobs are running on my box too, even though /etc/crontab is empty...

What is apache crontab? Are you talking about user crontabs as the comment about root seems to imply?

cronie is installed.

I am trying to get what I consider basic functions working without resorting to tools like webmin and getting reports about what cron is doing seems rather basic to me.

Re: cron strangeness

Posted: Mon Oct 25, 2010 2:51 pm
by bigfoot65
Well, I do crontab -e as root to do root's cron jobs...then add -uapache to do that users. My /etc/crontab has the basic stuff just like yours.

Does that help? Don't have to use Webmin, just has a nice interface that's all. I do it CLI often.

Re: cron strangeness

Posted: Mon Oct 25, 2010 10:04 pm
by cpg
good catch! i noticed some strangeness with crontab as well a bit ago. starting in august, to be precise. i have been super busy and did not have a chance to look at this.

my daily rsnapshots stoppped! at least the daily cron jobs were lost somehow!?!

i do see an upstream issue that is precisely what we have here: https://bugzilla.redhat.com/show_bug.cgi?id=505778

however, that does not explain things stopping in august - though i did not update my machine in a long time (i like stability and test against the released bits).

in my case, my machine has been running fedora bits for a LONG time, probably pre-f11.

yours on the other hand is a fresh install.

this is something that we may have to patch in amahi if in fact f14 does not fix it.

in the mean time, copying the entries will work.

Re: cron strangeness

Posted: Thu Oct 28, 2010 10:05 am
by bigfoot65
Not sure if this is of any help. I found this today and am going to check mine this afternoon to see how it's set up. I have one daily job that is not executing and I believe this is why.

http://tinyurl.com/27hpq5j

Re: cron strangeness

Posted: Thu Oct 28, 2010 11:18 am
by rgmhtt
Not sure if this is of any help. I found this today and am going to check mine this afternoon to see how it's set up. I have one daily job that is not executing and I believe this is why.

http://tinyurl.com/27hpq5j
Good. Now we know how the cron stuff is running. BUT

Why no mail of the cron job outputs? I am getting them hourly from my older system (the one running my mail server).

And it is not because sendmail is not running. I started sendmail and waited for an hourly cron to run, and no mail output from it.