mirror of
https://github.com/plashchynski/crono.git
synced 2026-04-20 16:01:30 +02: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|
|
opts.on("-L", "--logfile PATH", "Path to writable logfile (Default: #{Crono.config.logfile})") do |logfile|
|
||||||
Crono.config.logfile = logfile
|
Crono.config.logfile = logfile
|
||||||
end
|
end
|
||||||
|
|
||||||
|
opts.on("-d", "--[no-]daemonize", "Daemonize process (Default: #{Crono.config.daemonize})") do |daemonize|
|
||||||
|
Crono.config.daemonize = daemonize
|
||||||
|
end
|
||||||
|
|
||||||
end.parse!(argv)
|
end.parse!(argv)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,11 +7,13 @@ module Crono
|
|||||||
attr_accessor :schedule
|
attr_accessor :schedule
|
||||||
attr_accessor :cronotab
|
attr_accessor :cronotab
|
||||||
attr_accessor :logfile
|
attr_accessor :logfile
|
||||||
|
attr_accessor :daemonize
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
self.schedule = Schedule.new
|
self.schedule = Schedule.new
|
||||||
self.cronotab = CRONOTAB
|
self.cronotab = CRONOTAB
|
||||||
self.logfile = LOGFILE
|
self.logfile = LOGFILE
|
||||||
|
self.daemonize = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user