Skip to content

Commit

Permalink
Include a launchd .plist file.
Browse files Browse the repository at this point in the history
macOS has two ways of running scheduled tasks:
1. Traditional Unix cron
2. launchd

According to https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/ScheduledJobs.html, Apple strongly prefers the launchd model. This commit introduces the com.stevegrunwell.asimov.plist file, which can be loaded into the launchd system via `launchctl load ./com.stevegrunwell.asimov.plist`.

It's not perfect, namely because it relies on the `asimov` executable being available at /usr/local/bin/asimov; ideally, users should be able to put this anywhere, but it seems that launchd is pretty picky about paths. Fortunately, this will become less of an issue once Asimov is available via Homebrew (#2).
  • Loading branch information
stevegrunwell committed Nov 2, 2017
1 parent 9f03815 commit 9e25880
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions com.stevegrunwell.asimov.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.stevegrunwell.asimov</string>
<key>Program</key>
<string>/usr/local/bin/asimov</string>
<key>StartInterval</key>
<!-- 24 hours = 60 * 60 * 24 -->
<integer>86400</integer>
</dict>
</plist>

0 comments on commit 9e25880

Please sign in to comment.