/ Today I learnt / notes

TIL: not to re-download deleted files with rsync

December 22, 2019

I want to rsync files from one directory to another but then I want to delete files in the target directory and so rsync would not re-copy/re-download them.

Solution: use --exclude-from

--exclude-from option in rsync allows to supply rsync with a file that contains a list of files which to skip from synchronisation.

Simply add new synchronized files into that list after each synchronisation and run rsync with --exclude-from option.