Skip to content

Instantly share code, notes, and snippets.

@gjaekel
Created February 6, 2026 06:58
Show Gist options
  • Select an option

  • Save gjaekel/989dadf98ca8673c21c65f3447fd37e7 to your computer and use it in GitHub Desktop.

Select an option

Save gjaekel/989dadf98ca8673c21c65f3447fd37e7 to your computer and use it in GitHub Desktop.
Restic Local Backup Script to be called by
#!/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