I know I can use cp to copy all folder $HOME/data/ to another location. Something like to locally attached USB pen
cp -avr $HOME/data/ /mnt/usbdisk/
What I wanna know is how do we copy folder and contents in Linux to remote server? We have another branch office and they attached external hard disk. So how to tell cp to copy $HOME/data/ to server in another city?
Syncthing. Very involved initially, but when it’s running it’s great. You’ll be having identical copies of folders in multiple places though, but I reckon you’ll be anyway.
mount something like SFTP (through SSHFS). Might be unstable, though.
use SFTP without mounting.
Both SFTP options are pretty bad in the sense you’re sending data over an FTP protocol (encrypted by SSH), so you need to send whole files (and folders) to update something, which is usually a manual process. So, I don’t recommend [S]FTP.