【发布时间】:2013-10-11 09:09:56
【问题描述】:
我目前正在使用 BusyBox v1.16.2 并且 cp 命令不提供更新选项:
...
-u, --update
copy only when the SOURCE file is newer than the destination file
or when the destination file is missing
还有其他选择吗?
我会考虑使用 find --newer 参数,但我正在尝试弄清楚如何做到这一点(经过几次尝试......)。
BusyBox v1.16.2 multi-call binary.
Usage: cp [OPTIONS] SOURCE DEST
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY
Options:
-a Same as -dpR
-R,-r Recurse
-d,-P Preserve symlinks (default if -R)
-L Follow all symlinks
-H Follow symlinks on command line
-p Preserve file attributes if possible
-f Force overwrite
-i Prompt before overwrite
-l,-s Create (sym)links
【问题讨论】:
-
我看到
cp有-n, --no-clobber ---> do not overwrite an existing file。对你有用吗? -
@fedorqui Busybox 提供了一个有限版本的 cp。我为busybox cp 添加了当前选项。所以没有 -n 选项。
标签: linux unix embedded cp busybox