add notification to rsync script

Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
szaimen 2022-03-26 19:25:12 +01:00
parent 3eede90e86
commit 1e7161d524

View file

@ -244,13 +244,13 @@ if ! rsync --stats --archive --human-readable --delete "$SOURCE_DIRECTORY/" "$TA
fi fi
umount "$DRIVE_MOUNTPOINT" umount "$DRIVE_MOUNTPOINT"
if mountpoint -q "$DRIVE_MOUNTPOINT"; then
echo "Synced the backup repository successfully but failed to unmount the target drive." if docker ps --format "{{.Names}}" | grep "^nextcloud-aio-nextcloud$"; then
exit 0 docker exec -it nextcloud-aio-nextcloud bash /notify.sh "Rsync backup successful!" "Synced the backup repository successfully."
else
echo "Synced the backup repository successfully."
fi fi
echo "Synced the backup repository successfully and unmounted the target drive."
exit 0
``` ```
</details> </details>