cp command, ignore unchanged files
Is there a way to do a cp
but ignoring any files that may already exist at the destination that aren't any older then those files at source.
Basically I want to copy the contents of one disk to another, then run the copy again but only updating new files or files that have been updated on the source side.
Thanks
use this:
rsync -a /source /destination
Alternatively, you can get more details with a few other flags like -v
or --progress
.
from the cp
manpage:
-u, --update
copy only when the SOURCE file is newer than the destination file or when the
destination file is missing
Use rsync, problem solved.
rsync -av /srcdir /tgtdir