From 1c0514753e1415ff26b3aed6ff05d57ac3b4337d Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 11 Jul 2026 09:09:54 +0000 Subject: [PATCH 1/2] Update cp docs: permissions preserved by default Co-Authored-By: Claude Opus 4.6 (1M context) Claude-Session: https://claude.ai/code/session_01E46cVmU8tP3pJ1pzviLmzv --- docs/cli/manage-your-fleet.md | 3 ++- docs/cli/reference.md | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/cli/manage-your-fleet.md b/docs/cli/manage-your-fleet.md index a78c54ba19..2326e941b3 100644 --- a/docs/cli/manage-your-fleet.md +++ b/docs/cli/manage-your-fleet.md @@ -114,7 +114,8 @@ Copy a directory recursively: viam machines part cp --part= -r ./local-dir machine:/home/user/ ``` -Preserve file permissions and timestamps: +File permissions are preserved by default, matching `scp` behavior. +Use `--preserve` to also keep modification timestamps and force exact permission bits (bypassing umask): ```sh {class="command-line" data-prompt="$"} viam machines part cp --part= -r --preserve ./local-dir machine:/home/user/ diff --git a/docs/cli/reference.md b/docs/cli/reference.md index 11c7c7861d..11a91c0cb3 100644 --- a/docs/cli/reference.md +++ b/docs/cli/reference.md @@ -1260,7 +1260,7 @@ viam machines part cp --part=123 my_file machine:/home/user/ # Recursively copy a directory to a machine: viam machines part cp --part=123 -r my_dir machine:/home/user/ -# Copy multiple files to a machine with recursion and keep original permissions and metadata for the files: +# Copy multiple files to a machine with recursion and preserve exact permissions and timestamps: viam machines part cp --part=123 -r -p my_dir my_file machine:/home/user/some/existing/dir/ # Copy a single file from a machine to a local destination: @@ -1269,7 +1269,7 @@ viam machines part cp --part=123 machine:my_file ~/Downloads/ # Recursively copy a directory from a machine to a local destination: viam machines part cp --part=123 -r machine:my_dir ~/Downloads/ -# Copy multiple files from the machine to a local destination with recursion and keep original permissions and metadata for the files: +# Copy multiple files from the machine to a local destination with recursion and preserve exact permissions and timestamps: viam machines part cp --part=123 -r -p machine:my_dir machine:my_file ~/some/existing/dir/ ``` @@ -1278,7 +1278,7 @@ viam machines part cp --part=123 -r -p machine:my_dir machine:my_file ~/some/exi | -------- | ----------- | --------- | | `--part` | Part ID for which the command is being issued. | **Required** | | `--recursive`, `-r` | Recursively copy files. Default: `false`. | Optional | -| `--preserve`, `-p` | Preserve modification times and file mode bits from the source files. Default: `false`. | Optional | +| `--preserve`, `-p` | Preserve modification times and set exact file permissions from the source, bypassing umask. File permissions are always transferred by default; this flag additionally preserves timestamps and forces exact permission bits. Default: `false`. | Optional | ### `machines part tunnel` From beec185fcf72c183f8a7c299688c4d94b346034f Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 15:37:39 +0000 Subject: [PATCH 2/2] Address review: use umask terminology per code author --- docs/cli/manage-your-fleet.md | 4 ++-- docs/cli/reference.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/cli/manage-your-fleet.md b/docs/cli/manage-your-fleet.md index 2326e941b3..9dd6926706 100644 --- a/docs/cli/manage-your-fleet.md +++ b/docs/cli/manage-your-fleet.md @@ -114,8 +114,8 @@ Copy a directory recursively: viam machines part cp --part= -r ./local-dir machine:/home/user/ ``` -File permissions are preserved by default, matching `scp` behavior. -Use `--preserve` to also keep modification timestamps and force exact permission bits (bypassing umask): +File permissions are preserved by default, respecting the destination `umask`. +Use `--preserve` to also keep modification timestamps and force exact permission bits (overriding the destination `umask`): ```sh {class="command-line" data-prompt="$"} viam machines part cp --part= -r --preserve ./local-dir machine:/home/user/ diff --git a/docs/cli/reference.md b/docs/cli/reference.md index 3104aa4589..15bb15dba6 100644 --- a/docs/cli/reference.md +++ b/docs/cli/reference.md @@ -1278,7 +1278,7 @@ viam machines part cp --part=123 -r -p machine:my_dir machine:my_file ~/some/exi | -------- | ----------- | --------- | | `--part` | Part ID for which the command is being issued. | **Required** | | `--recursive`, `-r` | Recursively copy files. Default: `false`. | Optional | -| `--preserve`, `-p` | Preserve modification times and set exact file permissions from the source, bypassing umask. File permissions are always transferred by default; this flag additionally preserves timestamps and forces exact permission bits. Default: `false`. | Optional | +| `--preserve`, `-p` | Preserve modification times and set exact file permissions from the source, overriding the destination `umask`. File permissions are always transferred by default; this flag additionally preserves timestamps and forces exact permission bits. Default: `false`. | Optional | ### `machines part tunnel`