I am using rsync to backup some large files regularly:
rsync --archive --update --append-verify [source] [destination]
Most of the times, the files increase in size (like a log file), but sometimes they are "reset" to empty, from which point they start growing again.
Now, the problem is, with either --append or --append-verify, the files that have been reset will be completely ignored/skipped, according to the rsync man page:
"If a file needs to be transferred and its size on the receiver is the same or longer than the size on the sender, the file is skipped."
I would like to achieve the following rsync behavior:
- REPLACE if the source file is smaller than the destination file, otherwise
- VERIFY that the destination file matches the first part of source file. If not, REPLACE the destination file
- APPEND if the source file is bigger than the destination file
Is this possible?