Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 10.4.8 cron / crontab not working after upgrade.



Hi Scott, hi Steve

On 17.02.2007, at 18:29, Steve Hayman wrote:


On 16-Feb-07, at 11:05 PM, Scott Russell wrote:

I guess I'm clueless here ... why would you need to add anything to your PATH to make a cron job work? What's incorrect about the following:


The default path that cron uses is in 10.4 is "/usr/bin:/bin", which is fine for some cron entries - until you try to use a command like "chown" that lives somewhere else . (chown is in / usr/sbin.)

In my case it wasn't there (on an fresh install of Tiger).
But on my system (client) here, there's no default path either (while there is on Panther systems):


styx:~ cronos$ cat /etc/crontab
# The periodic and atrun jobs have moved to launchd jobs
# See /System/Library/LaunchDaemons
#
# minute        hour    mday    month   wday    who     command
styx:~ cronos$

You can either spell out the full path to everything, or set the PATH variable in the crontab itself to include a few more folders.

Spelling out is best practice, I absolutely agree with this.

I think I had a line running every minute, something alike
echo "cron is running" > /Macintosh\ HD/Users/admin/testcron.txt

as echo is a built-in I didn't think I'd have to add the path to it, and I feel I still don't understand it fully:
a quick look at
man builtin
shows:


Thus, while
specifying ``echo'' causes a builtin command to be executed under shells
that support the builtin echo command, specifying ``/bin/echo'' or
``./echo'' does not.


Does that mean I need to set a shell environment table (SHELL=/bin/ bash - as described in man 5 crontab), before cron can execute built- ins?


I have it running for my needs, but still I'd be glad if you could help me understand this matter.


Regards

Gregor
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/email@hidden

This email sent to email@hidden
References: 
 >10.4.8 cron / crontab not working after upgrade. (From: David <email@hidden>)
 >Re: 10.4.8 cron / crontab not working after upgrade. (From: Gregor Alessi <email@hidden>)
 >Re: 10.4.8 cron / crontab not working after upgrade. (From: Scott Russell <email@hidden>)
 >Re: 10.4.8 cron / crontab not working after upgrade. (From: Steve Hayman <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.