Created
February 6, 2026 06:58
-
-
Save gjaekel/989dadf98ca8673c21c65f3447fd37e7 to your computer and use it in GitHub Desktop.
Restic Local Backup Script to be called by
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
| #!/bin/bash | |
| # | |
| # 20240316/gj | |
| # 20260206/gj public version | |
| # | |
| # to be used on client's anachron as /etc/cron.daily/restic-backup | |
| LOGFILE="/var/log/restic-backup.log" | |
| now() { | |
| date "+%Y%m%d-%H%M%S" | |
| } | |
| stamp() { | |
| local $LINE | |
| while read LINE; do | |
| printf "%s %s\n" "$(now)" "$LINE" | |
| done | |
| } | |
| exec > >(tee -a $LOGFILE) 2>&1 | |
| echo "$(now) $(printf '=%.0s' {1..80})" | |
| /import/gateway/backup/restic/_restic.ubuntu backup ALL $@ |& stamp | |
| echo "$(now) $(printf '-%.0s' {1..80})" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment