Move files between machines
This guide moves files from a folder on one machine to a folder on another. Both machines run
xixo link. You need xixo:resources:command, and you must be an
administrator or an operator of both machines.
What a move does
Section titled “What a move does”xixo copies each file to the machine it goes to. Both machines compute the file’s SHA-256, and the original is removed only when the two match. Folders the move leaves empty are removed too.
- A file the catalog already knows keeps its item and its analysis. Its reference moves to the new path.
- The files do not have to be synced first, and a move queues no analysis. The next sync of the folder the files went to finds the files that are new to the catalog.
- The two folders must be on different machines.
- xixo link never reads the names it skips,
such as
.gitandnode_modules. A move leaves those where they are.
Paths keep their shape:
| Moved | Into | Photos/2019/a.jpg lands at |
|---|---|---|
The folder Photos/2019 |
Archive |
Archive/2019/a.jpg |
| Everything in the folder | Archive |
Archive/Photos/2019/a.jpg |
| Everything in the folder | the top | Photos/2019/a.jpg |
| A selection of files | Inbox |
Inbox/a.jpg |
A move never overwrites a file:
- When the new path already holds the same bytes, the original is removed. This is how a move that stopped part way finishes.
- When the new path holds other bytes, both files stay.
- When the copy does not match the original, the copy is removed and the original stays.
- A file another move is carrying stays where it is.
The run’s log names each file that stayed, and why.
Prepare the machines
Section titled “Prepare the machines”-
Share both folders writable. On each machine, run the link-up command again with every folder it shares, and end each folder a move reads from or writes to with
:rw:Terminal window curl -fsSL https://xixo.example.com/link.sh | sh -s -- ~/Documents ~/Pictures:rwThe list replaces the folders the machine shared before. A folder must exist before it is shared, and xixo link’s user must be able to write into it.
-
On Resources, check that each machine’s card lists the folder with Read and write. Each folder joins the catalog by itself. See folders it shares.
Move from the app
Section titled “Move from the app”- On Resources, open the More menu of the folder the files leave, and choose Move files…. The menu shows it only for a folder its machine shares writable.
- Under Folder or file, type a path inside the folder, such as
Photos/2019. Left empty, everything in the folder moves. - Under Move to, pick the folder the files go to.
- Under Into, type a folder inside it if you want one. Left empty, the files land at its top.
- Choose Move.
The dialog shows how many files and bytes have moved. The move keeps going after you choose Close. Stop the move stops it after the files it is moving.
To move files from the catalog, pick a type, type a search, or set filters, then choose Move these… in the More menu. The dialog says which filters it keeps. On a view’s page, the move takes what the view lists. On a file’s own page, choose Move to… in the menu beside its title.
When the run ends, What it has done on the folder the files went to shows it.
Move over GraphQL
Section titled “Move over GraphQL”moveFiles takes destinationId and an optional into. Name the files with sourceId and an
optional path, or with feedIds, query, type, and slice. slice narrows the files the way
the catalog’s filters do.
mutation { moveFiles(input: { sourceId: "21", path: "Photos/2019", destinationId: "34", into: "Archive" }) { run { id status } }}Query run with the run’s id for its status and its moved counts, and call cancelRun to stop
it. See the GraphQL reference.
Move over MCP
Section titled “Move over MCP”-
Call the
movetool with the key of the folder the files leave, a path inside it, and the key of the folder they go to:{ "from": "pictures", "path": "Photos/2019", "to": "archive", "into": "Archive" }Without
from, name the files withids,query,type,machine_id,analysis, andkind. -
Call it with the run’s id to see how far the move has come:
{ "run": "55" } -
To stop the move, add
"stop": trueto the same call.
Moves count against the MCP run budget. See the MCP reference.
If it doesn’t work
Section titled “If it doesn’t work”- “shares
<folder>read-only”: share the folder writable, as in prepare the machines. Nothing has moved. - “leaves write out of tools”: the machine’s configuration lists
toolswithoutwrite. Addwritetotoolsin xixo link’s configuration on the machine, or removetoolsto allow every tool. Nothing has moved. - “are both on
<machine>”: pick a folder on another machine. Nothing has moved. - “only an operator of
<machine>”: an administrator adds you to Who operates it under Change in the machine’s More menu. - The run ends
failedwith “N of M files stayed where they were”: read the log, fix the cause, and start the same move again. Only the files that stayed move. - A machine is not connected: the move tries again every two minutes for an hour, then fails. Start it again once both machines are connected.
- The run stays
queued: no worker is running. See self-hosting.