restic scripts: absolute /usr/local/bin/restic — cron PATH lacks it
First cron run (2026-08-28 05:00) failed with 'restic: command not found'; interactive shells had /usr/local/bin, cron does not. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
c5c958f511
commit
75760ba303
@@ -31,6 +31,7 @@ ONLY_INSTANCES=""
|
||||
MNT_ROOT=/run/restic-incus
|
||||
LOCKFILE=/run/lock/restic-incus-backup.lock
|
||||
ENVFILE=/root/.restic-env
|
||||
RESTIC=/usr/local/bin/restic # cron PATH lacks /usr/local/bin
|
||||
MOUNT_TIMEOUT=30
|
||||
|
||||
usage() {
|
||||
@@ -105,7 +106,7 @@ for inst in $(incus list --project "$PROJECT" -c n -f csv); do
|
||||
fi
|
||||
|
||||
log "backup $inst"
|
||||
restic -r "$REPO" backup \
|
||||
$RESTIC -r "$REPO" backup \
|
||||
--pack-size 64 --read-concurrency 8 -o s3.connections=8 \
|
||||
--tag "$inst" "$mnt" "$MNT_ROOT/$inst.yaml" \
|
||||
|| { echo "backup of $inst failed" >&2; rc=1; }
|
||||
@@ -114,7 +115,7 @@ for inst in $(incus list --project "$PROJECT" -c n -f csv); do
|
||||
done
|
||||
|
||||
log "forget: keep 14d/8w/6m"
|
||||
restic -r "$REPO" forget --keep-daily 14 --keep-weekly 8 --keep-monthly 6 || rc=1
|
||||
$RESTIC -r "$REPO" forget --keep-daily 14 --keep-weekly 8 --keep-monthly 6 || rc=1
|
||||
|
||||
log "done (rc=$rc)"
|
||||
exit $rc
|
||||
|
||||
Reference in New Issue
Block a user