The problem is for rsync to tell the difference between a file that was deleted from the local cache, and a file that was never there.
The --exclude-from=FILE could solve that problem, but maybe not very conveniently. Another method might be to replace the files in the local cache with empty files, that are 'newer on the receiver' and use the --update option.
Code:
-u, --update skip files that are newer on the receiver
-u, --update
This forces rsync to skip any files which exist on the destination and have a modified
time that is newer than the source file. (If an existing destination file has a modifi‐
cation time equal to the source file’s, it will be updated if the sizes are different.)
Note that this does not affect the copying of symlinks or other special files. Also, a
difference of file format between the sender and receiver is always considered to be
important enough for an update, no matter what date is on the objects. In other words,
if the source has a directory where the destination has a file, the transfer would occur
regardless of the timestamps.
This option is a transfer rule, not an exclude, so it doesn’t affect the data that goes
into the file-lists, and thus it doesn’t affect deletions. It just limits the files
that the receiver requests to be transferred.
You can use an alias or script with removes and touches a file with a particular name, so that an empty file with that particular name will be there with a newer time stamp, like this very simple example
Code:
#!/bin/bash
rm "$1" && touch "$1"
Bookmarks