Page 1 of 1

[Solved]Using Linux cmdline, how to create output directories

Posted: 07 Jan 2024, 07:05
by craigjl77
Hi,
I need a cmdline example of how to create output directories of the format
/videos/<tvseriesname>/<seasonnumber>/episodename_Snn:Enn


Please don't suggest I use a precanned format ie emby or plex as it's not my use case atm


Tried this on the cmdline

Code: Select all

f--output $HOME/Videos/\{n\}/\{'S'\+s.pad\(2\)\}
and this using an @/inputfile.txt

Code: Select all

--format
{n.replace(' ':'')}_{y}_{s00e00}_{t.replace('&':'And').replace(' ':'_')}
-r
--db
TheMovieDB::TV
/home/craigl/Vsource
-rename
-non-strict
-no-xattr
--output
/home/craigl/Videos/{n}/{'S'+s.pad(2)}
--action
duplicate
but learned from the forums that binds do not work on -output

Hoping you can help :-)

Re: Using Linux cmdline, how to create output directories

Posted: 07 Jan 2024, 07:15
by rednoah
--output must be a real folder path and cannot contain variables. --format is a template.

e.g.

Shell: Select all

--output
/home/craigl/Videos
--format
{n}/{'S'+s.pad(2)}/{n.replace(' ':'')}_{y}_{s00e00}_{t.replace('&':'And').replace(' ':'_')}



TIP:

You can have files at multiple file paths. If you want "bad file paths for convenience" then I recommend a primary structure with {plex.id} or {jellyfin.id} and then mirror that structure to a disposable bad structure on demand when needed via --db xattr mode with --action hardlink. See Re-process previously organized files using local xattr metadata for details and examples.

Re: Using Linux cmdline, how to create output directories

Posted: 07 Jan 2024, 07:34
by craigjl77
Thanks @rednoah ur Legend :-)