Copy or rsync command

前端 未结 8 1315
广开言路
广开言路 2021-01-30 03:42

The following command is working as expected...

cp -ur /home/abc/* /mnt/windowsabc/

Does rsync has any advantage over it? Is there a better way

8条回答
  •  无人及你
    2021-01-30 04:14

    It's not really a question of what's more efficient.

    The commands 'rsync', and 'cp' are not equivalent and achieve different goals.

    1- rsync can preserve the time of creation of existing files. (using -a option)
    2- rsync will run multiprocess and transfer using either local sockets or network sockets. (i.e. fork itself into multiple processes)
    3- The multiprocessing, and threading will increase your throughput when copying large number of small files, and even with multiple larger files.

    So bottom line is rsync is for large data, and cp is for smaller local copying. (MB to small GB range). When you start getting into multiple GB or in the TB range, go with rsync. And of course network copies, rsync all the way.

提交回复
热议问题