Photo organisation - hard versus symbolic links

Started by Alan Clifford, January 13, 2019, 10:28:48 AM

Previous topic - Next topic

Alan Clifford

I have three versions of my photographs under originals, processed and photo.  The photo hierarchy contains just small versions for my website and are easily reproducible. 

I have three cases in this example:

originals
raw.nef
same.jpg
different.jpg

processed
raw.jpg
same.jpg
different.jpg


raw.jpg is the result after converting a raw file, with or with out non-destructive changes, to jpg.
different.jpg in processed is different from the one in originals as it is the result of converting a jpg using non-destructive changes.

That leaves same.jpg, which is unedited, so I have two instances of it.  I have lots of these.

I am thinking tnat I could create a link, in processed, to the file in the originals directory rather than making a copy.  But hard or symbolic?  A relative, symbolic link would work well with rsync for backup but hardlinks can be made to work as well, albeit not so efficiently.   Given I have a couple of Time Machine backups and a couple of backup disks attached to Raspberry Pi's, I'd be saving a lot of duplication, disk space, and backup time from slow internet links when I'm away from home.

So advice needed for two things.  Would it be sensible to use links?  And which sort to use, hard or symbolic?





 





Phil Harvey

Hi Alan,

My advice is to always use a symbolic link unless you have a good reason not to.

Symbolic links are simpler.  There is an original file, and the link is just a pointer to it.

Hard links are tricky, and can have unintended side effects unless you know what you are doing.

For example, if you soft link a file, then edit the file in ExifTool, the soft link will point to the edited file.

But if you hard link a file, then edit the file in ExifTool, the hard link will be to the "_original" copy.  If you use the -overwrite_original option, then the hard link is just broken.  The hard link would only be preserved if you use -overwrite_original_in_place.  You don't have to worry about any of this with a soft link.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Alan Clifford

Thanks Phil.  Sounds like good advice.

After posting, I was thinkig some more, and today's backup uses hard links to yesterday's and last month's.  So even my symbolic links are hard linked on the backup disk.

lrwxrwxrwx 35 alan alan 36 Jan  3  2013 addxmpdate.pl -> ../photographs/scripts/addxmpdate.pl

So I was thinking that it would get a bit complicated if rsync was trying to keep all the hardlnks across backups.