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
+3
-2
@@ -32,6 +32,7 @@ DB_EXCLUDE_FILE=/root/scripts/plakar-db-exclude # same opt-out list, same form
|
||||
DUMP_DIR=/backup/dumps
|
||||
LOCKFILE=/run/lock/restic-backup.lock
|
||||
ENVFILE=/root/.restic-env
|
||||
RESTIC=/usr/local/bin/restic # cron PATH lacks /usr/local/bin
|
||||
STAGE=all
|
||||
|
||||
usage() {
|
||||
@@ -144,14 +145,14 @@ fi # stage dumps
|
||||
if [ "$STAGE" = all ] || [ "$STAGE" = backup ]; then
|
||||
|
||||
log "restic backup -> $REPO"
|
||||
restic -r "$REPO" backup \
|
||||
$RESTIC -r "$REPO" backup \
|
||||
--pack-size 64 --read-concurrency 8 -o s3.connections=8 \
|
||||
--exclude-file "$EXCLUDE_FILE" \
|
||||
--files-from-verbatim "$PATHS_FILE" "$DUMP_DIR" \
|
||||
|| { echo "restic backup failed" >&2; rc=1; }
|
||||
|
||||
log "forget: keep 14d/8w/6m"
|
||||
restic -r "$REPO" forget --group-by host \
|
||||
$RESTIC -r "$REPO" forget --group-by host \
|
||||
--keep-daily 14 --keep-weekly 8 --keep-monthly 6 || rc=1
|
||||
|
||||
fi # stage backup
|
||||
|
||||
Reference in New Issue
Block a user