Re: shell script doesn't run when run as cron job?
Re: shell script doesn't run when run as cron job?
- Subject: Re: shell script doesn't run when run as cron job?
- From: Christopher Nebel <email@hidden>
- Date: Tue, 13 Dec 2005 09:46:32 -0800
On Dec 12, 2005, at 11:14 AM, Charles Arthur, UKClimbing Editor wrote:
At 09:37 -0800 on 12/12/05, Andrew Oliver wrote:
Yes. Look at your script. The 'do shell script'
do shell script "curl \"http://technology.guardian.co.uk/\" >
\"Users/charles/Documents/Guardian/technology.html\""
translates to:
curl "http://technology.guardian.co.uk/" >
Users/charles/Documents/Guardian/technology.html
You're missing a leading slash on the output redirection (it
should be >
/Users/charles/... )
Funnily enough, this is exactly what the error message tells you:
Users/charles/Documents/Guardian/technology.html: No such file or
directory
It can't create the output file, so generates an error.
Thanks. I'll alter that.
But then why does it work when run from Script Editor, without change?
Because "Users/charles..." is a working-directory-relative path, and
"do shell script" typically runs with the working directory set to
"/". cron doesn't. Again, see <http://developer.apple.com/technotes/
tn2002/tn2065.html>, this time "What’s the default working directory
for do shell script commands?"
--Chris Nebel
AppleScript and Automator Engineering
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden