{
 "kind": "app",
 "id": "app:rsync",
 "url": "https://headlesson.com/apps/rsync",
 "name": "rsync",
 "one_liner": "Command-line tool that syncs one folder into another, copying only new and changed files, with a dry run first and optional removal of files gone from the source.",
 "description": "rsync (3.5.0 from Homebrew in the trial) checks a source folder against a destination folder by size and mtime and copies only the files that differ. -n lists what would change, --delete removes destination files that are gone from the source, and --exclude skips patterns. It can also sync with another machine over ssh, which the trial did not try. macOS ships a different program, openrsync, under the same command name at /usr/bin/rsync.",
 "made_by_headlesson_operator": false,
 "interfaces": [
  {
   "kind": "cli",
   "name": "rsync",
   "install": "brew install rsync",
   "verify": "\"$(brew --prefix)/bin/rsync\" --version",
   "auth": "None for folders on the same machine.",
   "docs": "https://rsync.samba.org/"
  }
 ],
 "tests": [
  {
   "record_id": "test:sapv6c",
   "url": "https://headlesson.com/tests/sapv6c",
   "date": "2026-11-15",
   "version": "3.5.0 (protocol 32)",
   "status": "passed"
  }
 ],
 "latest_test_conclusion": "On 2026-11-15, the headlesson operator ran all 6 steps of this lesson with rsync 3.5.0 (protocol 32) (macOS 27.2 (26B123) arm64; existing Homebrew rsync 3.5.0 (brew list --versions: rsync 3.5.0, not reinstalled); bash -c with each exact step in a fresh empty folder; authored files only; no network), and all passed. The final Next step is advice and was not run. No independent check has been reviewed. This is the operator's own run, not a vendor claim.",
 "independent_check": {
  "state": "not_checked"
 },
 "lesson": {
  "goal": "Make a small source folder and a destination with one extra file, preview the sync with -n, then sync with --delete and --exclude '*.log', and list what the destination holds.",
  "steps": [
   "brew list --versions rsync || brew install rsync",
   "\"$(brew --prefix)/bin/rsync\" --version",
   "mkdir -p src/sub dst && printf 'one\\n' > src/a.txt && printf 'two\\n' > src/sub/b.txt && printf 'log\\n' > src/skip.log && printf 'old\\n' > dst/gone.txt",
   "\"$(brew --prefix)/bin/rsync\" -a -n -v --delete --exclude '*.log' src/ dst/",
   "\"$(brew --prefix)/bin/rsync\" -a -v --delete --exclude '*.log' src/ dst/",
   "find dst -type f | sort"
  ],
  "next_advice": "Next: Agree with the user on the real source and destination and on whether files missing from the source may be removed. Run the command with -n first and read the deleting lines, then run it without -n, and compare the two folders before relying on the copy.",
  "cautions": {
   "note": "These notes come from the lesson. Some describe failures seen in tests; others are general cautions. Each one is not a separately tested result.",
   "items": [
    "macOS has its own rsync at /usr/bin/rsync, which is openrsync (protocol 29, \"rsync version 2.6.9 compatible\"), not this program. Which one a bare rsync runs depends on PATH; in the trial /opt/homebrew/bin came first. Call the Homebrew binary by its full path when the difference matters.",
    "A trailing slash on the source matters. src/ dst/ copies the contents of src into dst; src dst/ (no slash) made dst/src. Both were checked against the source.",
    "The default check is size and modification time only. A file changed to other content of the same size with the same mtime was not copied, and -n -i did not list it; -c (--checksum) found and copied it (17 bytes), and a second -c run copied nothing.",
    "--delete removed the one destination file missing from the source (the -n run listed it as deleting sub/c.txt first). Without --delete the extra file stayed.",
    "Between two local folders rsync sends whole files. The update in the trial covered three files together (a.txt 750 bytes, big.bin 256 KiB with 64 changed bytes, and the new new.txt 60 bytes): by default the three sent 262,954 bytes of literal data in total. With --no-whole-file the same three sent 1,510 bytes literal and 261,444 bytes matched in total, and gave the same result.",
    "The -n run of the first copy printed \"created directory dst\" but did not create it. The output ends with (DRY RUN).",
    "With a missing source folder it exited 23 (\"change_dir ... failed: No such file or directory\") and still created the empty destination folder.",
    "Only folders on the same machine were tried. ssh, an rsync daemon, permissions and owners across machines, extended attributes and large trees were not tried.",
    "Confirm: Run with -n first and read every deleting line before using --delete on real folders; compare the destination with the source afterwards, and use -c when files can change without a new size or mtime."
   ]
  },
  "note": "This is the current lesson. The test record above was run on the lesson as it was at its own revision; they can differ."
 },
 "mcp_get": "headlesson_get id=\"app:rsync\" sections [\"lesson\",\"gotchas\"]",
 "axes": {
  "license": {
   "value": "GPL-3.0-or-later",
   "checked": "2026-11-15",
   "certainty": "secondary",
   "source": "operator-provided; not publicly verifiable",
   "by": "third-party"
  },
  "open_source": {
   "value": true,
   "checked": "2026-11-15",
   "certainty": "secondary",
   "source": "operator-provided; not publicly verifiable",
   "by": "third-party"
  },
  "pricing": {
   "value": "unknown",
   "checked": null,
   "certainty": null,
   "source": null,
   "by": null
  },
  "has_human_gui": {
   "value": "unknown",
   "checked": null,
   "certainty": null,
   "source": null,
   "by": null
  },
  "non_interactive": {
   "value": true,
   "checked": "2026-11-15",
   "certainty": "primary",
   "source": "headlesson editorial judgement",
   "by": "editorial"
  },
  "machine_output": {
   "value": "unknown",
   "checked": null,
   "certainty": null,
   "source": null,
   "by": null
  },
  "local_mcp": {
   "value": "unknown",
   "checked": null,
   "certainty": null,
   "source": null,
   "by": null
  },
  "remote_mcp": {
   "value": "unknown",
   "checked": null,
   "certainty": null,
   "source": null,
   "by": null
  },
  "cli": {
   "value": true,
   "checked": "2026-11-15",
   "certainty": "primary",
   "source": "headlesson editorial judgement",
   "by": "editorial"
  },
  "rest_api": {
   "value": "unknown",
   "checked": null,
   "certainty": null,
   "source": null,
   "by": null
  },
  "auth": {
   "value": "none",
   "checked": "2026-11-15",
   "certainty": "inferred",
   "source": "headlesson editorial judgement",
   "by": "editorial"
  },
  "self_hostable": {
   "value": true,
   "checked": "2026-11-15",
   "certainty": "inferred",
   "source": "headlesson editorial judgement",
   "by": "editorial"
  },
  "embeds_llm": {
   "value": "unknown",
   "checked": null,
   "certainty": null,
   "source": null,
   "by": null
  },
  "refusal_contract": {
   "value": "unknown",
   "checked": null,
   "certainty": null,
   "source": null,
   "by": null
  },
  "audit_log": {
   "value": "unknown",
   "checked": null,
   "certainty": null,
   "source": null,
   "by": null
  },
  "last_release": {
   "value": "unknown",
   "checked": null,
   "certainty": null,
   "source": null,
   "by": null
  },
  "ja_support": {
   "value": "unknown",
   "checked": null,
   "certainty": null,
   "source": null,
   "by": null
  }
 },
 "sources": [
  {
   "fields": [
    "/name",
    "/one_liner",
    "/description",
    "/lesson/steps/0",
    "/lesson/steps/1",
    "/lesson/steps/2",
    "/lesson/steps/3",
    "/lesson/steps/4",
    "/lesson/steps/5",
    "/lesson/cautions/items/0",
    "/lesson/cautions/items/1",
    "/lesson/cautions/items/2",
    "/lesson/cautions/items/3",
    "/lesson/cautions/items/4",
    "/lesson/cautions/items/5",
    "/lesson/cautions/items/6",
    "/interfaces/0/kind",
    "/interfaces/0/name",
    "/interfaces/0/install",
    "/interfaces/0/verify",
    "/interfaces/0/docs",
    "/axes/non_interactive",
    "/axes/cli"
   ],
   "source": "headlesson editorial judgement",
   "checked": "2026-11-15",
   "certainty": "primary",
   "by": "editorial"
  },
  {
   "fields": [
    "/lesson/goal",
    "/lesson/next_advice",
    "/lesson/cautions/items/7",
    "/lesson/cautions/items/8",
    "/interfaces/0/auth",
    "/axes/auth",
    "/axes/self_hostable",
    "/relations/0"
   ],
   "source": "headlesson editorial judgement",
   "checked": "2026-11-15",
   "certainty": "inferred",
   "by": "editorial"
  },
  {
   "fields": [
    "/axes/license",
    "/axes/open_source"
   ],
   "source": "operator-provided; not publicly verifiable",
   "checked": "2026-11-15",
   "certainty": "secondary",
   "by": "third-party"
  }
 ],
 "primary_record": "Test results here are the operator's own past lesson trials (legacy). They are not claimed to meet level L1 of run-task-contract/0.1.0.",
 "relations": [
  {
   "type": "alternative-to",
   "to": "app:macos-rsync",
   "url": "https://headlesson.com/apps/macos-rsync",
   "scope": "usecase:sync-folders"
  }
 ],
 "relations_not_published": 1,
 "cite": "headlesson app:rsync: see test record test:sapv6c (https://headlesson.com/tests/sapv6c).",
 "page_updated": "2026-11-17"
}
