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: Andrew Oliver <email@hidden>
- Date: Mon, 12 Dec 2005 09:37:02 -0800
On 12/12/05 9:16 AM, "Charles Arthur, UKClimbing Editor"
<email@hidden> wrote:
> Hi..
>
> I've got a script using curl that I use to collect links from a site. The
> script runs fine when run in Script Editor, but when I set it up as a cron
> job, it fails.
>
> Here's the opening lines of the script:
> --
> set thefile to ":Users:charles:Documents:Guardian:technology.html"
> do shell script "curl \"http://technology.guardian.co.uk/\" >
> \"Users/charles/Documents/Guardian/technology.html\""
>
>
[snip]
>
> /Users/charles/Documents/Guardian/get links for this week's section.scpt:
> execution error: sh: line 1:
> Users/charles/Documents/Guardian/technology.html: No such file or directory
> (1)
> --
>
> Anyone able to tell me what I'm doing wrong?
>
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.
Andrew
:)
_______________________________________________
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