Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4952cc3ee1 | ||
|
|
3ecc3c3510 | ||
|
|
65172e650b | ||
|
|
705248ee00 | ||
|
|
be2c3163a8 | ||
|
|
84e083c62e | ||
|
|
7dde85f25e | ||
|
|
9ebc9ea641 | ||
|
|
3f000ce137 |
@@ -5,10 +5,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
## [7.3.0] - 2022-02-15
|
||||
### Added
|
||||
- optional user-controlled notification. See `RESTIC_NOTIFY_BACKUP_STATS` and in `backup.sh`.
|
||||
|
||||
## [7.2.0] - 2022-02-15
|
||||
### Added
|
||||
- restic-check launchagent.
|
||||
- restic-check LaunchAgent.
|
||||
|
||||
### Changed
|
||||
- [README.md](README.md) is restructured with easier TL;DR for each OS and a more general detailed section for the interested.
|
||||
|
||||
@@ -517,4 +517,6 @@ To make a new release:
|
||||
$ git push && git push --tags
|
||||
```
|
||||
1. Update version in the AUR [PKGBUILD](https://aur.archlinux.org/packages/restic-automatic-backup-scheduler/).
|
||||
1. Update version in the Homebrew [Formula](https://github.com/erikw/homebrew-tap/blob/main/Formula/restic-automatic-backup-scheduler.rb).
|
||||
1. Update version in the Homebrew Formulas:
|
||||
* [restic-automatic-backup-scheduler](https://github.com/erikw/homebrew-tap/blob/main/Formula/restic-automatic-backup-scheduler.rb).
|
||||
* [restic-automatic-backup-scheduler-check](https://github.com/erikw/homebrew-tap/blob/main/Formula/restic-automatic-backup-scheduler-check.rb).
|
||||
|
||||
@@ -105,3 +105,37 @@ wait $!
|
||||
#wait $!
|
||||
|
||||
echo "Backup & cleaning is done."
|
||||
|
||||
#
|
||||
# (optionally) Notify about backup summary stats.
|
||||
#
|
||||
# How to perform the notification is up to the user; the script only writes the info to a user-owned file in a fire
|
||||
# and forget fashion. One option is using a special FIFO file (aka pipe file) on user-side (which will work as a queue)
|
||||
# together with an auto-started user process to read from that queue and trigger the notification.
|
||||
#
|
||||
# Examples of such setup:
|
||||
# - Linux autostart + cross-platform notifier
|
||||
# https://github.com/gerardbosch/dotfiles-linux/blob/ea0f75bfd7a356945544ecaa42a2fc35c9fab3a1/home/.config/autostart/notification-queue.desktop
|
||||
# https://github.com/gerardbosch/dotfiles/blob/ddc1491056822eab45dedd131f1946308ef62135/home/bin/notification-queue-notifier
|
||||
# - MacOS autostart + terminal-notifier
|
||||
# https://github.com/erikw/dotfiles/blob/c25f44db1cad675becf91fc3ff28a5a4dfc4a373/bin/com.user.notificationqueue.plist
|
||||
# https://github.com/erikw/dotfiles/blob/c25f44db1cad675becf91fc3ff28a5a4dfc4a373/bin/notification-queue-notifier.sh
|
||||
#
|
||||
if [ "$RESTIC_NOTIFY_BACKUP_STATS" = true ]; then
|
||||
if [ -w "$RESTIC_BACKUP_NOTIFICATION_FILE" ]; then
|
||||
echo 'Notifications are enabled: Silently computing backup summary stats...'
|
||||
|
||||
snapshot_size=$(restic stats latest --tag "$RESTIC_BACKUP_TAG" | grep -i 'total size:' | cut -d ':' -f2 | xargs) # xargs acts as trim
|
||||
latest_snapshot_diff=$(restic snapshots --tag "$RESTIC_BACKUP_TAG" --latest 2 --compact \
|
||||
| grep -Ei "^[abcdef0-9]{8} " \
|
||||
| awk '{print $1}' \
|
||||
| tr '\n' ' ' \
|
||||
| xargs restic diff)
|
||||
added=$(echo "$latest_snapshot_diff" | grep -i 'added:' | awk '{print $2 " " $3}')
|
||||
removed=$(echo "$latest_snapshot_diff" | grep -i 'removed:' | awk '{print $2 " " $3}')
|
||||
|
||||
echo "Added: ${added}. Removed: ${removed}. Snap size: ${snapshot_size}" >> "$RESTIC_BACKUP_NOTIFICATION_FILE"
|
||||
else
|
||||
echo "[WARN] Couldn't write the backup summary stats. File not found or not writable: ${RESTIC_BACKUP_NOTIFICATION_FILE}"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -29,3 +29,7 @@ export RESTIC_BACKUP_EXTRA_ARGS=
|
||||
# Verbosity level from 0-3. 0 means no --verbose.
|
||||
# Override this value in a profile if needed.
|
||||
export RESTIC_VERBOSITY_LEVEL=0
|
||||
|
||||
# (optional) Desktop notifications. See restic_backup.sh for details on how to set this up.
|
||||
export RESTIC_NOTIFY_BACKUP_STATS=false
|
||||
export RESTIC_BACKUP_NOTIFICATION_FILE=
|
||||
|
||||
Reference in New Issue
Block a user