I'm executing the following two rsync
commands. In the first command, I'm copying files from source to destination and in the second command I'm then checking the files and delete the files in source.
rsync --info=progress2 -r /local/data/ /import/myNAS/data
rsync --info=progress2 -r --checksum --remove-source-files /local/data/ /import/myNAS/data
I would like to only copy and remove files from source to destination which do not exists already in destination. I could do this using the --ignore-existing
flag but with this flag files are copied when they are newer. I would like to have a check only on name and not timestamp. That means when a file with the same name exists in destination, the file should not be copied from source and should also not be deleted from source.
Is this possible?
--checksum
. Replace-r
with-a
. Discard the first of the two commands. – roaima Aug 17 '20 at 23:48--checksum
? – machinery Aug 18 '20 at 17:27rsync
will just copy the files in their entirety. With it, it will checksum the files and then copy them anyway. – roaima Aug 18 '20 at 18:02