cron strangeness

User avatar
rgmhtt
Posts: 421
Joined: Sun Jan 11, 2009 9:26 am

cron strangeness

Postby rgmhtt » Thu Oct 21, 2010 5:11 am

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.

surfrock66
Posts: 38
Joined: Sun May 30, 2010 8:29 am

Re: cron strangeness

Postby surfrock66 » Mon Oct 25, 2010 8:15 am

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.

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: cron strangeness

Postby bigfoot65 » Mon Oct 25, 2010 8:29 am

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.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

User avatar
rgmhtt
Posts: 421
Joined: Sun Jan 11, 2009 9:26 am

Re: cron strangeness

Postby rgmhtt » Mon Oct 25, 2010 2:43 pm

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.

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: cron strangeness

Postby bigfoot65 » Mon Oct 25, 2010 2:51 pm

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.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

User avatar
cpg
Administrator
Posts: 2618
Joined: Wed Dec 03, 2008 7:40 am
Contact:

Re: cron strangeness

Postby cpg » Mon Oct 25, 2010 10:04 pm

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.
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 8GB RAM, 1TBx2+3TBx1

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: cron strangeness

Postby bigfoot65 » Thu Oct 28, 2010 10:05 am

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
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

User avatar
rgmhtt
Posts: 421
Joined: Sun Jan 11, 2009 9:26 am

Re: cron strangeness

Postby rgmhtt » Thu Oct 28, 2010 11:18 am

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.

Who is online

Users browsing this forum: No registered users and 29 guests