Fix cron backups failing due to minimal PATH environment
Cron runs with a very limited PATH that may not include sshpass, rsync, etc. Add explicit PATH to generated cron lines and log output to cron.log instead of /dev/null for debugging. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -165,7 +165,7 @@ build_cron_line() {
|
|||||||
extra_flags+=" --target=$SCHEDULE_TARGETS"
|
extra_flags+=" --target=$SCHEDULE_TARGETS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$cron_expr $bin_path backup${extra_flags} >/dev/null 2>&1"
|
echo "$cron_expr PATH=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\" $bin_path backup${extra_flags} >>\"${LOG_DIR}/cron.log\" 2>&1"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ── Crontab Management ────────────────────────────────────────
|
# ── Crontab Management ────────────────────────────────────────
|
||||||
|
|||||||
Reference in New Issue
Block a user