Scripting File Copies To Dynamically Change Content - Need Some Advice

Joined
May 2, 2017
Messages
211
In a nutshell, I'm building a second TrueNAS for the purpose of being a slow, and beastly "storage only" machine. Its purpose is to hold stuff indefinitely and manage backing everything up. My smaller capacity but higher performance TrueNAS machine will continue to be the host machine for documents I need always available, and host my Plex server.

For my use, I envision storing loads of movies and television on the new beastly machine, and want to use script copies and deletes to move stuff in and out of the primary NAS for Plex. I realize I could just share all the content, and have it all the time, but there is a plan to this scenario. I want Plex to be more like a dynamically updated "channel" with ever-changing content. Instead of showing everything all the time, content could be placed into the primary NAS based on events, holidays, etc... Perhaps Christmas movies will copy into the main NAS on December 1st, and delete on December 31st. The 9/11 movies would copy in for a couple weeks around the anniversary of the event, etc... So in Plex's case, every time December rolls around the Christmas movies will show in "Recently Added", and they will vanish after Christmas. Like a dynamic on-demand channel.

I need advice on automating this. I have a lot to learn on scripting, but I imagine this involves setting a script to run overnight as a Cron job on the primary NAS... copying over what comes in, and deleting what goes out on the selected dates. Any efficient ways to mage this? What are some thoughts on how you guys would do this?

I'm thinking I could do something like this...

Each time I add a file to the server, I would make an entry in the script with the file name and a "start date" and "end date for that file. Each day the script would run overnight, copying anything with a start date matching the current date, and deleting anything with an end date of the current date. Knowing nothing about scripting, what ways would you recommend doing this, so I can look into how to write the script?

Any ideas would be appreciated...
 
Top