I am trying to setup my plex server to use symlinks rather than host the movie files.
in my storage directory, i have both movies(some in subdirectory of the name and some just in the parent directory) and tvshows, which have subdirectories for each season, which contains the episodes
i would like to create a one-time script to parse the storage directory, and then create a symlink on the plex share directory, a directory for movies and one for tvshows.
I have figured out that using ls -d /dl/**/* to display the full working directory, but I cant figure out how to parse that data out to pass it to a script to create the symlink. Also I am getting errors when I attempt to manipulate, so I assume i will have to do a while read loop of some sort.
[freenas] /dl# ls -d **/* | egrep ".avi|.mkv"
/bin/ls: Argument list too long.
[freenas] /dl# ls -d **/* | egrep ".avi|.mkv" > /movies.txt
/bin/ls: Argument list too long.
[freenas] /dl# ls -d **/* > /movies.txt
/bin/ls: Argument list too long.
I would expect that I have 1-2 thousand files to create symlinks with.
Could anyone point me in a direction of how I should do this?
Scripting is not one of my strengths, i can usually pick apart a simple script to see what it is doing, but i cant seem to just create one from scratch.
Thanks
Band