Re: AS & cron?
Re: AS & cron?
- Subject: Re: AS & cron?
- From: Deivy Petrescu <email@hidden>
- Date: Fri, 30 Aug 2002 20:39:07 -0400
At 10:48 AM -0500 8/30/02, Michael Grant wrote:
Is anyone successfully running AppleScripts via cron? If so, would you care
to briefly describe how you got it to work?
Alternatively, Youpi Key has a timer mechanism, but it has limitations as a
script runner. What I could do with YK is have it run a launcher script
which would use another application to run the main script. (I don't want to
compile the main script itself as an applet because of performance issues
when running it manually.) What's the best low-overhead script runner out
there that is itself scriptable enough to do what I have in mind?
Thanks,
Michael
Michael,
I do not use cron I use "at", and have been running scritps
successfully every night.
I do not have 10.2 yet, however in 10.1.x you have to do some
manipulation to make it work.
First:
You need to turn it on in /etc/crontab. Uncomment the line
# /1 * * * * root /usr/libexec/atrun
to start it once a minute. I think the default setup was for once
every ten minutes.
Second:
make sure you have the directory /var/at/spool/ . If you do not, then
the command:
sudo makedir /var/at/spool/
will create it with the appropriate privileges.
Third:
make sure you have the appropriate permission to use at (either an
empty /var/at/at.deny or put your username in /var/at/at.allow).
You are all set to use "at".
To get a better idea "man at". Now this is the point, scripts have to
be saved as application to run in "at". And "at" is suppose to run
once only.
For the first I found no cure, so scripts have to be saved as an application.
For the second, however, you can use the following:
Say you want to run the script SCRIPT, in your root directory every
hour , create the the file MYAT in your root directory, say.
Edit MYAT with your favor editor (vi, pico, bbedit):
#
#tcsh
#
echo "~/MYAT" | at now + 1 hour
open ~/SCRIPT
save it. You are done. Run it now or set an "at" to run it at a later time.
It will be repeating itself every hour.
Make the necessary adjustments for your particular case.
You can use hour, minutes and day. But check the man page.
It's been flawless for a while.
Regards
--
Deivy Petrescu
http://www.dicas.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
References: | |
| >AS & cron? (From: Michael Grant <email@hidden>) |