I’ve just spent a while trying to figure out why my cron job was throwing this error. Here’s the problem:

I had something like this in my user crontab:

1 4 * * * root command.sh

This is doomed, for several reasons. Firstly, it doesn’t make sense for a user to be able to run something as root without “sudo”. If that were possible, it would totally compromise root! Secondly, user cron jobs don’t have the “user” element in their syntax. So cron is trying to run the command “root” rather than running something as root.

The answer is to su then put the quoted crontab line into root’s crontab.

Job done :) Obvious once I took the time to think about it.

Stumble it!

Tags: , , ,



Subscribe to Email Feed

Enter your Email


Preview | Powered by FeedBlitz

My Photos

www.flickr.com
This is a Flickr badge showing public photos from Robert M Jones. Make your own badge here.
3K2 theme by Hakan Aydin