Copy or rsync command

前端 未结 8 1319
广开言路
广开言路 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:33

    Especially if you use a copy-on-write filesystem like BTRFS or ZFS, rsync is much better.

    I use BTRFS, and I have this in my ~/.bashrc:

    alias cp="rsync -ah --inplace --no-whole-file --info=progress2"
    

    The important flag here for CoW FSs like BTRFS is --inplace because it only copies the changed part of the files, doesn't create new for small changes between files inodes, etc. See this.

提交回复
热议问题