Last active
December 23, 2019 09:25
-
-
Save hazcod/1accf6c356afb2094dec42c6d040f864 to your computer and use it in GitHub Desktop.
Show a notification when Time Machine backup completes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Raw command | |
BACKUP=$(tmutil latestbackup) ; if [ "$(cat ~/.lastbackup 2>/dev/null)" != "$BACKUP" ]; then echo $BACKUP > ~/.lastbackup ; osascript -e "display notification \"$(echo $BACKUP | xargs basename)\" with title \"Backup finished\""; fi | |
# As cron entry | |
*/5 * * * * BACKUP=$(tmutil latestbackup 2>/dev/null) ; if [ "$(cat ~/.lastbackup 2>/dev/null)" != "$BACKUP" ]; then echo $BACKUP > ~/.lastbackup ; osascript -e "display notification \"$(echo $BACKUP | xargs basename)\" with title \"Backup finished\""; fi 2>&1 >/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment