rsync -av /from/a/dir1/ /to/some/other/dir2/ --no-perms --no-owner --no-group --no-times --exclude=/from/a/dir1/excludeDir/
Use -avn
to perform a dry run — it will only show the files that would have been transferred, and won’t actually copy anything.
Notice that if you use dir1/
and dir2/
(with the trailing slash) all of the files inside dir1
will be copied inside dir2
. If you leave the slash out, you will also copy the dir1
directory itself.
References:
Copy new files only – is this possible? Basically want to merge two folders
rsync ignore owner, group, time, and perms