Compare commits

...

2 commits

Author SHA1 Message Date
James Paterni
f23e28a157 Merge branch 'main' of ssh://ruby-code.com:2222/james/baktainer 2025-04-14 09:53:40 -04:00
James Paterni
c9ba136df5 Use Cron for backup sleep/backuptime. Default log level to info 2025-04-14 09:53:31 -04:00

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