This repository has been archived on 2026-08-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
openclaw/cron/scripts/backup_openclaw.sh
T
starmen1265 1f0b7f538c chore: move cron scripts to ~/.openclaw/cron/scripts
- Move scripts from ~/work/backup/ to ~/.openclaw/cron/scripts/
- Update cron jobs.json to use new script paths
- Scripts: backup_openclaw.sh, evolver-run.sh, zq-sync.sh, git-auto-sync.sh, ai-conversation-logger.sh
2026-03-06 15:48:20 +08:00

18 lines
488 B
Bash
Executable File

#!/bin/bash
# 备份 openclaw.json
BACKUP_DIR="/home/starmen1265/work/backup"
SOURCE_FILE="/home/starmen1265/.openclaw/openclaw.json"
# 创建备份目录(如果不存在)
mkdir -p "$BACKUP_DIR"
# 备份文件,文件名包含日期时间
TIMESTAMP=$(date +%Y-%m-%d_%H-%M-%S)
cp "$SOURCE_FILE" "$BACKUP_DIR/openclaw.json.$TIMESTAMP"
# 只保留最近30个备份
cd "$BACKUP_DIR"
ls -t openclaw.json.* | tail -n +31 | xargs -r rm
echo "Backup completed: openclaw.json.$TIMESTAMP"