Fix Oracle DR test cron execution by adding explicit PATH

Problem: The weekly DR test script worked when run manually but failed
when executed via cron with "Failed to start VM 109" error at 0 seconds.

Cause: Cron jobs run with a minimal PATH that doesn't include /usr/sbin
where Proxmox commands (qm, pvesh, etc.) are located. Manual execution
had the full PATH including /usr/sbin.

Solution: Added explicit PATH export at the start of the script to ensure
all required system binaries are accessible regardless of execution context.

Testing: Successfully verified with cron test at 11:32 - VM started properly,
restore process completed normally.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Marius
2025-11-06 11:37:27 +02:00
parent c715a0a89d
commit 34f91ba206

View File

@@ -22,6 +22,9 @@
set -euo pipefail
# Set proper PATH for cron execution
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Configuration
DR_VM_ID="109"
DR_VM_IP="10.0.20.37"