Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add chaterm/terminal-skills --skill backup-strategygit clone --depth 1 https://github.com/chaterm/terminal-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/chaterm/terminal-skills/backup-strategy)<a href="https://agentmods.dev/skills/chaterm/terminal-skills/backup-strategy"><img src="https://agentmods.dev/badge/skills/chaterm/terminal-skills/backup-strategy/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/chaterm/terminal-skills/backup-strategy"><img src="https://agentmods.dev/badge/skills/chaterm/terminal-skills/backup-strategy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00008 | $0.01596 |
| Opus 5.5 | $0.00003 | $0.00638 |
| Sonnet 5.5 | $0.00002 | $0.00319 |
| Haiku 4.5 | $0.00001 | $0.00160 |
Grade C, and why
backup-strategy scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
rm -rf $TEST_DIR How it starts
The opening of the file, as written. The whole thing — 232 lines — stays where its author put it; the contents beside it link to each section on GitHub.
备份策略设计
概述
3-2-1 策略、备份验证、保留策略设计技能。
3-2-1 备份策略
核心原则
3 - 至少保留 3 份数据副本
2 - 存储在 2 种不同介质上
1 - 至少 1 份异地存储
扩展 3-2-1-1-0:
3 份副本
2 种介质
1 份异地
1 份离线/不可变
0 个错误(验证通过)
实施示例
# 本地备份(副本 1)
tar -czvf /backup/local/data_$(date +%Y%m%d).tar.gz /data
# NAS 备份(副本 2,不同介质)
rsync -avz /backup/local/ nas:/backup/
# 云备份(副本 3,异地)
aws s3 sync /backup/local/ s3://backup-bucket/
备份类型
完整备份
# 每周完整备份
tar -czvf /backup/full_$(date +%Y%m%d).tar.gz /data
增量备份
# 基于时间戳
tar -czvf /backup/incr_$(date +%Y%m%d).tar.gz \
--newer-mtime="1 day ago" /data
# 基于快照文件
tar -czvf /backup/incr.tar.gz -g /backup/snapshot.snar /data
差异备份
# 基于完整备份时间
tar -czvf /backup/diff_$(date +%Y%m%d).tar.gz \
--newer-mtime="$(cat /backup/last_full_date)" /data
保留策略
GFS 策略
# Grandfather-Father-Son
# 日备份:保留 7 天
# 周备份:保留 4 周
# 月备份:保留 12 个月
# 年备份:保留 7 年
#!/bin/bash
BACKUP_DIR="/backup"
DATE=$(date +%Y%m%d)
DOW=$(date +%u) # 1-7
DOM=$(date +%d) # 01-31
# 日备份
tar -czvf ${BACKUP_DIR}/daily/backup_${DATE}.tar.gz /data
# 周备份(周日)
if [ "$DOW" -eq 7 ]; then
cp ${BACKUP_DIR}/daily/backup_${DATE}.tar.gz ${BACKUP_DIR}/weekly/
fi
# 月备份(1号)
if [ "$DOM" -eq "01" ]; then
cp ${BACKUP_DIR}/daily/backup_${DATE}.tar.gz ${BACKUP_DIR}/monthly/
fi
# 清理
find ${BACKUP_DIR}/daily -mtime +7 -delete
find ${BACKUP_DIR}/weekly -mtime +28 -delete
find ${BACKUP_DIR}/monthly -mtime +365 -delete
滚动保留
#!/bin/bash
# 保留最近 N 个备份
BACKUP_DIR="/backup"
KEEP=10
ls -1t ${BACKUP_DIR}/*.tar.gz | tail -n +$((KEEP+1)) | xargs -r rm
备份验证
完整性检查
# 校验和验证
md5sum backup.tar.gz > backup.md5
md5sum -c backup.md5
# tar 测试
tar -tzvf backup.tar.gz > /dev/null
# gzip 测试
gzip -t backup.tar.gz
恢复测试
#!/bin/bash
# 定期恢复测试
TEST_DIR="/tmp/restore_test"
mkdir -p $TEST_DIR
# 解压测试
tar -xzvf /backup/latest.tar.gz -C $TEST_DIR
# 验证文件数量
ORIG_COUNT=$(find /data -type f | wc -l)
REST_COUNT=$(find $TEST_DIR -type f | wc -l)
if [ "$ORIG_COUNT" -eq "$REST_COUNT" ]; then
echo "验证通过"
else
echo "验证失败:文件数量不匹配"
fi
rm -rf $TEST_DIR
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 232 lines · 8 tokens per session scan C 012c96471fc5
backup-strategy is a skill published in the GitHub repository chaterm/terminal-skills (60 stars, last pushed 9mo ago), licensed Apache-2.0. It adds 8 tokens to every session and 1,596 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
backup-strategy compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| backup-strategychaterm/terminal-skills | Skill | 60 | 9mo ago | Apache-2.0 | C | 8 | Claude Code, Codex |
| c-filesdaxaur/openpaw | Skill | 183 | 6mo ago | MIT | A | 27 | Claude Code, Codex |
| skillci-guardrailskabirnarang39/skillci | Skill | 8 | 3mo ago | Apache-2.0 | A | 143 | Claude Code |
| example-skillkabirnarang39/skillci | Skill | 8 | 3mo ago | Apache-2.0 | A | 24 | Claude Code |
| clean-skillkabirnarang39/skillci | Skill | 8 | 3mo ago | Apache-2.0 | A | 23 | Claude Code |
| skill-with-referenced-issuekabirnarang39/skillci | Skill | 8 | 3mo ago | Apache-2.0 | A | 19 | Claude Code |
| councilhimanshufound/council | Skill | 3 | 4mo ago | Apache-2.0 | A | 135 | Claude Code, Codex |