From af2d16f64b44284edbbd8c8bddaf2333207042b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Thu, 3 Mar 2022 01:02:38 +0100 Subject: [PATCH] randomized schedules --- Dockerfile | 8 ++++---- libexec/kiwi-backup/scheduler | 15 +++++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index e1a8ccd..7e94534 100644 --- a/Dockerfile +++ b/Dockerfile @@ -81,8 +81,8 @@ ENV \ ################# # BACKUP POLICY # ################# - SCHEDULE_BACKUP="R 02 * * *" \ - SCHEDULE_CLEANUP="R 04 * * *" \ + SCHEDULE_BACKUP="R 2 * * *" \ + SCHEDULE_CLEANUP="R 4 * * *" \ FULL_BACKUP_FREQUENCY=3M \ BACKUP_RETENTION_TIME=6M \ KEEP_NUM_FULL_CHAINS=2 \ @@ -90,8 +90,8 @@ ENV \ ###################### # ADDITIONAL OPTIONS # ###################### - SCHEDULE_RMFULL="R 05 * * SAT" \ - SCHEDULE_RMINCR="R 05 * * SUN" \ + SCHEDULE_RMFULL="R 5 * * SAT" \ + SCHEDULE_RMINCR="R 5 * * SUN" \ BACKUP_VOLSIZE=1024 \ BACKUP_SOURCE="/kiwi-backup/source" \ BACKUP_TARGET="file:///kiwi-backup/target" \ diff --git a/libexec/kiwi-backup/scheduler b/libexec/kiwi-backup/scheduler index 52f4b42..9226a14 100755 --- a/libexec/kiwi-backup/scheduler +++ b/libexec/kiwi-backup/scheduler @@ -3,7 +3,14 @@ this_script="$( readlink -f "${0}" )" this_dir="${this_script%/*}" -echo "${SCHEDULE_BACKUP}" "$( "${this_dir}/build_command" backup )" -echo "${SCHEDULE_CLEANUP}" "$( "${this_dir}/build_command" cleanup )" -echo "${SCHEDULE_RMFULL}" "$( "${this_dir}/build_command" rmfull )" -echo "${SCHEDULE_RMINCR}" "$( "${this_dir}/build_command" rmincr )" +echo "${SCHEDULE_BACKUP}" "$( "${this_dir}/build_command" backup )" \ + | /usr/local/libexec/kiwi-cron/randomize_schedule + +echo "${SCHEDULE_CLEANUP}" "$( "${this_dir}/build_command" cleanup )" \ + | /usr/local/libexec/kiwi-cron/randomize_schedule + +echo "${SCHEDULE_RMFULL}" "$( "${this_dir}/build_command" rmfull )" \ + | /usr/local/libexec/kiwi-cron/randomize_schedule + +echo "${SCHEDULE_RMINCR}" "$( "${this_dir}/build_command" rmincr )" \ + | /usr/local/libexec/kiwi-cron/randomize_schedule