CMD > rsync > links instead of files

· EOG, like EOF


² Save space on target by linking insted of copying the actual file #

Of course it only shows what "was" - but depending of filenames we can re-download :)

Flag Meaning Effect
-L / --copy-links Dereference Replace link w/ file; fail if file excluded
--copy-unsafe-links Only copy safe ones Skips links outside tree
--safe-links Don’t copy links pointing outside Skips many absolute links
--no-links Don’t copy links Drop symlinks

--links # default in -a

This is exactly what --delete is supposed to do:
Catastrophically dangerous when source list is incomplete.

✔ Golden Rule: NEVER run --delete w/ shell globs (foo, .md, etc.)

You must always give rsync a directory as source.

✔ Correct + safe way to do “only sync foo, and delete remote foo not local”**

We need to:
. sync only files matching foo*
. delete remote foo* that don’t exist locally
.. NOT delete unrelated files

Safe way: Use filters, not shell globs

! Correct method: use --include / --exclude filters

last updated: