Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > cron jobs not working, what am I doing wrong?

cron jobs not working, what am I doing wrong?
Thread Tools
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status: Offline
Reply With Quote
Nov 24, 2006, 09:56 PM
 
I've been trying to setup a cron job via crontab

the file looks solid, most recently I put this in, but it never executes
Code:
* * * * * osascript -e 'tell applcation "Finder" to display dialog "hello"'
that was just a wild effort to get anything to execute. I'm actually using it to schedule iSync to run every morning at 8, that script was

0 8 * * * osascript -e ~/Library/Scripts/iSync.scpt

but that one doesn't work either. I've been searching everywhere I can think of for an explanation, but I can't find any. What am I doing wrong?
(I'm on 10.4.8)
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Nov 24, 2006, 10:35 PM
 
Make sure there is a new line at the end of your crontab file, this is important.
     
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status: Offline
Reply With Quote
Nov 26, 2006, 11:46 AM
 
Tried that, no dice, any other suggestions?
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
     
Grizzled Veteran
Join Date: Mar 2004
Status: Offline
Reply With Quote
Nov 26, 2006, 05:54 PM
 
Originally Posted by SirCastor View Post
Tried that, no dice, any other suggestions?
With cron, we need to supply FULL paths to everything... files, folders and commands alike:

/usr/bin/
osascript
-HI-
     
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status: Offline
Reply With Quote
Nov 26, 2006, 08:45 PM
 
okay, I tried that, and this ends up in my user mailbox...

(headers)
16:17: syntax error: Expected end of line but found \342\200\234. (-2741)
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Nov 26, 2006, 10:09 PM
 
macosxhints.com - An AppleScript to keep your devices in sync


Looks like you are missing your end tell statement?
     
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status: Offline
Reply With Quote
Nov 26, 2006, 10:21 PM
 
Originally Posted by besson3c View Post
macosxhints.com - An AppleScript to keep your devices in sync


Looks like you are missing your end tell statement?
No, the applescripts work when run from the command line using osascript.
It's Cron that's not working...
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
     
Grizzled Veteran
Join Date: Mar 2004
Status: Offline
Reply With Quote
Nov 26, 2006, 10:50 PM
 
Originally Posted by SirCastor View Post
No, the applescripts work when run from the command line using osascript.
It's Cron that's not working...
16:17: syntax error: Expected end of line but found \342\200\234. (-2741)
HAHA... This may be a coincidence, but
when I run what you posted in Terminal,
I get a very similar error. Looks like you
misspelled the word application (typo?):

osascript -e 'tell applcation "Finder" to display dialog "hello"'

-HI-
     
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status: Offline
Reply With Quote
Nov 26, 2006, 11:26 PM
 
Originally Posted by Hal Itosis View Post
HAHA... This may be a coincidence, but
when I run what you posted in Terminal,
I get a very similar error. Looks like you
misspelled the word application (typo?):

osascript -e 'tell applcation "Finder" to display dialog "hello"'

Of course it has to be something like this... I feel like such a moron. Everything is working properly now... (though I still don't know what was wrong with the script... nothing changed there. Hmm.)
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:52 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2