Cron and root and users -- SOLVED; D'oh

I can't seem to get cron working. Root has a crontab which I have edited with -e and listed with -l, and which is in /var/spool/cron/crontabs/root. The entry itself is

0 3 * * * /root/bin/daily >/tmp/cronlog 2>&1

and the /tmp file does not show up. The cron and crontab groups list root and myself.

I have also tried putting that shell script and an even simpler version of it in /etc/cron.daily and it does not run.

On to regular users. I can't even run crontab -e or -l; I get permission denied. /var/spool is rwxr-xr-x; cron is rwxr-x–- owned by root.cron, and crontab is rwx-wx--T owned by root.crontab.

This all appears exactly the same as another gentoo system where root and myself have working cron jobs.

I am doing something trivially wrong, I am sure, but I can't fire out what it is.

5 Replies

@Scarecrow:

On to regular users. I can't even run crontab -e or -l; I get permission denied. /var/spool is rwxr-xr-x; cron is rwxr-x–- owned by root.cron, and crontab is rwx-wx--T owned by root.crontab.

This all appears exactly the same as another gentoo system where root and myself have working cron jobs.

First guess: you're not in the 'cron' group. (Or you are but haven't logged out and back in yet.)

First guess: you're not in the 'cron' group. (Or you are but haven't logged out and back in yet.)

Let's hear your second guess:

@Scarecrow:

The cron and crontab groups list root and myself.

Bah. Reading comprehension was never my strong suit. In any event, you haven't said if you've logged out and back in as necessary. Are you in the cron group if you run 'groups' as your user? On the subject, on none of my Gentoo systems am I (or root, for that matter) in the crontab group. I'm skeptical that has much bearing on the matter, but thought I'd point it out.

The second guess was related: /usr/bin/crontab is not setgid?

@bss:

The second guess was related: /usr/bin/crontab is not setgid?

Logged in and out a few times. But I don't think that matters anyway, since root shows a crontab but it doesn't run, and running doesn't care if the account is logged in or not.

The permissions of both cron and crontab are the same on a working system and this system.

I added the two accounts to the crontab group just for grins, and have since removed them to make it match a working system.

I suspect it's some kind of time related trickery and that one of these nights the cronjob will run for no apparent reason.

I had forgotten to add cron to the startups.

This is gentoo. Here is what fixed it:

rc-update add /etc/init.d/vixie-cron

Now I just need to fix my noggin. At least I knew it was going to be something trivial.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct