How to create Symbolic Links and use them in a home server

All about user-defined episode / movie format expressions
Post Reply
RickyHunter
Posts: 3
Joined: 04 May 2018, 02:17

How to create Symbolic Links and use them in a home server

Post by RickyHunter » 04 May 2018, 02:49

Hi.
I've purchased today FileBot from Apple Store.
This is what I have:

I've got a Drobo5N server with TVShows and Movies
already named quite well, so I don't want to rename them.
I'd like to create symbolic links to the files, using a
specific folder in the same Drobo.
The IP is fixed, so I'm thinking to write symbolic links
with the IP, in order to access the files from each Kodi
installation I've got at home, something like:
smb:192.168.1.112/TVShows/_KodiMedia/Game of Thrones/Season 1/Game of Thrones - S01E01 - L'inverno sta arrivando

With the GUI I'm only able to have a path like this:
/Volumes/TVShows/_KodiMedia/Game of Thrones/Season 1/Game of Thrones - S01E01 - L'inverno sta arrivando
So the problem is that /Volume is only usable from the mac I'm using.

Is it possible to use a samba path?
And, if yes... Is this a good way to access the
files from each Kodi installation I've got?
Thanks in advance.

User avatar
rednoah
The Source
Posts: 16123
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to create Symbolic Links and use them in a home server

Post by rednoah » 04 May 2018, 03:31

FileBot can only process files that are mounted into the local filesystem. Unfortunately, that makes it impossible to create server-side symlinks. AFAIK, Linux symlinks have to be relative or absolute file paths and cannot be URLs. Creating symlinks on an SMB share might not be possible in the first place, since SMB was primarily designed for Windows.

If you want to create symlinks or hardlinks, then I recommend using NFS which is a network filesystem designed for Unix systems. When creating symlinks, FileBot will try to create relative symlinks if possible, so the relative symlink path will make sense on both your Mac host as well as on your server-side filesystem.

TL;DR It's possible, at least with NFS, but you might have to tinker a little bit.
:idea: Please read the FAQ and How to Request Help.

devster
Posts: 284
Joined: 06 Jun 2017, 22:56

Re: How to create Symbolic Links and use them in a home server

Post by devster » 04 May 2018, 12:23

I would argue that with Kodi specifically this is a non-issue. I don't believe you need to create any kind of symlinks at all.
If I understand correctly your setup you have several Kodi instances at home and a single server.
In this case you just need to Add a new Source and point it at the SMB share, from here just add the TVShows/_KodiMedia folder; no need to even mount the share in the Kodi machine.
But, to be fair, I don't understand why you would want to create symlinks in the first place so I'm probably missing a piece.
If you have some form of DNS resolution at home it might be possible to format the SMB url in the form of smb://drobo5n/TVShows... otherwise it can be hardcoded as advancedsettings in Kodi.

Code: Select all

<hosts>
  <entry name="HOSTNAME">IPADDRESS</entry>
</hosts>
I wouldn't want to mess with MySQL for syncing however and just stick to adding the shares as sources + maybe the Trakt addon.
I only work in black and sometimes very, very dark grey. (Batman)

RickyHunter
Posts: 3
Joined: 04 May 2018, 02:17

Re: How to create Symbolic Links and use them in a home server

Post by RickyHunter » 04 May 2018, 23:45

rednoah wrote:
04 May 2018, 03:31
[CUT] then I recommend using NFS which is a network filesystem designed for Unix systems. When creating symlinks, FileBot will try to create relative symlinks if possible, so the relative symlink path will make sense on both your Mac host as well as on your server-side filesystem.

TL;DR It's possible, at least with NFS, but you might have to tinker a little bit.
Thank you. I didn't know the NFS and fortunately the Drobo5N can use it.
I'll do some tryouts with this and I'll let you know.

RickyHunter
Posts: 3
Joined: 04 May 2018, 02:17

Re: How to create Symbolic Links and use them in a home server

Post by RickyHunter » 05 May 2018, 00:04

Thanks Devster, I didn't specify why I want to create symbolic links:
in some cases (I'm really not able to figuring out why), Kodi
is not reading well the information about movies/series.
So what I want to do is giving it a filebot formatted title
in order to have Kodi without errors.
For instance, I've got the complete Star Trek saga in a tree like this:
Star Trek
|_ Star Trek Voyager (1995)
|_Season 01
|_Star.Trek.DS9.-.1x01.-.1x02.-.L'Emissario.(-#Startrekitalia.Su.Azzurra).avi
|_Season 02
|_Season 03...
|_ Star Trek Deep Space 9 (1993)
|_Season 01
|_Season 02...
....

but for some reason Kodi is not recognising correctly those
(it's only an example).
I don't want to modify my directories structure nor the files titles.

User avatar
rednoah
The Source
Posts: 16123
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to create Symbolic Links and use them in a home server

Post by rednoah » 05 May 2018, 06:26

I recommend keeping your files in one directory, and processing all files using hardlink into another folder structure. Keeping processed (e.g. Kodi Meida folder) / not yet processed (e.g. Downloads folder) files separate is always a good idea, and using hardlinks instead of symlinks will also save you lots of potential headaches (and has no downsides).

Creating hardlinks on the remote filesystem should be no problem as long as it's mounted via NFS.
:idea: Please read the FAQ and How to Request Help.

devster
Posts: 284
Joined: 06 Jun 2017, 22:56

Re: How to create Symbolic Links and use them in a home server

Post by devster » 07 May 2018, 07:20

I'm not sure if the following would be a solution, but with an SMB server correctly set up and being careful about following symlinks, wouldn't you just need to create a new directory tree with symlinks (or hardlinks) to the existing files? (without touching them)
I'm still confused about why you would need the IP and protocol in the links.
I only work in black and sometimes very, very dark grey. (Batman)

User avatar
rednoah
The Source
Posts: 16123
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to create Symbolic Links and use them in a home server

Post by rednoah » 07 May 2018, 08:42

Does SMB protocol support the creation of symlinks and hardlinks?

The SMB client just sees "files" and how links behave depends on the SMB configuration on the server-side.

Hence best to mount as NFS when processing remote files with the MacOS GUI.
:idea: Please read the FAQ and How to Request Help.

devster
Posts: 284
Joined: 06 Jun 2017, 22:56

Re: How to create Symbolic Links and use them in a home server

Post by devster » 07 May 2018, 09:31

Now I see, I assumed FileBot was being run on the Drobo itself, my mistake.
I only work in black and sometimes very, very dark grey. (Batman)

Post Reply