From ccda858b18bdc1a87f970e1152e4299fd86a3977 Mon Sep 17 00:00:00 2001 From: "dave@tiredofit.ca" Date: Mon, 4 Dec 2023 07:00:39 -0800 Subject: [PATCH] Release 4.0.27 - See CHANGELOG.md --- CHANGELOG.md | 6 ++++++ install/assets/dbbackup/template-dbbackup/run | 6 ++---- install/assets/functions/10-db-backup | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63b5eb7..5a60cc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 4.0.27 2023-12-04 + + ### Changed + - Switch to using actual crontab for cron expressions + + ## 4.0.26 2023-11-30 ### Added diff --git a/install/assets/dbbackup/template-dbbackup/run b/install/assets/dbbackup/template-dbbackup/run index 39f2a1b..c91d1bf 100755 --- a/install/assets/dbbackup/template-dbbackup/run +++ b/install/assets/dbbackup/template-dbbackup/run @@ -22,10 +22,8 @@ if [[ "${MODE,,}" =~ "standalone" ]] || [ "${MODE,,}" = "manual" ] || [ "${1,,}" backup_job_backup_begin=+0 else silent sleep {{BACKUP_NUMBER}} - set -x time_last_run=0 time_current=$(date +'%s') - set +x if [[ "${backup_job_backup_begin}" =~ ^\+(.*)$ ]]; then print_debug "BACKUP_BEGIN is a jump of minute starting with +" timer plusvalue @@ -45,8 +43,8 @@ else backup_job_backup_begin=${backup_job_backup_begin//\'/} timer cron "${backup_job_backup_begin}" "${time_current}" "${time_last_run}" else - echo "${backup_job_backup_begin} /var/run/s6/legacy-services/dbbackup-{{BACKUP_NUMBER}} now" > /tmp/.container/cron/{{BACKUP_NUMBER}}-backup - crontab -l | { cat; echo "${backup_job_backup_begin} /var/run/s6/legacy-services/dbbackup-{{BACKUP_NUMBER}} now"; } | crontab - + echo "${backup_job_backup_begin} /var/run/s6/legacy-services/dbbackup-{{BACKUP_NUMBER}}/run now" > /tmp/.container/cron/{{BACKUP_NUMBER}}-backup + crontab -l | { cat; echo "${backup_job_backup_begin} /var/run/s6/legacy-services/dbbackup-{{BACKUP_NUMBER}}/run now"; } | crontab - s6-svc -d /var/run/s6/legacy-services/dbbackup-{{BACKUP_NUMBER}} exit 0 fi diff --git a/install/assets/functions/10-db-backup b/install/assets/functions/10-db-backup index 59139ea..ee64563 100644 --- a/install/assets/functions/10-db-backup +++ b/install/assets/functions/10-db-backup @@ -2000,12 +2000,13 @@ timer() { fi cron_parsed=0 done - +set -x local cron_future=$(date --date="${cron_next_year}-$(printf "%02d" ${cron_next_month})-$(printf "%02d" ${cron_next_day_of_month})T$(printf "%02d" ${cron_next_hour}):$(printf "%02d" ${cron_next_minute}):00" "+%s") local cron_future_difference=$(( cron_future - cron_compare_seconds )) time_cron=true time_wait="${cron_future_difference}" time_future="${cron_future}" +set +x ;; datetime) time_begin=$(date -d "${backup_job_backup_begin}" +%s)