OSVauco/remove_cron_debug3.sh
Chris Christiansen 9fcb9c354a
Some checks are pending
Check Python Version Consistency / Check Python Version (push) Waiting to run
feat(core): Fresh initialization - Deploy v3.6.1 Singularity Architecture
2026-09-03 04:03:09 +00:00

32 lines
775 B
Bash
Executable File

#!/bin/bash
# set -euo pipefail
exec > ~/OSVauco/debug_output.log 2>&1
BACKUP="$HOME/crontab.backup.$(date +%F-%H%M%S)"
crontab -l > "$BACKUP"
TMP="$(mktemp)"
grep -vE 'OSVauco/scripts/vm-teardown\.sh|secret=webhook-url.*(teardown|VM kjører)' "$BACKUP" > "$TMP"
echo "--- Content of temp file ---"
cat "$TMP"
echo "---------------------------"
crontab "$TMP"
# rm -f "$TMP" # Keep the temp file for debugging
echo "Backup saved: $BACKUP"
echo
echo "Resulting crontab:"
crontab -l | nl -ba
echo
echo "Verification:"
if crontab -l | grep -Ei 'vm-teardown\.sh|teardown|VM kjører'; then
echo "ERROR: A related entry is still present; do not make further changes automatically."
exit 1
else
echo "OK: No VM teardown or teardown-warning cron entries remain."
fi