Of course this script wipes out the entire crontab replacing it with
a single entry... (!) so beware if you have lots of jobs set up with
something like CronniX (an excellent, very easy to use OSX cron
utility... freeware)
It should not take much to whip up a little Rev GUI to handle a
multi-line file though...
I like to use voice reminders:
like this
/Users/katir/Documents/scripts/goForAWalk.sh
#!/bin/sh
NOW=`date +%H:%M`
say "Please. It's $NOW You have been sitting for an hour. Get up and
go for a walk."
But I thought cron was deprecated on OSX and that we would have to
start eating launchD for this kind of thing in the future?
Ken, thanks for that script. I can leave CronniX behind now and
move this stuff into my rev PIM... I've just been thinking about
this recently... but i could make the leap between the cmd line and
the rev script...if all it is is managing a single text file of cron
tab lines and then loading with a shell cmd ... that's really 'too
easy!" :-)
Sivakatirswami
on mouseUp
put "~/myRemindercron" into tCronFile
put format("*\t*/1\t*\t*\t*\t") & \
"/Users/katir/Documents/scripts/goForAWalk.sh" & numToChar(10)
into tCronData
put tCronData into url("binfile:" & tCronFile)
get shell("crontab ~/myRemindercron")
if it <> "" then
answer error it titled "Cron Status"
else
answer "Get up reminder set for every hour." titled "Cron Status"
end if
delete file tCronFile
end mouseUp
On Dec 28, 2005, at 10:46 AM, Ken Ray wrote:
On 12/28/05 10:55 AM, "Dom" <[EMAIL PROTECTED]> wrote:
Thomas McGrath III <[EMAIL PROTECTED]> wrote:
Does any one know where these files live?
you would like to debut at:
http://www.afp548.com/article.php?story=20050103223643995
"One of the most essential, and misunderstood, server admin skills is
being able to maintain a crontab file. The syntax of the crontab file
though has been known to drive a sysadmin to drink."
;-)
Here's an example I use to set up a cron at 2:00am every morning to
backup a
mySQL database called "mydb". Basically you create a crontab file
and then
call "crontab" on it (watch for line wraps):
put "~/mydbcron" into tCronFile
numToChar(10) into tCronData
put format("0\t2\t*\t*\t*\t") & \
"/usr/local/mysql/bin/mysqldump -u root mydb > ~/Documents/
mydbsql" & \
numToChar(10) into tCronData
put tCronData into url("binfile:" & tCronFile)
get shell("crontab ~/mydbcron")
if it <> "" then
answer error it titled "Cron Status"
else
answer "Backup has been set for 2:00 AM every day." titled
"Cron Status"
end if
delete file tCronFile
Hope this helps,
Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [EMAIL PROTECTED]
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution