Skip to content

Commit 423327e

Browse files
committed
Update resources
1 parent d6bcca3 commit 423327e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

app.backup_fs.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,21 @@ function fs_backup() {
191191
local ts; ts="$( date -u '+%m.%d-%H' )"
192192
local dst; dst="${FS_DST}/${FS_TPL}"
193193
local file; file="$( hostname -f ).${ts}.tar.xz"
194-
local msg; msg=(
194+
local msg_e; msg_e=(
195195
'error'
196196
"Error backing up files ('${file}')"
197197
"Error backing up files ('${file}')! File '${dst}/${file}' not received or corrupted!"
198198
)
199+
local msg_s; msg_s=(
200+
'success'
201+
"Backup of files ('${file}') completed successfully"
202+
"Backup of files ('${file}') completed successfully. File '${dst}/${file}' received."
203+
)
199204

200205
for i in "${!FS_SRC[@]}"; do [[ -e "${FS_SRC[i]}" ]] || unset 'FS_SRC[i]'; done
201206
[[ ! -d "${dst}" ]] && mkdir -p "${dst}"; cd "${dst}" || _error "Directory '${dst}' not found!"
202-
{ { tar -cf - "${FS_SRC[@]}" | xz | _enc "${dst}/${file}"; } && _sum "${dst}/${file}"; } || _msg "${msg[@]}"
207+
{ { { tar -cf - "${FS_SRC[@]}" | xz | _enc "${dst}/${file}"; } && _sum "${dst}/${file}"; } && _msg "${msg_s[@]}"; } \
208+
|| _msg "${msg_e[@]}"
203209
}
204210

205211
function fs_sync() {

0 commit comments

Comments
 (0)