• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: shell script doesn't run when run as cron job?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: shell script doesn't run when run as cron job?
      • From: "Charles Arthur, UKClimbing Editor" <email@hidden>
References: 
 >shell script doesn't run when run as cron job? (From: "Charles Arthur, UKClimbing Editor" <email@hidden>)

  • Prev by Date: shell script doesn't run when run as cron job?
  • Next by Date: Re: applescript for enabling root user...
  • Previous by thread: shell script doesn't run when run as cron job?
  • Next by thread: Re: shell script doesn't run when run as cron job?
  • Index(es):
    • Date
    • Thread