Automated Data Backup: a Tokeny case study
Periodically back up files from specified directories to designated locations with incremental backup support. Follow the recorded task, execution screenshots, actual files and verification notes.
By the Tokeny team · Windows · Tokeny 1.7.8 · gpt-6-sol
Prepare the inputs
Create a separate workspace in Tokeny, download and unpack the sample inputs, then select a model that supports tools. The sample uses synthetic data or the public sources named in the article.
- input/a.txt
- input/b.txt
Send the task to Tokeny
The original task was executed in Chinese. Copying these instructions reproduces the same task; the results below include an English report.
实现仅针对当前目录 input/ 的增量备份脚本,第一次备份后修改一个演示文件再运行一次,记录拷贝与跳过项并校验哈希。不删除源文件或历史备份。 交付文件:backup.py、backup-log.json、backup-manifest.json。 验收要点: - 两次执行有记录 - 第二次仅复制变化文件 - 源文件和备份哈希可核对 这是使用合成演示输入或指定公开资料的真实操作案例。请先读取工作空间输入,再实际生成文件并自检。所有写入、脚本与临时服务限于当前工作空间;临时服务只监听 127.0.0.1,执行后关闭;不触达外部收件人、不发布、不付款、不更改系统设置,不调用子智能体。需要公开资料时可读取给定 URL。只启用完成任务必需的工具。另写 report.md(中文)和 report.en.md(英文),简洁、完整,包含输入、处理步骤、真实结果、检查方式和局限;失败或未验证部分如实记录,不能宣称成功。最终回复用中文列出产物、关键结果与待核实项。 排版检查:Word 主标题仅出现一次,标题为黑色且与后续正文或表格保持同页;表格的标题、表头和第一条数据保持同页,单行不要跨页拆分;Excel 表头和长文字不能被窄列截断,合理设置列宽、换行、行高;HTML 在 390px 视口不能整页横向溢出。临时网络服务请用系统分配端口(0),记录实际端口,不使用固定端口,避免并发案例互相访问。报告没有固定字数要求,不要为字数反复改写。
Follow-up instructions after review (1)
独立复核发现 backup.py 对变化文件使用 copy2 覆盖原备份,不能保留历史版本。请修复为真正保留历史的增量备份:保留现有输入和备份,不删除既有日志;改用内容哈希对象或版本目录保存不可变版本,再用最新清单引用。使用当前 input/a.txt、input/b.txt 作为本轮基线,先备份,追加一次新的演示变更到 a.txt,再备份,最后再无变化运行一次。实际验证前后两个版本都可从备份恢复,b.txt 不被重复复制、第三次都跳过,并把版本路径与哈希写入 backup-manifest.json,追加 backup-log.json。报告如实说明最初实现曾覆盖旧版本,原始首次备份不能声称已保留,升级后的实测从当前基线开始。
The recorded run used an isolated demonstration workspace. Review the commands and file paths before approving operations in your own workspace.
What actually ran
The task was submitted through the Tokeny input box. An online model read the inputs and executed tools. This run covers the local sample task and its actual files. Results and checks are recorded below.
Results and verification
Input and Historical Boundary
This round used the current input/a.txt (56 bytes) and input/b.txt (22 bytes) as its baseline. The previous script copied changed files to the fixed backup/a.txt path and overwrote earlier contents; the original first-ever version of a.txt was not retained and is not claimed to be recoverable. The first two log entries remain, and the legacy flat backups backup/a.txt and backup/b.txt were not deleted. Immutable version history begins with run 3.
Steps and Actual Results
Upgraded backup.py to store content under backup/objects/sha256/<hash>. The manifest records each file's immutable version path, hash, size, originating run, and latest reference. Run entries are appended to the existing log.
| Log run | Operation | Copied | Skipped |
|---|---|---|---|
| 3 | Back up current baseline | a.txt, b.txt | None |
| 4 | Append one line to input/a.txt and back up | a.txt | b.txt |
| 5 | Run again without changes | None | a.txt, b.txt |
There are 5 log entries (2 legacy and 3 new). Recoverable versions in this round:
- Baseline
a.txt:backup/objects/sha256/49ce70f2ac0124e2b3d0cbcdc75c856cf43bc9e65b7d2eeb764f67c48a2df837; SHA-25649ce70f2ac0124e2b3d0cbcdc75c856cf43bc9e65b7d2eeb764f67c48a2df837. - Updated
a.txt:backup/objects/sha256/002a17c09c1f50d7220d442489b23f9f90757e6ca51d7a8c054aa28918678188; SHA-256002a17c09c1f50d7220d442489b23f9f90757e6ca51d7a8c054aa28918678188. - The sole
b.txtobject:backup/objects/sha256/61a5d0fe18e01fe734ccc7860a88e25b1b026f585cff8b15caa6c6f2ed88cf4c; its SHA-256 matches the filename.
Verification
Both a.txt objects were actually restored to .tmp/tokeny/backup-restore-20261107/a-version-1.txt and a-version-2.txt. The restored files differ, each hash matches the manifest, and version 2 matches current input/a.txt byte for byte. Checks also covered all object hashes, source hashes against latest manifest references, preservation of old log entries and flat backups, no second copy of b.txt in run 4, and both files skipped in run 5.
Limitations
The original first-ever a.txt content overwritten before the upgrade was not recovered; this round's baseline is the then-current input/a.txt. Objects for removed source files are not deleted. Concurrent runs, source mutation during copying, permission failures, symbolic links, and large-scale performance were not tested. No network service was started. Word, Excel, and HTML layout checks do not apply to these Markdown, JSON, and Python deliverables.
Download and inspect the outputs
The archive contains the files created during this run. Use these checks when adapting the example to your own data.
- Reconcile the reported results against the downloadable sample inputs.
- Open the generated files and check the contents relevant to your task.
- Review the limitations and any unverified steps in the report.
