The task I needed to schedule is an applescript that checks several svn repositories and either runs svn update or hgpullsvn and then logs what has been updated or changes made. It would be nice if there was a package that does this for you but I haven't found one.
For a more indepth examination of launchd have a look at this post, but I really just wanted some simple way to setup my scheduled task. Enter Lingon which seems to fit the bill.
A simple setup to run a script every 6 hours. The only catch was to run osascript to actually run the script, and watch the console for errors.
Having not used applescript before it seems straightforward though effectively I just wanted to use it as an error handler around simple bash commands. This bash/applescript usage is covered by apple in their documentation on the do shell script command. The main things to watch out for are to remember that your env is not the same as your terminal so you might need multiple semi-colon separated bash commands like
PATH=$PATH:/usr/local/bin;export PATH;hgpullsvnto get the result you want.

0 comments:
Post a Comment