Created
November 5, 2014 19:08
-
-
Save RickyRomero/def1ea977f6d9b7d43ef to your computer and use it in GitHub Desktop.
Simple StartCalendarInterval launchd test with node.
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
<?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.example.test</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/local/bin/node</string> | |
<string>/test.js</string> | |
</array> | |
<key>StartCalendarInterval</key> | |
<array> | |
<dict> | |
<key>Minute</key> | |
<integer>4</integer> | |
</dict> | |
<dict> | |
<key>Minute</key> | |
<integer>5</integer> | |
</dict> | |
<dict> | |
<key>Minute</key> | |
<integer>6</integer> | |
</dict> | |
<dict> | |
<key>Minute</key> | |
<integer>7</integer> | |
</dict> | |
<dict> | |
<key>Minute</key> | |
<integer>8</integer> | |
</dict> | |
</array> | |
</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
fs = require('fs'); | |
// for verifying respawns | |
fs.writeFileSync('/' + Number(new Date()) + '.txt', 'hi'); | |
// comment out below to stop process immediately after writing | |
setInterval(function () { | |
console.log('hi! ' + Number(new Date())); | |
}, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment