From 42ce6c2698598478463be34c465eae36f96bdb4e Mon Sep 17 00:00:00 2001 From: Echo Date: Fri, 30 Jan 2026 15:24:05 +0000 Subject: [PATCH] Add backup config script --- tools/backup_config.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 tools/backup_config.sh diff --git a/tools/backup_config.sh b/tools/backup_config.sh new file mode 100755 index 0000000..a7f06b8 --- /dev/null +++ b/tools/backup_config.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Backup config cu retenție: 1 zilnic, 1 săptămânal, 1 lunar + +BACKUP_DIR="/home/moltbot/backups" +CONFIG="$HOME/.clawdbot/clawdbot.json" + +# Backup zilnic (suprascrie) +cp "$CONFIG" "$BACKUP_DIR/clawdbot-daily.json" + +# Backup săptămânal (duminică) +if [ "$(date +%u)" -eq 7 ]; then + cp "$CONFIG" "$BACKUP_DIR/clawdbot-weekly.json" +fi + +# Backup lunar (ziua 1) +if [ "$(date +%d)" -eq 01 ]; then + cp "$CONFIG" "$BACKUP_DIR/clawdbot-monthly.json" +fi + +echo "Backup done: $(date)"