Sirius Stuff

Sirius Stuff header image 2

Why I hate Ubuntu sometimes - crontab not enabled

August 9th, 2007 · 10 Comments

I’m trying to set up cron to run jobs for me. I have to go look up the weird syntax but OK. Found it. Everything looks fine but the jobs don’t work. Go on vacation. Come back and try again. Syntax is OK. Everything looks fine but the jobs don’t work. Dig, dig, dig. Find this Unix Crontab - setting up cron jobs using crontab

You can execute crontab if your name appears in the file /usr/lib/cron/cron.allow. If that file does not exist, you can use
crontab if your name does not appear in the file /usr/lib/cron/cron.deny.
If only cron.deny exists and is empty, all users can use crontab. If neither file exists, only the root user can use crontab.

and, of course, there isn’t an empty cron.deny in /usr/lib/cron. OK, Ubuntu uses /etc a lot and that - according to man cron - is where the cron.deny file should be.

Granted that a lot of people might never have need for cron but doesn’t it seem reasonable that there would be an empty /etc/cron.deny file so people who are using Ubuntu and aren’t power users and just want to back up their files automatically have things work?

Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • digg
  • Fark
  • Furl
  • NewsVine
  • Reddit
  • Spurl
  • TailRank
  • YahooMyWeb

Tags: Ubuntu

10 responses so far ↓

  • Erik F // Aug 24, 2007 at 9:11 pm

    Try running ’sudo crontab -e’. This should set it up to run the cron file regardless of permissions.

  • Jake // Feb 17, 2008 at 2:54 pm

    I personally just use KCron, which I assume set up everything for me.

  • jazz // Mar 14, 2008 at 10:20 am

    Don’t even know crontab -e ? stop using linux.

  • richard // May 23, 2008 at 1:57 am

    I also get annoyed with Ubuntu and cron. There is a directory /etc/cron.hourly where one supposedly can dump scripts to be run every hour (as root). Well, forget it: nothing is run (and, yes, the script names do not have periods in them). Since I consider cron a basic part of a Linux system, and since Ubuntu gets it wrong, I wonder if I should not go back to Debian again.

    By the way, ntpdate on Ubuntu doesn’t work either! But the ntpdate-debian command does, which is also installed by the Ubuntu ntpdate package, go figure.

    Getting ntpdate to run every hour was how I got to know the cron issues in the first place.

  • richard // May 23, 2008 at 10:26 pm

    Oops, my bad: cron.hourly and daily work after all. Just make sure the 1st line in your script is #!/bin/bash.

    ntpdate remains a problem though: you must call it as ntpdate-debian.

  • Pete // May 27, 2008 at 2:28 am

    This is rubbish. You’ve cut that short, it actually reads ” If neither of these files exists, then depending on site-dependent configuration parameters, only the super user will be allowed to use this command, or all users will be able to use this command. For standard Debian systems, all users may use this command.”
    By default in ubuntu, all users can use the command. You were obviously doing something else wrong.

  • Izkata // Jun 24, 2008 at 11:56 pm

    Yes, users in Ubuntu can run ‘crontab’ by default, but items places in the crontab file do not run.

  • Auke // Jul 29, 2008 at 8:14 am

    I still hate Ubuntu. It’s time to go back to standard Debian.

    The stupid distribution just plainly fails to run cron jobs for regular users without giving a warning, error, or any indication whatsoever to the user in command output or in any log file. I thought only Windows was this uninformative and amateur.

    Adding /etc/cron.deny and/or /etc/cron.allow files doesn’t make a difference. And since there are no messages indicating anything (short of /var/log/syslog indicating cron sees the crontab), it becomes a very frustrating, pointless exercise. Rubbish packaging.

  • Auke // Jul 29, 2008 at 8:15 am

    Forgot: Thanks for the tip though! :-) Pity it didn’t work either. :-(

  • George // Aug 6, 2008 at 6:18 pm

    I agree. Working with Linux since 92 and SCO and AIX. The Cron implementations all worked with no complications. Earlier Ubuntu distros cron worked. Then…. Duh… Lets change something working and break it.
    Come on… It worked… In my opinion it is the defining difference between Linux and Windows. Schedule a task and it runs as advertised. Now enter Latest Ubuntu…. Well it might work?

Leave a Comment