I have a folder on the flash drive connected to my router where i copy files that should synced to my HTPC when its starting. At start there ths little sync script is running
rsync --remove-source-files --ignore-existing -a source/ destination
This moves files to the HTPC and deletes the files on the source dir. But when the file already exists nothing is copied (there is no check for timestamps, only a file name check). But i want to delete the files in the source dir when rsync recognizes that there is already a file with the same name in the destination dir.
Can this be done with rsync?
Good question. I have a similar use case, where I used filezilla to perform my upload (as it would - in this particular case - be faster due to parallel connections) and wanted rsync to merely do verification and delete transferred source files.
I forced rsync to do that with -c. Only then, it would also delete the source files where it wouldn't do so before, with the normal skip check (based on size+time).
source/to be empty after thersyncoperation, no matter what? Why not just remove it and recreate it withrm -rf source; mkdir sourceafter thersynccommand in that case? - Kusalananda