Commit c2801f2d authored by nimrod's avatar nimrod
Browse files

Notify at the end of the backup.

parent 5df073e4
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ list_subvolumes() {
}

cleanup() {
    exit_code="$?"
    for volume in $(list_subvolumes "$source/.snapshot")
    do
        if [ -d "$source/.snapshot/$volume" ]
@@ -15,6 +16,12 @@ cleanup() {
    done
    btrfs subvolume delete "$source/.snapshot"
    sync --file-system "$source"
    if [ "$exit_code" -eq 0 ]
    then
        curl "https://notify.shore.co.il/send?message=Backup%20finished%20successfully%20on%20$(hostname -s)."
    else
        curl "https://notify.shore.co.il/send?message=Backup%20failed%20on%20$(hostname -s)."
    fi
}

if [ "$#" -ne 2 ]