Backup automatico script del 2026-07-19 07:00
This commit is contained in:
@@ -8,6 +8,9 @@
|
||||
|
||||
set -uo pipefail
|
||||
|
||||
# PATH completo: il crontab root non eredita /usr/sbin (serve per shutdown, ecc.)
|
||||
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
|
||||
CONF_FILE="/etc/weekly-maintenance.conf"
|
||||
LOG_FILE="/var/log/weekly-maintenance.log"
|
||||
REPORT_FILE="/var/log/weekly-maintenance-report.txt"
|
||||
@@ -165,7 +168,7 @@ run_watchtower() {
|
||||
output=$(docker run --rm \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-e WATCHTOWER_CLEANUP=true \
|
||||
-e WATCHTOWER_ROLLING_RESTART=true \
|
||||
-e WATCHTOWER_ROLLING_RESTART=false \
|
||||
-e WATCHTOWER_TIMEOUT="${WATCHTOWER_TIMEOUT}" \
|
||||
-e TZ=Europe/Rome \
|
||||
"$WATCHTOWER_IMAGE" \
|
||||
@@ -439,7 +442,7 @@ if [[ "$REBOOT_ON_SUCCESS" == true ]]; then
|
||||
append_report ""
|
||||
append_report "=== Reboot ==="
|
||||
append_report "Programmato tra ${REBOOT_DELAY_MIN} minuti"
|
||||
shutdown -r "+${REBOOT_DELAY_MIN}" "Manutenzione settimanale ${HOST_LABEL}" || {
|
||||
/usr/sbin/shutdown -r "+${REBOOT_DELAY_MIN}" "Manutenzione settimanale ${HOST_LABEL}" || {
|
||||
ERRORS+=("shutdown -r (reboot programmato)")
|
||||
log "✗ Impossibile programmare il reboot"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user