sh.zio.backup: prototyping
parent
893e007102
commit
990942212f
|
@ -140,7 +140,7 @@ function invoke_script() {
|
||||||
if [[ "$script_result" == 0 ]]; then
|
if [[ "$script_result" == 0 ]]; then
|
||||||
trigger_notify "success" "Backup script succeeded: $backup_script_name" "$script_log_path"
|
trigger_notify "success" "Backup script succeeded: $backup_script_name" "$script_log_path"
|
||||||
else
|
else
|
||||||
trigger_notify "error" "Backup script failed: $backup_script_name" "$(cat "$script_error_log_path")" "$script_log_path"
|
trigger_notify "error" "Backup script failed: $backup_script_name" "$(cat "$script_error_log_path" | sed -e "s/\`/'/g")" "$script_log_path"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f "$script_error_log_path"
|
rm -f "$script_error_log_path"
|
||||||
|
@ -164,7 +164,6 @@ function trigger_notify() {
|
||||||
if [[ ! -f "$notify_prog" ]]; then
|
if [[ ! -f "$notify_prog" ]]; then
|
||||||
say warning "'$notify_prog' not found. Not sending notification"
|
say warning "'$notify_prog' not found. Not sending notification"
|
||||||
else
|
else
|
||||||
#message="$(echo $message | sed -e "s/\`/\\\`/g")"
|
|
||||||
"$notify_prog" \
|
"$notify_prog" \
|
||||||
--file "$log_path" \
|
--file "$log_path" \
|
||||||
--level "$level" \
|
--level "$level" \
|
||||||
|
|
Loading…
Reference in New Issue