360 Secure SkillHub
360 安全技能中心

Smart Backup

通过 Node 脚本对本地目录执行带日期的备份、增量备份、基于清单的校验与恢复,并支持目录同步(含试运行与删除选项)、备份列表、状态查看和重复内容查找。默认跳过链接与特殊文件,备份不压缩。

分类:自动化
jlacroix82
jlacroix82
热度 67.60
最近更新 2026-12-02 08:06:36

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add jlacroix82/backup-sync
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
backup-sync
description
Copy, verify, and restore local file backups; compare or sync explicitly selected directory trees.
version
1.0.9
metadata
{"openclaw":{"requires":{"bins":["node"]},"envVars":[{"name":"BACKUP_DIR","required":false,"description":"Alternate workspace for default backup and incremental hash state."}]}}

Smart Backup

Run node {baseDir}/smart-backup.js with approved source and destination directories. Sync and restore require separate trees. Backup excludes its destination if it is under the source. Avoid roots being modified concurrently by another process. Backup copies are uncompressed. Links and special files are skipped when collecting files.

Options Effect
--backup <source> [destination] [--dry-run] Create a dated backup under the selected destination; the default is backups/smart-backups.
--backup <source> [destination] --incr [--from-manifest <manifest>] Copy changed files only. An incremental backup contains only its copied files.
--verify <backup-directory> Verify copied files using the manifest. Valid legacy manifests with truncated digests report that limitation. Verification detects mismatch; it does not authenticate a backup's origin.
--restore <backup-directory> <destination> [--force] Check manifest and hashes first, then copy. Existing files are skipped unless the user approves --force.
--sync <source> <destination> [--dry-run] [--force] [--delete] Preview first. Existing files are overwritten only with --force; removing destination-only files also requires --delete and user approval.
--list, --status, --dedup [directory] List backups, inspect status, or find duplicate file content.

--dir <path> selects the default backup destination and listing location. Incremental hash state is local to the workspace.

Version 1.0.9 validates backup and restore paths and manifest entries, uses full SHA-256 for new backups, and corrects destination and option parsing.