Monday, April 14, 2008

Calling *NIX or bash gurus

If this post doesn't make any sense to you, feel free to ignore it. I apologize in advance.

I'm having a problem using crontab to run shell scripts. As in, they don't run and I get an error message (via email) as follows:
-bash: 0: command not found

I'm running Mac OS X 10.4.11 and it's happening on two different computers with nearly-identical installations. One of the computers (the most important one, naturally) is across town so all I have is shell access via ssh.

I can provide more details as requested. Please help, won't you? I'll accept your free-as-in-speech solutions and offer you a free-as-in-beer reward!


Comments:
I suspect it's a path problem. There are a couple of ways around it, this is probably the least complex- specify the full path to command you want to execute. For example:

/bin/ls /Users/Ook/Pictures
/Users/Ook/bin/ooklalookahey.pl
/usr/sbin/apachectl -V
 
Thanks!

But what it actually turned out to be was a difference between the system crontab, and a user's crontab.

To wit: you only have to specify a user in the system crontab. If you (and by "you", I mean "me, the newbie") put in a user in a user's crontab file, crond will interpret it as a command, 'cause that's what it's expecting.

Also, d'oh!
 
Post a Comment



<< Home