How does `scp` differ from `rsync`?

后端 未结 7 2050
失恋的感觉
失恋的感觉 2020-12-04 04:58

An article about setting up Ghost blogging says to use scp to copy from my local machine to a remote server:

scp -r ghost-0.3 root@*your-server-         


        
7条回答
  •  不知归路
    2020-12-04 05:12

    Difference b/w scp and rsync on different parameter

    1. Performance over latency

    • scp : scp is relatively less optimise and speed

    • rsync : rsync is comparatively more optimise and speed

    https://www.disk91.com/2014/technology/networks/compare-performance-of-different-file-transfer-protocol-over-latency/

    2. Interruption handling

    • scp : scp command line tool cannot resume aborted downloads from lost network connections

    • rsync : If the above rsync session itself gets interrupted, you can resume it as many time as you want by typing the same command. rsync will automatically restart the transfer where it left off.

    http://ask.xmodulo.com/resume-large-scp-file-transfer-linux.html

    3. Command Example

    scp

    $ scp source_file_path destination_file_path
    

    rsync

    $ cd /path/to/directory/of/partially_downloaded_file
    $ rsync -P --rsh=ssh userid@remotehost.com:bigdata.tgz ./bigdata.tgz 
    

    The -P option is the same as --partial --progress, allowing rsync to work with partially downloaded files. The --rsh=ssh option tells rsync to use ssh as a remote shell.

    4. Security :

    scp is more secure. You have to use rsync --rsh=ssh to make it as secure as scp.

    man document to know more :

    • scp : http://www.manpagez.com/man/1/scp/
    • rsync : http://www.manpagez.com/man/1/rsync/

提交回复
热议问题