Use Cron for backup sleep/backuptime. Default log level to info

This commit is contained in:
James Paterni 2025-04-14 09:53:31 -04:00
parent 7708f6cf50
commit c9ba136df5

View file

@ -50,7 +50,7 @@ class Baktainer::Runner
@ssl_options = ssl_options
Docker.url = @url
setup_ssl
LOGGER.level = ENV['LOG_LEVEL'] || :debug
LOGGER.level = ENV['LOG_LEVEL'].to_sym|| :info
end
def perform_backup
@ -81,8 +81,7 @@ class Baktainer::Runner
loop do
now = Time.now
next_run = @cron.next.first
# sleep_duration = next_run - now
sleep_duration = 5
sleep_duration = next_run - now
LOGGER.info("Sleeping for #{sleep_duration} seconds until #{next_run}.")
sleep(sleep_duration)
perform_backup