문제

I'm currently using a BusyBox v1.16.2 and cp command does not provide update option:

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

Is there any alternative?

I would think of using find --newer parameter, but I'm trying to figure out how to do it (after a few tries...).

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
도움이 되었습니까?

해결책

test file1 -ot file2 && cp file2 file1
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top