@@ -112,32 +112,38 @@ bootstrap_variables() {
112
112
if [ -n "${ENABLE_CHECKSUM}" ]; then
113
113
print_warn "Deprecated and unsupported variable 'ENABLE_CHECKSUM' detected - Please upgrade your variables as they will be removed in version 4.3.0"
114
114
if var_false "${ENABLE_CHECKSUM}" ; then
115
+ sed -i "/DEFAULT_CHECKSUM=/d" "${backup_instance_vars}"
115
116
echo "DEFAULT_CHECKSUM=NONE" >> "${backup_instance_vars}"
116
117
fi
117
118
fi
118
119
119
120
if [ -n "${DB_DUMP_BEGIN}" ]; then
120
121
print_warn "Deprecated and unsupported variable 'DB_DUMP_BEGIN' detected - Please upgrade your variables as they will be removed in version 4.3.0"
122
+ sed -i "/DEFAULT_BACKUP_BEGIN=/d" "${backup_instance_vars}"
121
123
echo "DEFAULT_BACKUP_BEGIN=${DB_DUMP_BEGIN}" >> "${backup_instance_vars}"
122
124
fi
123
125
124
126
if [ -n "${DB_DUMP_FREQ}" ]; then
125
127
print_warn "Deprecated and unsupported variable 'DB_DUMP_FREQ' detected - Please upgrade your variables as they will be removed in version 4.3.0"
126
- echo "DEFAULT_BACKUP_INTERVAL=${DB_DUMP_INTERVAL}" >> "${backup_instance_vars}"
128
+ sed -i "/DEFAULT_BACKUP_INTERVAL=/d" "${backup_instance_vars}"
129
+ echo "DEFAULT_BACKUP_INTERVAL=${DB_DUMP_FREQ}" >> "${backup_instance_vars}"
127
130
fi
128
131
129
132
if [ -n "${DB_DUMP_TARGET}" ]; then
130
133
print_warn "Deprecated and unsupported variable 'DB_DUMP_TARGET' detected - Please upgrade your variables as they will be removed in version 4.3.0"
134
+ sed -i "/DEFAULT_FILESYSTEM_PATH=/d" "${backup_instance_vars}"
131
135
echo "DEFAULT_FILESYSTEM_PATH=${DB_DUMP_TARGET}" >> "${backup_instance_vars}"
132
136
fi
133
137
134
138
if [ -n "${DB_DUMP_TARGET_ARCHIVE}" ]; then
135
139
print_warn "Deprecated and unsupported variable 'DB_DUMP_TARGET_ACRHIVE' detected - Please upgrade your variables as they will be removed in version 4.3.0"
140
+ sed -i "/DEFAULT_FILESYSTEM_ARCHIVE_PATH=/d" "${backup_instance_vars}"
136
141
echo "DEFAULT_FILESYSTEM_ARCHIVE_PATH=${DB_DUMP_TARGET_ARCHIVE}" >> "${backup_instance_vars}"
137
142
fi
138
143
139
144
if [ -n "${EXTRA_DUMP_OPTS}" ]; then
140
145
print_warn "Deprecated and unsupported variable 'EXTRA_DUMP_OPTS' detected - Please upgrade your variables as they will be removed in version 4.3.0"
146
+ sed -i "/DEFAULT_EXTRA_BACKUP_OPTS=/d" "${backup_instance_vars}"
141
147
echo "DEFAULT_EXTRA_BACKUP_OPTS=${EXTRA_DUMP_OPTS}" >> "${backup_instance_vars}"
142
148
fi
143
149
##
@@ -159,10 +165,8 @@ bootstrap_variables() {
159
165
160
166
transform_backup_instance_variable "${backup_instance_number}" ARCHIVE_TIME backup_job_archive_time
161
167
transform_backup_instance_variable "${backup_instance_number}" AUTH backup_job_db_auth
162
- set -x
163
168
transform_backup_instance_variable "${backup_instance_number}" BACKUP_BEGIN backup_job_backup_begin
164
169
transform_backup_instance_variable "${backup_instance_number}" BACKUP_INTERVAL backup_job_backup_interval
165
- set +x
166
170
transform_backup_instance_variable "${backup_instance_number}" BACKUP_LOCATION backup_job_backup_location
167
171
transform_backup_instance_variable "${backup_instance_number}" BLACKOUT_BEGIN backup_job_snapshot_blackout_start
168
172
transform_backup_instance_variable "${backup_instance_number}" BLACKOUT_END backup_job_snapshot_blackout_finish
@@ -229,6 +233,7 @@ bootstrap_variables() {
229
233
transform_backup_instance_variable "${backup_instance_number}" USER backup_job_db_user
230
234
231
235
backup_job_backup_begin=$(echo "${backup_job_backup_begin}" | sed -e "s|'||g" -e 's|"||g')
236
+ rm -rf "${backup_instance_vars}"
232
237
}
233
238
234
239
upgrade_lonely_variables() {
@@ -1753,70 +1758,47 @@ symlink_log () {
1753
1758
1754
1759
write_log() {
1755
1760
output_off
1756
- local CONTAINER_LOG_LEVEL_ORIGINAL=${CONTAINER_LOG_LEVEL}
1757
1761
local _arg_log_level=${1}
1758
1762
shift 1
1759
1763
local _arg_log_message="$@"
1760
1764
1761
1765
if [ -n "${backup_job_db_type}" ] && [ -n "${backup_job_db_name}" ] && [ -n "${backup_job_db_host}" ] && [ -n "${ltarget}" ]; then
1762
- write_to_file=true
1763
- else
1764
- write_to_file=false
1765
- fi
1766
-
1767
- case "${_arg_log_level,,}" in
1768
- debug )
1769
- CONTAINER_LOG_LEVEL=DEBUG
1770
- case "${_arg_log_level,,}" in
1771
- "debug" )
1772
- print_debug "${_arg_log_message}"
1773
- if var_true "${write_to_file}" ; then
1766
+ case "${_arg_log_level,,}" in
1767
+ debug )
1768
+ case "${_arg_log_level,,}" in
1769
+ "debug" )
1774
1770
echo "$(date +'%Y-%m-%d %H:%M:%S %Z') [debug] ${_arg_log_message}" | run_as_user tee -a "${LOG_PATH}/$(date +'%Y%m%d')/$(date -d @${backup_job_start_time} +'%Y%m%d_%H%M%S')-${ltarget}.log" > /dev/null
1775
- fi
1776
- ;;
1777
- esac
1778
- CONTAINER_LOG_LEVEL=${CONTAINER_LOG_LEVEL_ORIGINAL}
1779
- ;;
1780
- error )
1781
- CONTAINER_LOG_LEVEL=ERROR
1782
- case "${_arg_log_level,,}" in
1783
- "debug" | "notice" | "warn" | "error")
1784
- print_error "${_arg_log_message}"
1785
- if var_true "${write_to_file}" ; then
1771
+ ;;
1772
+ esac
1773
+ ;;
1774
+ error )
1775
+ case "${_arg_log_level,,}" in
1776
+ "debug" | "notice" | "warn" | "error")
1786
1777
echo "$(date +'%Y-%m-%d %H:%M:%S %Z') [error] ${_arg_log_message}" | run_as_user tee -a "${LOG_PATH}/$(date +'%Y%m%d')/$(date -d @${backup_job_start_time} +'%Y%m%d_%H%M%S')-${ltarget}.log" > /dev/null
1787
- fi
1788
- ;;
1789
- esac
1790
- ;;
1791
- info )
1792
- CONTAINER_LOG_LEVEL=INFO
1793
- print_info "${_arg_log_message}"
1794
- if var_true "${write_to_file}" ; then
1778
+ ;;
1779
+ esac
1780
+ ;;
1781
+ info )
1795
1782
echo "$(date +'%Y-%m-%d %H:%M:%S %Z') [info] ${_arg_log_message}" | run_as_user tee -a "${LOG_PATH}/$(date +'%Y%m%d')/$(date -d @${backup_job_start_time} +'%Y%m%d_%H%M%S')-${ltarget}.log" > /dev/null
1796
- fi
1797
- ;;
1798
- notice )
1799
- CONTAINER_LOG_LEVEL=NOTICE
1800
- case "${_arg_log_level,,}" in
1801
- "debug" | "notice" )
1802
- print_notice "${_arg_log_message}"
1803
- if var_true "${write_to_file}" ; then
1783
+ ;;
1784
+ notice )
1785
+ case "${_arg_log_level,,}" in
1786
+ "debug" | "notice" )
1804
1787
echo "$(date +'%Y-%m-%d %H:%M:%S %Z') [notice] ${_arg_log_message}" | run_as_user tee -a "${LOG_PATH}/$(date +'%Y%m%d')/$(date -d @${backup_job_start_time} +'%Y%m%d_%H%M%S')-${ltarget}.log" > /dev/null
1805
- fi
1806
- ;;
1807
- esac
1808
- ;;
1809
- warn )
1810
- CONTAINER_LOG_LEVEL=WARN
1811
- case "${_arg_log_level,,}" in
1812
- "debug" | "notice" | "warn" )
1813
- print_warn "${_arg_log_message}"
1814
- if var_true "${write_to_file}" ; then
1788
+ ;;
1789
+ esac
1790
+ ;;
1791
+ warn )
1792
+ case "${_arg_log_level,,}" in
1793
+ "debug" | "notice" | "warn" )
1815
1794
echo "$(date +'%Y-%m-%d %H:%M:%S %Z') [warn] ${_arg_log_message}" | run_as_user tee -a "${LOG_PATH}/$(date +'%Y%m%d')/$(date -d @${backup_job_start_time} +'%Y%m%d_%H%M%S')-${ltarget}.log" > /dev/null
1816
- fi
1817
- ;;
1818
- esac
1819
- ;;
1820
- esac
1795
+ ;;
1796
+ esac
1797
+ ;;
1798
+ esac
1799
+
1800
+ fi
1801
+
1802
+ print_${_arg_log_level} "${_arg_log_message}"
1821
1803
output_on
1822
1804
}
0 commit comments