Symlink management

Talk about the Ultimate Question of Life, The Universe, and Everything
Post Reply
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Symlink management

Post by devster »

I have quite a large portion of my files as symlinks from one location to another, example:

Code: Select all

Avatar.2009.1080p.BluRay.DTS.x264.GROuP/Avatar.2009.1080p.BluRay.DTS.x264.GROuP.mkv -> '../../../../../../../cephfs/Media/Movies/Avatar (2009) [James Cameron]/Avatar (2009) [1080p x264 - 5.1 DTS Eng, 2.0 MP3 Eng - BluRay]-GROuP.mkv'
Avatar.2.2021.1080p.BluRay.DD+7.1.x264-FLaSH.mkv -> '../../../../../../cephfs/Media/Movies/Avatar 2 (2021) [James Cameron]/Avatar 2 (2021) [1080p x264 - 7.1 E-AC-3+Dep Eng, 2.0 AAC LC Eng - BluRay]-FLaSH.mkv'
Now, let's say I want to change for all these files [AAC LC] into something else [AAC] (if possible using a FileBot command - but I'd be OK with regex replacements or this rename script)
Is there a robust way (software, script, anything) to do the rename while maintaining the link?
I guess this would mean, in practice, read original path and link, make the rename in the destination directory (consistently 4 levels deep - /cephfs/Media/Movies/<Movie Folder>), go back to original directory for the link (which could mean either <source dir> or <source dir>/<movie dir>), and recreate the symlink to the newly renamed file?
I only work in black and sometimes very, very dark grey. (Batman)
User avatar
rednoah
The Source
Posts: 22898
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Symlink management

Post by rednoah »

Well, I’d have a master structure, and then generate secondary structures with arbitrary formats on demand. So changing your mind about naming is just a matter of generating yet another secondary structure.
:idea: Please read the FAQ and How to Request Help.
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Re: Symlink management

Post by devster »

Not really what I'm trying to do.

I chose this way of organising files because I put files first in fast storage for processing, then move them to a much larger, slower storage space. Fast storage is very limited.
How would a master structure work?
I only work in black and sometimes very, very dark grey. (Batman)
User avatar
rednoah
The Source
Posts: 22898
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Symlink management

Post by rednoah »

I guess your slower storage would be your master structure. Unless you're ok with only generating new secondary structure with content limited to what's on the fast storage.
:idea: Please read the FAQ and How to Request Help.
Post Reply