• 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
shell script doesn't run when run as cron job?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

shell script doesn't run when run as cron job?


  • Subject: shell script doesn't run when run as cron job?
  • From: "Charles Arthur, UKClimbing Editor" <email@hidden>
  • Date: Mon, 12 Dec 2005 17:16:49 +0000

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\""


tell application "Tex-Edit Plus"
	open file thefile
--and so on
--

The cron job (created with Cronnix) simply says
 osascript "/Users/charles/Documents/Guardian/get links for this week's
section.scpt"

(that's the path to the script, found by using Cronnix's 'browse' menu; it
works for another cron job that I have set up which also runs an
Applescript, which triggers Eudora to move read messages from one mailbox
to another.)


And here's the error message that I got from the cron job (which sends a
nice message telling me what happened. I've no idea how this works, it just
does.)
--
Subject: Cron <charles@Charless-PowerBook> osascript
"/Users/charles/Documents/Guardian/get links for this week's section.scpt"
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=charles>
X-Cron-Env: <USER=charles>
X-Cron-Env: <HOME=/Users/charles>
Date: Thu,  8 Dec 2005 00:05:07 +0000 (GMT)

/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?



     best
     Charles
--
http://www.ukclimbing.com : 1,000+ British crags, 350+ British climbing walls
- searchable by distance rock type, etc, with 5-day weather forecasts for
every one - plus maps, articles, news, and the New Routes database. There's
even a cool shop attached...
 _______________________________________________
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: Andrew Oliver <email@hidden>
  • Prev by Date: Re: applescript for enabling root user...
  • Next by Date: Re: shell script doesn't run when run as cron job?
  • Previous by thread: Re: applescript for enabling root user...
  • Next by thread: Re: shell script doesn't run when run as cron job?
  • Index(es):
    • Date
    • Thread