Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1339 from CVi/master_dev
Launchd cron config for Mac OS X
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |