Difference between revisions of "Copy files to remote server"
Line 12: | Line 12: | ||
If you wan to resume broken scp transfer try with rsync: | If you wan to resume broken scp transfer try with rsync: | ||
+ | rsync --append-verify --progress --rsh="ssh -p 4567" me@localhost:/path/to/large/file.gz | ||
+ | |||
+ | Better next time use rsync from beginning :) | ||
rsync --partial --progress --rsh=ssh user@host:remote_file local_file | rsync --partial --progress --rsh=ssh user@host:remote_file local_file | ||
or | or |
Latest revision as of 06:05, 1 July 2015
How to copy files to remote server using command line
1. Rsync. We are assuming that the ssh keys are already configured.
rsync -av -e 'ssh -p22' /path/to/file IP:/path
2. Scp
scp -P 22 /path/to/file username@remoteserver.tld:/path/to/remote/directory/
Add -r for recursive (copy all directory with subdirs):
scp -r -P 22 /path/to/file username@remoteserver.tld:/path/to/remote/directory/
If you wan to resume broken scp transfer try with rsync:
rsync --append-verify --progress --rsh="ssh -p 4567" me@localhost:/path/to/large/file.gz
Better next time use rsync from beginning :)
rsync --partial --progress --rsh=ssh user@host:remote_file local_file
or
rsync -avz -e ssh remoteuser@remotehost:/remote/path /local/path