I’m looking to generate some nightly (once) reports and was thinking of using /lib/daemons/notifier.rb as the trigger
# to be placed before the sleep statement in notifier.rb
t = Time.now
if t.hour == 0 && t.min < 2
if !auto_reports_sent
AutoReport.send_nightly_reports(logger)
end
auto_reports_sent = true
else
auto_reports_sent = false
end
Will that block execute ‘send_nightly_reports’ one time every night between 12:00 and 12:02
