Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/cli/manage-your-fleet.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ Copy a directory recursively:
viam machines part cp --part=<part-id> -r ./local-dir machine:/home/user/
```

Preserve file permissions and timestamps:
File permissions are preserved by default, matching `scp` behavior.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change "matching scp behavior" to "respecting the destination umask"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in beec185.


Generated by Claude Code

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=<part-id> -r --preserve ./local-dir machine:/home/user/
Expand Down
6 changes: 3 additions & 3 deletions docs/cli/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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/
```

Expand All @@ -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 |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change "bypassing umask" to "overriding the destination umask"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in beec185.


Generated by Claude Code


### `machines part tunnel`

Expand Down
Loading