1
Fork 0
mirror of https://github.com/Steffo99/backup-duplicity.git synced 2025-02-16 21:34:03 +00:00

Alpine does not have long grep options

This commit is contained in:
Steffo 2025-01-19 14:23:41 +01:00
parent 0ffa37d684
commit 278202ac00
Signed by: steffo
GPG key ID: 6B8E18743E7E1F86

View file

@ -39,7 +39,7 @@ if [ -n "${NTFY}" ]; then
case "$backup_result" in
0)
echo "Sending ntfy backup complete notification..." >> /dev/stderr
backup_summary=$(grep --fixed-strings --after-context='16' --regexp='--------------[ Backup Statistics ]--------------' "/var/log/gestalt-amadeus/log.txt")
backup_summary=$(grep -F -A '16' -e '--------------[ Backup Statistics ]--------------' "/var/log/gestalt-amadeus/log.txt")
ntfy_message=$(printf "Duplicity has successfully performed a backup to **%s**!\n\n\`\`\`\n%s\n\`\`\`" "$DUPLICITY_TARGET_URL" "$backup_summary")
curl "${NTFY}" \
--silent \
@ -52,7 +52,7 @@ if [ -n "${NTFY}" ]; then
;;
*)
echo "Sending ntfy backup failed notification..." >> /dev/stderr
backup_log=$(grep --fixed-strings --after-context='16' --regexp='--------------[ Backup Statistics ]--------------' "/var/log/gestalt-amadeus/log.txt")
backup_log=$(cat "/var/log/gestalt-amadeus/log.txt")
ntfy_message=$(printf "Duplicity has failed to perform a backup to **%s**.\n\n\`\`\`\n%s\n\`\`\`" "$DUPLICITY_TARGET_URL" "$backup_log")
curl "${NTFY}" \
--silent \