Can FileBot work purely with symlinks?

Any questions? Need some help?
Post Reply
2devnull
Posts: 26
Joined: 09 Feb 2016, 02:07

Can FileBot work purely with symlinks?

Post by 2devnull »

So, this is another attempt to try and get my MythTV recordings into Emby. I think I have enough examples out there that I can use MythTV's parameters to pass the info to a UserJob script to get the relevant show information for its numeric filename and create a symlink that has the proper show info. My question is, can I point FileBot to the symlink folder and have it structurally organize/create the show hierachry folders as that will then give emby the info it needs as it works on folder naming than file names?

e.g.:
MythTV file for show Survivor S01E10:
/var/mythtv/recordings/1271_20160229230000.mpg

MythTV user job script runs and creates this:
/storage/mythtv-symlinks/Survivor_S01E10.mpg -> /var/mythtv/recordings/1271_20160229230000.mpg

Now, FileBot script runs and outputs to another base folder:
/storage/mythtv-filebot/TVShows/Survivor/Season 01/Survivor - S01E10 - Whatever episode name.mpg -> /var/mythtv/recordings/1271_20160229230000.mpg

The final step is what I would like FileBot to accomplish as it will all me to use Emby's Path Substitution to share that folder via NFS to my OpenElec client.

Does it support it?
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Can FileBot work purely with symlinks?

Post by rednoah »

I see no reason why that wouldn't work. Try and find out. ;)
:idea: Please read the FAQ and How to Request Help.
2devnull
Posts: 26
Joined: 09 Feb 2016, 02:07

Re: Can FileBot work purely with symlinks?

Post by 2devnull »

argh.....I now realized that symlinks and NFS ain't going to work. So I will need the last step to be hardlinks instead. So the new question is, can FileBot do step #3 as hardlinks from the symlinks on step #2, i.e. it will need to deference the symlink to the true file location and use that to create a hardlink (I think 'ln -n'). Please let me know what the filebot command would need to look like.

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

Re: Can FileBot work purely with symlinks?

Post by rednoah »

I suspect that if you hardlink a symlink file, then it'll hardlink the symlink, not the target the symlink points to. Since it's apparently all on the same filesystem, why not use hardlinks every step of the way?
:idea: Please read the FAQ and How to Request Help.
2devnull
Posts: 26
Joined: 09 Feb 2016, 02:07

Re: Can FileBot work purely with symlinks?

Post by 2devnull »

The problem with using it every step of the way is that I'll need to clean up twice. So the scenario is that MythTV will "expire" and delete the recordings after so many have been recorded, i.e. Keep 5 episodes of Survivor, delete oldest when a new one records. With hardlinks, the physical space will still be kept if at least one hardlink is pointing to the inode. So the more hardlinks I make, the more I will need to remove to ensure the physical file is deleted and the disk space is increased for other recordings to occur. I am currently looking at a script to delete this (i.e., if only one hardlink, do a rm on file). I guess I can run this from both locations or better yet, I think what you are saying is that filebot will take care of the first one when it organizes the files? I think this will work then, else I run on both locations as last resort.

Off to try.
Post Reply