lib/deputy.rb in deputy-0.1.34 vs lib/deputy.rb in deputy-0.1.35
- old
+ new
@@ -85,13 +85,15 @@
START_MINUTE = (Time.now.to_i + 30) / 60 # we could start at 58..02 seconds -> always in middle of minute
VERSION = File.read( File.join(File.dirname(__FILE__),'..','VERSION') ).strip
def self.install_cron
executable = `which deputy`.strip
- `crontab -l | { cat; echo "* * * * * #{executable} --run-plugins >> /tmp/deputy.log 2>&1"; } | crontab -`
- if executable !~ %r{^/usr/}
- puts "make deputy globally available! or e.g. calls from inside cronjobs do not know deputy"
- puts "sudo ln -s #{executable} /usr/bin/deputy"
+ unless (`crontab -l`).include?(executable)
+ `crontab -l | { cat; echo "* * * * * #{executable} --run-plugins >> /tmp/deputy.log 2>&1"; } | crontab -`
+ if executable !~ %r{^/usr/}
+ puts "make deputy globally available! or e.g. calls from inside cronjobs do not know deputy"
+ puts "sudo ln -s #{executable} /usr/bin/deputy"
+ end
end
end
def self.run_plugins
content = get("/plugins.rb")
\ No newline at end of file