cp命令,忽略不变的文件

有没有办法做一个cp但忽略任何文件,可能已经存在的目的地是没有任何年龄大于那些源文件。

基本上我想复制一个磁盘的内容到另一个,然后再次运行该副本,但只更新新的文件或已在源端更新的文件。

谢谢

用这个:

 rsync -a /source /destination 

或者,您可以使用其他一些标志(如-v--progress来获取更多详细信息。

使用rsync,问题解决了。

 rsync -av /srcdir /tgtdir 

cp页:

  -u, --update copy only when the SOURCE file is newer than the destination file or when the destination file is missing