Simply copying is not enough. You have to assume that the file transfer will fail at some point. So you need some kind of checkpointing where you can start again.

rsync: https://linux.die.net/man/1/rsync

Pasted image 20250331140553.png

Test it

Notice that there is no final slash at the end of the from path. This is to copy the contents of the from folder and not the from folder itself.

rsync -anv Path/from/ Path/to

This will give a summary of what will happen before executing it.

Execute

  1. Create the path to folder

rsync -avP Path/from/ Path/to

-a: Combination flag. Syncs recursively and preserved symbolic links.
-v: verbose, get more information
-P: preserve permissions, if it is not set, the receiving system will set default permissions

what about ssh?

rsync -avP Path/from/ user@remote_host:/Path/to

Further notes

-z: if sending non compressed data, you can potentially accelerate the file transfer with this flag. It will add compression as a step to the file transfer.