image
image

|


Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
Thread Tools
  #1  
Old January 24th, 2003, 12:46 PM
Registered User
 
Join Date: Mar 2001
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
hammer32 is on a distinguished road
Question Getting a terminal script to run in cron

I've got a shell script that runs fine if I drop it onto a terminal window, it also runs if I tell Cronnix to "Run Now", but doesn't run at all when I tell CronniX to run it at a set time. I imagine that it's because Terminal and the Run Now command in CronniX use tcsh and cron doesn't... Anyone know a way around this?

Thanks!

Code:

#!/bin/sh
# Run xmltv for 10 days
# Args:
#
#
#get day in YYYYMMDD format
username=YOURSHORTUSERNAME
cdat=`date +%Y%m%d`
#
echo Running tivoGuide for date: $cdat
#
cd /sw/xmltv-0.5.6/grab/na
#
# Delete Old/Recreate
#
echo Removing PAGES-SHOWS directories
rm -rf SHOWS
#
echo Remaking the PAGES-SHOWS directories
mkdir SHOWS
#
#
echo Running tv_grab_na $cdat+10
./tv_grab_na --days 10 >listings.xml
echo Running parsexmlguide $cdat+10
perl parsexmlguide.pl
Reply With Quote
  #2  
Old January 24th, 2003, 01:53 PM
scruffy's Avatar
Notorious Olive Counter
 
Join Date: Dec 2000
Location: Soviet Canuckistan
Posts: 1,726
Thanks: 0
Thanked 0 Times in 0 Posts
scruffy is on a distinguished road
I doubt the choice of shells would make much difference - it's specified as /bin/sh in the first line anyway. In case though, try forcing sh to run it:

/bin/sh myscript

Sorry I'm not familiar with where Cronnix puts its files, so I can't advise you on what to look for. I just use the crontab command on those rare occasions I need to schedule operations
__________________

What is the robbing of a bank compared to the founding of a bank?
-- Bertold Brecht
Reply With Quote
  #3  
Old January 24th, 2003, 07:10 PM
Registered User
 
Join Date: Dec 2002
Location: Eau Claire, WI
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
substrate is on a distinguished road
Did you set it to be executable? I only know how to do this via the command line, but you have to set it executable.

Open up a terminal, at the prompt type:

chmod ugo+rx

Then drag the file into the terminal, after this type enter.
Reply With Quote
Reply

Thread Tools

Posting 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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Desktop Alias to run TCSH script? OzBert Unix & X11 7 July 13th, 2003 06:41 PM
How to run a script at startup? rformiga Unix & X11 3 May 8th, 2003 09:30 AM
Proper way to write and execute a terminal script? michaelsanford Unix & X11 2 November 8th, 2002 07:24 AM
Terminal script for sudo command? PabloDiablo Software Programming & Web Scripting 2 January 25th, 2002 09:53 AM


All times are GMT -5. The time now is 09:38 PM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.