refactor: v2 #5
@@ -100,9 +100,10 @@ send_notification() {
|
|||||||
#######################################
|
#######################################
|
||||||
run_restic_backup() {
|
run_restic_backup() {
|
||||||
local source_dir="$1"
|
local source_dir="$1"
|
||||||
|
cd "${source_dir}"
|
||||||
log "Starting backup of '${source_dir}' to repository ${RESTIC_REPOSITORY}"
|
log "Starting backup of '${source_dir}' to repository ${RESTIC_REPOSITORY}"
|
||||||
# Capture both stdout and stderr in a variable
|
# Capture both stdout and stderr in a variable
|
||||||
backup_output=$(restic -r "${RESTIC_REPOSITORY}" backup --no-cache --json --verbose "${source_dir}" 2>&1)
|
backup_output=$(restic -r "${RESTIC_REPOSITORY}" backup --no-cache --json --verbose . 2>&1)
|
||||||
# Optionally, also print the output to the console:
|
# Optionally, also print the output to the console:
|
||||||
echo "$backup_output"
|
echo "$backup_output"
|
||||||
# Parse the JSON lines output for the summary message
|
# Parse the JSON lines output for the summary message
|
||||||
|
|||||||
Reference in New Issue
Block a user