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:
13
scripts/update_crontab.sh
Executable file
13
scripts/update_crontab.sh
Executable 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
|
||||
Reference in New Issue
Block a user