feat(scripts): add update_crontab.sh for post-migration crontab fix

Idempotent sed-based rewrite of any crontab line that references
/home/moltbot/clawd/tools/backup_config.sh so it points at the
echo-core copy. Safe to re-run; prints a single status line either way.
This commit is contained in:
2026-04-21 07:14:38 +00:00
parent 55e34afd59
commit 84ab27a6b5

13
scripts/update_crontab.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
# update_crontab.sh — post-migration crontab update for Marius.
# Replaces the clawd/tools/backup_config.sh line with the echo-core equivalent.
# Idempotent: safe to re-run.
set -euo pipefail
current=$(crontab -l 2>/dev/null || true)
new=$(printf '%s\n' "$current" | sed -E 's#/home/moltbot/clawd/tools/backup_config\.sh#/home/moltbot/echo-core/tools/backup_config.sh#g')
if [ "$current" != "$new" ]; then
printf '%s\n' "$new" | crontab -
echo "Crontab updated: backup_config.sh path remapped to echo-core."
else
echo "Crontab unchanged (already pointing at echo-core, or backup_config line absent)."
fi