Skip to content
Bodylet AIBodylet AI
All pages

Moving files

Agents, and you with the bodylet command, reach the files of a machine only in the folders its owner opened. A path is always the machine's own full path: /home/ana/notes.txt on Linux, C:\Users\ana\notes.txt on Windows.

What you can do#

ToCommandSize
See the folders opened to agentsbodylet files ls MACHINE
List one folderbodylet files ls MACHINE PATH
Print a text filebodylet files cat MACHINE PATH1 MiB at a time
Create or replace a small filebodylet files write MACHINE PATHUp to 256 KiB
Copy a file from your computer to a machinebodylet files put MACHINE LOCAL PATHUp to 1 GiB
Copy a file from a machine to your computerbodylet files get MACHINE PATH [LOCAL]Up to 1 GiB
Copy a file or a folder from one machine to anotherbodylet files transfer SOURCE DESTINATIONUp to 8 GiB

Every copy is checked: the file is saved only once its SHA-256 checksum is the same at both ends.

Copy between two machines#

With the command line:

Terminal
bodylet files transfer build-box:/home/ana/out/app 'office-pc:C:\Users\ana\Shared\app'

SOURCE and DESTINATION are MACHINE:PATH. Put quotes around a Windows path so that your shell keeps its backslashes.

  • The bytes never pass through your computer. They go from one machine to the other through Bodylet, which keeps nothing. Both machines must be online.
  • A folder travels whole. Its files and subfolders arrive together. Symbolic links are skipped, and the command says how many. The destination checks every name before it writes anything, so a refused folder leaves nothing behind.
  • The copy is put in place only when it is right. Its SHA-256 must match the source's. If you know the checksum the file should have, add --sha256 <checksum> to require it too.
  • Options. --overwrite replaces what is at the destination. --create-parents creates missing folders. --detach starts the copy and returns at once.

It needs: Read files on the source machine and Write files on the destination, on the agent's token; both paths inside folders the owners opened (the destination's folder opened for writing); and Bodylet 0.8.0 or later on both machines (bodylet version on each).

When the connection is cut#

You do not need to start a copy again after a network cut.

CopyWhat happens after a cut
files transferThe copy waits. Once both machines are back, it goes on from where the destination stopped, within its time limit (one hour unless you give --timeout SECONDS)
files putThe upload goes on from the bytes Bodylet already received
files getThe download goes on from the last byte saved. Running the same command again after a stop also goes on where it stopped

Ctrl-C stops the bodylet command, not a transfer: the copy goes on. Follow it with bodylet job ID --wait, or stop it with bodylet cancel ID. Do not start the same copy a second time.

Small text files#

cat and write are for notes, settings and short logs:

Terminal
bodylet files cat build-box /home/ana/notes.txt
bodylet files write build-box /home/ana/todo.txt < todo.txt

write refuses to replace a file that exists unless you add --overwrite. A file that is not text cannot be printed: use files get.

Open a folder to agents#

On the machine, its owner opens a folder, for reading or for reading and writing:

Terminal
bodylet policy allow files.read ~/Shared            # read
bodylet policy allow files.read ~/Shared --write    # read and write

Agents reach nothing outside the folders you open, and never the files of Bodylet itself. See Folders.