Transfer files
You can leave out the VPS name below when your Account has one VPS: write :path instead
of my-vps:path. With several, lt asks which one, or you pass its name or ID.
lt cp ./project my-vps:work # upload the folder project into ~/worklt cp my-vps:work/report.pdf . # download a filelt cp notes.md todo.md :inbox/ # several files at onceOne side is on your computer and the other on the VPS, written vps:path. A path on the VPS
starts in your home folder there (/home/dev), so my-vps:work is ~/work. Folders are
copied with everything in them.
foldercopies the folder itself;folder/copies what is inside it.- Only files that changed are sent, compressed. Add
--no-compressfor files that are already compressed, like videos or archives. - If a copy is interrupted, run the same command again: it continues where it stopped.
lt cp uses rsync over the same private SSH connection as lt term-ssh. Install rsync if
your computer doesn’t have it:
sudo apt install rsync # Debian, Ubuntubrew install rsync # macOSWithout it, lt cp says so and copies with scp instead, which sends every file again.
Between two VPSs
Section titled “Between two VPSs”lt cp box-a:work box-b: # ~/work on box-a into the home folder on box-blt cp box-a:site/ box-b:site # what is inside ~/site on box-a into ~/site on box-bName both VPSs. The files go through your computer, but are not saved on it, and you don’t need rsync for this. The copy always sends everything, and it doesn’t resume: if it is interrupted, run it again and it starts from the beginning.
If the destination is an existing folder, or ends with /, the files go inside it.
Otherwise a single file is saved under the destination’s name, and a folder or several files
become a new folder with that name.
To copy within one VPS, open a terminal there with lt term-ssh my-vps and run cp -a work work-copy.
lt sync
Section titled “lt sync”lt sync ./site my-vps:site # make ~/site on the VPS match ./sitelt sync my-vps:site ./site # the other way roundlt sync makes the destination folder an exact copy of the source folder: new and changed
files are copied, and files the source doesn’t have are deleted from the destination.
Before deleting anything, lt sync lists the files it would delete and asks you to confirm.
When nothing would be deleted, it just syncs. Add --yes to skip the question, for example
in a script, where lt sync otherwise stops without changing anything.
To leave files out, add --exclude, or list patterns in a .ltignore file in the folder on
your computer, one per line, in rsync’s exclude format:
node_modules/*.log.envFiles left out are neither copied nor deleted on the other side.
lt sync needs rsync on your computer.