mirror of
https://github.com/plashchynski/crono.git
synced 2026-02-23 00:54:54 +01:00
Add option to daemonize
This commit is contained in:
@@ -49,6 +49,11 @@ module Crono
|
||||
opts.on("-L", "--logfile PATH", "Path to writable logfile (Default: #{Crono.config.logfile})") do |logfile|
|
||||
Crono.config.logfile = logfile
|
||||
end
|
||||
|
||||
opts.on("-d", "--[no-]daemonize", "Daemonize process (Default: #{Crono.config.daemonize})") do |daemonize|
|
||||
Crono.config.daemonize = daemonize
|
||||
end
|
||||
|
||||
end.parse!(argv)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,11 +7,13 @@ module Crono
|
||||
attr_accessor :schedule
|
||||
attr_accessor :cronotab
|
||||
attr_accessor :logfile
|
||||
attr_accessor :daemonize
|
||||
|
||||
def initialize
|
||||
self.schedule = Schedule.new
|
||||
self.cronotab = CRONOTAB
|
||||
self.logfile = LOGFILE
|
||||
self.daemonize = false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user