Created
January 3, 2011 03:02
-
-
Save dachev/763074 to your computer and use it in GitHub Desktop.
Simple reboot example
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
require('crontab').load(cronLoaded); | |
function cronLoaded(err, tab) { | |
if (err) { console.log(err); process.exit(1); } | |
var command = '/usr/bin/env echo "starting some service..."'; | |
tab.remove(tab.findCommand(command)); | |
var item = tab.create(command); | |
item.everyReboot(); | |
tab.save(cronSaved); | |
} | |
function cronSaved(err, tab) { | |
if (err) { console.log(err); process.exit(1); } | |
console.log('saved'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment