Skip to content

Commit

Permalink
Merge pull request #1339 from CVi/master_dev
Browse files Browse the repository at this point in the history
Launchd cron config for Mac OS X
  • Loading branch information
ginatrapani committed Jul 5, 2012
2 parents 87a8fc7 + a9746b6 commit 0783e43
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
46 changes: 46 additions & 0 deletions extras/maccron/com.thinkupapp.plst
@@ -0,0 +1,46 @@
<?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.thinkupapp</string>
<key>UserName</key>
<string>youruser</string>
<!-- User to run cron as -->
<key>ProgramArguments</key>
<array>
<string>/opt/local/bin/php</string>
<!-- Full path to PHP excecutable -->
<string>/path/to/thinkup/crawler/crawl.php</string>
<!-- Full path to thinkup crawler -->
<string>user@example.com</string>
<!-- Admin username -->
<string>myPassword</string>
<!-- Admin password -->
</array>
<key>KeepAlive</key>
<dict>
<key>NetworkState</key>
<true/>
</dict>
<!-- Does not run the deamon when not connected to the internet -->
<key>WorkingDirectory</key>
<string>/path/to/thinkup/</string>
<!-- Path to thinkup working directory -->
<key>Nice</key>
<integer>10</integer>
<!--
Nice level to run crawler at
20 is lowest priority
-20 is highest priority
0 is default
-->
<key>StartInterval</key>
<integer>600</integer>
<!-- Time interval in seconds between runs -->
<key>Debug</key>
<false/>
<key>AbandonProcessGroup</key>
<true/>
</dict>
</plist>
11 changes: 11 additions & 0 deletions extras/maccron/readme.md
@@ -0,0 +1,11 @@
# Mac OS X cron script

This is a simple configuration file for setting up crons with the [launchd deamon in Mac OS X](https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/launchd.8.html). The config as currently set up will log directly to the system log.

## Installation
- Edit the com.thinkupapp.plst in this directory according to commenting
- Copy com.thinkupapp.plst into /System/Library/LaunchAgents/ to make the job load on system boot
- Run "launchctl load /system/Library/LaunchAgents/com.thinkupapp.plst" to load the job

## Limitations
- May not be able to run properly as arbitrary user.

0 comments on commit 0783e43

Please sign in to comment.