• 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: 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
References: 
 >Re: shell script doesn't run when run as cron job? (From: Andrew Oliver <email@hidden>)
 >Re: shell script doesn't run when run as cron job? (From: "Charles Arthur, UKClimbing Editor" <email@hidden>)

  • Prev by Date: Re: Stuck with GUI scripting
  • Next by Date: PDF to Tif
  • Previous by thread: Re: shell script doesn't run when run as cron job?
  • Next by thread: mount iDisk without dialog box
  • Index(es):
    • Date
    • Thread