Skip to content

Commit

Permalink
Release 4.0.27 - See CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tiredofit committed Dec 4, 2023
1 parent d58b27d commit ccda858
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 4.0.27 2023-12-04 <dave at tiredofit dot ca>

### Changed
- Switch to using actual crontab for cron expressions


## 4.0.26 2023-11-30 <dave at tiredofit dot ca>

### Added
Expand Down
6 changes: 2 additions & 4 deletions install/assets/dbbackup/template-dbbackup/run
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion install/assets/functions/10-db-backup
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ccda858

Please sign in to comment.