Use Cron for backup sleep/backuptime. Default log level to info
This commit is contained in:
parent
7708f6cf50
commit
c9ba136df5
1 changed files with 2 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue