====== 2026-01-11 - rsync and defaults ====== i really like [[wp>rsync]]. there's sth brilliant in how it's (conceptually) simple and yet so powerful. there are however gotchas. recently i've noticed, when i sync data between some of my machines, there are certain files that are ~always re-synced (despite not being changed) as well as there are files that sync once, and then cause errors to sync after that. to debug this it's worth using ''--itemize-changes'' that outputs a reason why a given file was synced. format is a bit cryptic, but after a moment with docs, it turned out that there's a bit of time offset (we're talking some tens of milliseconds, to be clear!) between source and target machines. this caused those "unfortunate" files to be always synced. the answer? use ''--times'' flag to ''rsync'', so that it also copies creation / modification times from source. this way time offset between machines does not matter. that solved the 1st problem. the second one is... odd. turns out that ''git'' does not give write permissions to object files in ''.git'' dir, as these are not expected to ever change after writing. fine locally, but a bit problematic when ''rsync''ing repo, as there the file //can// change (e.g. resuming previous partial send). to fix this one ''--chmod=u+rw'' was added to ''rsync'', so that remote copy has always R/W access for user at least. this allows to error-less sync things. nice. these were quite some discoveries to be made. my only question -- could we ask for a better defaults? the current ones just cause confusion... btw: more [[https://github.com/el-bart/help_cmds/blob/master/rsync.txt|rsync tips]] can be found on [[https://github.com/el-bart/help_cmds|help_cmds]] repo, as usual.