From 84ab27a6b5e2908d56bdafedec60257930bac639 Mon Sep 17 00:00:00 2001 From: Marius Mutu Date: Tue, 21 Apr 2026 07:14:38 +0000 Subject: [PATCH] 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. --- scripts/update_crontab.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 scripts/update_crontab.sh diff --git a/scripts/update_crontab.sh b/scripts/update_crontab.sh new file mode 100755 index 0000000..f79fb21 --- /dev/null +++ b/scripts/update_crontab.sh @@ -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