lws - this is half (sort of) correct:
By default rsync will check based on mod-time OR file size. You can skip mod-time check by passing
--size-only, which would make the above a non-issue.
Also, the selling point of rsync is efficient delta transfers is it not? rsync doesn’t just send the whole file, it’ll only send the differences. So even if the files were marked for transfer thanks to changing mod-time, the actual transfer of data would be tiny as the difference between the files would be zero (it’s the same file, just different mod-time).
So it’s doubly a non-issue.
In either case, you can skip that whole issue entirely by simply passing
--checksum into your rsync command to skip the files based on checksum and not size or mod-time. That’ll checksum each file being transferred and on the server to compare what needs to be updated/deleted.
There’s a case to make for doing this anyway on the off chance something has altered the files on the server and using this method you know you are replacing files with exactly what you’ve generated on your machine, but I digress.
There is also a performance penalty for using
--checksum so if you have a massive site to transfer be aware of that, but the default options are more sophisticated than just sending everything if the mod-time changes, but I digress further.
Upshot is, there may be reasons to run Hugo on the server (good ones too) but rsync transfers isn’t really one of them.