Skip to content

Commit 674a98f

Browse files
committed
Release 4.0.19 - See CHANGELOG.md
1 parent 77c747e commit 674a98f

File tree

4 files changed

+28
-9
lines changed

4 files changed

+28
-9
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 4.0.19 2023-11-20 <dave at tiredofit dot ca>
2+
3+
### Changed
4+
- Make adjustments to cron scheduling feature to be able to handle whitespace properly"
5+
6+
17
## 4.0.18 2023-11-18 <joergmschulz@github>
28

39
### Changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ RUN source /assets/functions/00-container && \
7676
*) sleep 0.1 ;; \
7777
esac; \
7878
\
79-
if [ $mssql = "true" ] ; then curl -O https://download.microsoft.com/download/3/5/5/355d7943-a338-41a7-858d-53b259ea33f5/msodbcsql18_${MSODBC_VERSION}_${mssql_arch}.apk ; curl -O https://download.microsoft.com/download/3/5/5/355d7943-a338-41a7-858d-53b259ea33f5/mssql-tools18_${MSSQL_VERSION}_${mssql_arch}.apk ; ls -l ; echo y | apk add --allow-untrusted msodbcsql18_${MSODBC_VERSION}_${mssql_arch}.apk mssql-tools18_${MSSQL_VERSION}_${mssql_arch}.apk ; else echo >&2 "Detected non x86_64 or ARM64 build variant, skipping MSSQL installation" ; fi; \
79+
if [ $mssql = "true" ] ; then curl -O https://download.microsoft.com/download/3/5/5/355d7943-a338-41a7-858d-53b259ea33f5/msodbcsql18_${MSODBC_VERSION}_${mssql_arch}.apk ; curl -O https://download.microsoft.com/download/3/5/5/355d7943-a338-41a7-858d-53b259ea33f5/mssql-tools18_${MSSQL_VERSION}_${mssql_arch}.apk ; echo y | apk add --allow-untrusted msodbcsql18_${MSODBC_VERSION}_${mssql_arch}.apk mssql-tools18_${MSSQL_VERSION}_${mssql_arch}.apk ; else echo >&2 "Detected non x86_64 or ARM64 build variant, skipping MSSQL installation" ; fi; \
8080
if [ $influx2 = "true" ] ; then curl -sSL https://dl.influxdata.com/influxdb/releases/influxdb2-client-${INFLUX2_CLIENT_VERSION}-linux-${influx_arch}.tar.gz | tar xvfz - --strip=1 -C /usr/src/ ; chmod +x /usr/src/influx ; mv /usr/src/influx /usr/sbin/ ; else echo >&2 "Unable to build Influx 2 on this system" ; fi ; \
8181
clone_git_repo https://github.com/aws/aws-cli "${AWS_CLI_VERSION}" && \
8282
python3 setup.py install --prefix=/usr && \

install/assets/dbbackup/template-dbbackup/run

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@ else
3434
elif [[ "${backup_job_backup_begin}" =~ ([0-9]{4})-([0-9]{2})-([0-9]{2})[[:space:]]([0-9]{2}):([0-9]{2}):([0-9]{2}) ]]; then
3535
print_debug "BACKUP_BEGIN is a full date timestamp"
3636
timer datetime
37+
#elif echo "${backup_job_backup_begin//\*/#}" | grep -qP "^(.*((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|#) ?){5}$" ; then # Allow slashes, yet not supporting advanced cron yet
3738
elif echo "${backup_job_backup_begin//\*/#}" | grep -qP "^(((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|#) ?){5}$" ; then
3839
print_debug "BACKUP_BEGIN is a cron expression"
3940
time_last_run=$(date +"%s")
41+
backup_job_backup_begin=${backup_job_backup_begin//\"/}
42+
backup_job_backup_begin=${backup_job_backup_begin//\'/}
4043
timer cron "${backup_job_backup_begin}" "${time_current}" "${time_last_run}"
4144
else
4245
print_error "_BACKUP_BEGIN is invalid - Unable to perform scheduling"

install/assets/functions/10-db-backup

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,7 @@ timer() {
18431843
if [ "${expression_step}" != "${expression}" ]; then
18441844
for step in ${validate_temp}; do
18451845
if [ $(( ( step - expression_start ) % expression_step )) -eq 0 ]; then
1846-
validate_all="$validate_all ${step}"
1846+
validate_all="${validate_all} ${step}"
18471847
fi
18481848
done
18491849
else
@@ -1853,13 +1853,14 @@ timer() {
18531853

18541854
validate_all=$(echo "${validate_all}" | tr ' ' '\n' | sort -n -u | tr '\n' ' ')
18551855
for entry in $validate_all; do
1856-
if [ "${entry}" -ge "${3}" ]; then
1856+
if [ ${entry} -ge ${3} ]; then
18571857
echo "${entry}"
18581858
return 0
18591859
fi
18601860
done
18611861

1862-
echo "${validate_all%% *}"
1862+
echo "${validate_all// /}"
1863+
#echo "${validate_all%% *}"
18631864
}
18641865

18651866
local cron_compare="${3}"
@@ -1878,7 +1879,10 @@ timer() {
18781879
local cron_minute="$(echo -n "${2}" | awk '{print $1}')"
18791880
local cron_hour="$(echo -n "${2}" | awk '{print $2}')"
18801881
local cron_day_of_month="$(echo -n "${2}" | awk '{print $3}')"
1881-
local cron_month="$(echo -n "${2}" | awk '{print $4}')"Generating
1882+
local cron_month="$(echo -n "${2}" | awk '{print $4}')"
1883+
local cron_day_of_week="$(echo -n "${2}" | awk '{print $5}')"
1884+
1885+
local cron_next_minute="$(date --date=@"${cron_compare}" +"%-M")"
18821886
local cron_next_hour="$(date --date=@"${cron_compare}" +"%-H")"
18831887
local cron_next_day_of_month="$(date --date=@"${cron_compare}" +"%-d")"
18841888
local cron_next_month="$(date --date=@"${cron_compare}" +"%-m")"
@@ -1887,8 +1891,10 @@ timer() {
18871891
local cron_next_year="$(date --date=@"${cron_compare}" +"%-Y")"
18881892

18891893
local cron_next=
1894+
local cron_parsed=1
18901895

1891-
while [ "$cron_parsed" != "0" ]; do
1896+
while [ "${cron_parsed}" != "0" ]; do
1897+
print_debug "[timer] [cron] Parse Minute"
18921898
cron_next=$(parse_expression "${cron_minute}" 59 "${cron_next_minute}")
18931899
if [ "${cron_next}" != "${cron_next_minute}" ]; then
18941900
if [ "${cron_next_minute}" -gt "${cron_next}" ]; then
@@ -1898,20 +1904,22 @@ timer() {
18981904
cron_next_minute="${cron_next}"
18991905
fi
19001906

1907+
print_debug "[timer] [cron] Parse Hour"
19011908
cron_next=$(parse_expression "${cron_hour}" 23 "${cron_next_hour}")
19021909
if [ "${cron_next}" != "${cron_next_hour}" ]; then
19031910
if [ "${cron_next_hour}" -gt "${cron_next}" ]; then
19041911
cron_next_day_of_month=$(( cron_next_day_of_month + 1 ))
19051912
fi
1913+
19061914
cron_next_hour="${cron_next}"
1907-
#cron_next_minute=0
19081915
fi
19091916

1917+
print_debug "[timer] [cron] Parse Day of Week"
19101918
cron_next=$(parse_expression "${cron_day_of_week}" 6 "${cron_next_day_of_week}")
19111919
if [ "${cron_next}" != "${cron_next_day_of_week}" ]; then
1912-
day_of_week_difference=$(( ${cron_next} - ${cron_next_day_of_week} ))
1920+
day_of_week_difference=$(( cron_next - cron_next_day_of_week ))
19131921

1914-
if [ "${day_of_week_difference}" -lt "0" ]; then
1922+
if [ "${day_of_week_difference}" -lt 0 ]; then
19151923
day_of_week_difference=$(( day_of_week_difference + 7 ))
19161924
fi
19171925

@@ -1920,6 +1928,7 @@ timer() {
19201928
cron_next_minute=0
19211929
fi
19221930

1931+
print_debug "[timer] [cron] Parse day of month"
19231932
case "${cron_next_month}" in
19241933
1|3|5|7|8|10|12)
19251934
last_day_of_month="31"
@@ -1959,6 +1968,7 @@ timer() {
19591968
cron_next_day_of_month=$cron_next
19601969
fi
19611970

1971+
print_debug "[timer] [cron] Parse Next Month"
19621972
cron_next=$(parse_expression "${cron_month}" 12 "${cron_next_month}")
19631973
if [ "${cron_next}" != "${cron_next_month}" ]; then
19641974
if [ "${cron_next}" -gt "12" ]; then

0 commit comments

Comments
 (0)