I want to backup my home directory to an external drive nightly using a
cron job to execute
rsync. I am unsure of the exact behavior of
rsync's symbolic link flags.
-aflag includes the
-lflag (i.e. "copy symlinks as symlinks"). Does this just mean it will copy the link or that it will follow the link and copy everything in the link-to directory? I want to avoid that because I have links to directories full of media files that would involve copying hundreds of gigabytes I don't need to back up.
- Fearing (but not certain) that
rsync -awould copy all those media files I instead added the
--no-linksflag. This does not seem to be behavior I want. It just ignores copying any link which is problematic because I do have links I want copied (e.g. links to common header files from different project directories).
- Assuming #1 above (without the
--no-linksflag) is what I really want and it just copies the link without copying the linked-to files, will the links break when they are backed up? For example I may
/media/extdrive/backup/home/me/projects/misc. In this case I assume
rsyncis not smart enough nor does it try to correct the contents of symlinks for the relative directory changes. Is this correct? This is okay, it doesn't matter if the links are broken in the backup directories so long as they would be fixed and working if such time comes when they need to be restored.