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
|
@ssl_options = ssl_options
|
||||||
Docker.url = @url
|
Docker.url = @url
|
||||||
setup_ssl
|
setup_ssl
|
||||||
LOGGER.level = ENV['LOG_LEVEL'] || :debug
|
LOGGER.level = ENV['LOG_LEVEL'].to_sym|| :info
|
||||||
end
|
end
|
||||||
|
|
||||||
def perform_backup
|
def perform_backup
|
||||||
|
@ -81,8 +81,7 @@ class Baktainer::Runner
|
||||||
loop do
|
loop do
|
||||||
now = Time.now
|
now = Time.now
|
||||||
next_run = @cron.next.first
|
next_run = @cron.next.first
|
||||||
# sleep_duration = next_run - now
|
sleep_duration = next_run - now
|
||||||
sleep_duration = 5
|
|
||||||
LOGGER.info("Sleeping for #{sleep_duration} seconds until #{next_run}.")
|
LOGGER.info("Sleeping for #{sleep_duration} seconds until #{next_run}.")
|
||||||
sleep(sleep_duration)
|
sleep(sleep_duration)
|
||||||
perform_backup
|
perform_backup
|
||||||
|
|
Loading…
Add table
Reference in a new issue