[UNRAID DOCKER] script help for folder with today's date

Come up with a useful post-processing script? Share it here!
Post Reply
idmanager
Newbie
Newbie
Posts: 11
Joined: December 12th, 2010, 2:47 pm

[UNRAID DOCKER] script help for folder with today's date

Post by idmanager »

Hi
I am looking for a script that i can run that will add today's date to a folder then unpack the download into it, so every day i have a new folder with that days downloads in, in sorting option there is that option but it only works if the nzb has the date in, and all my downloads do not,
eg
file1.mkv downloads and unpacks to data:\todaysdate\file1folder\file1.mkv
thanks
User avatar
sander
Release Testers
Release Testers
Posts: 9061
Joined: January 22nd, 2008, 2:22 pm

Re: [UNRAID DOCKER] script help for folder with today's date

Post by sander »

What are you looking for exactly?
- a readily-available script, or
- guidance how to write such a script?, or
- someone who writes the script for you? If so, do you offer a bounty?

And: which OS? As you say "UNRAID DOCKER" ... is it Linux?
idmanager
Newbie
Newbie
Posts: 11
Joined: December 12th, 2010, 2:47 pm

Re: [UNRAID DOCKER] script help for folder with today's date

Post by idmanager »

guidance would be nice so i can learn, but if there is a ready made script i can just copy that would be fine, unraid is linux based the docker runs python3
User avatar
sander
Release Testers
Release Testers
Posts: 9061
Joined: January 22nd, 2008, 2:22 pm

Re: [UNRAID DOCKER] script help for folder with today's date

Post by sander »

OK, guidance: how would you do it by hand from the Linux command line?

Reason: a script does no magic ... it's just the same sequence of commands you would issue by hand, which you can let happen automatically.
idmanager
Newbie
Newbie
Posts: 11
Joined: December 12th, 2010, 2:47 pm

Re: [UNRAID DOCKER] script help for folder with today's date

Post by idmanager »

yes command line
User avatar
sander
Release Testers
Release Testers
Posts: 9061
Joined: January 22nd, 2008, 2:22 pm

Re: [UNRAID DOCKER] script help for folder with today's date

Post by sander »

idmanager wrote: August 12th, 2019, 12:02 pm yes command line
Yes, but how would you do it on the command line?
idmanager
Newbie
Newbie
Posts: 11
Joined: December 12th, 2010, 2:47 pm

Re: [UNRAID DOCKER] script help for folder with today's date

Post by idmanager »

from the command line i can make the folder i need in the location i want using the following command but i am unsure then how to tell sab to use the new folder each time it changes as i only want the file downloaded from that category to use the command so how do i tell the script which files i need moving as it will not be the entire download folder as i have sonarr and wathcer running also
today=$(date +"%m_%d_%y")
mkdir $today
User avatar
sander
Release Testers
Release Testers
Posts: 9061
Joined: January 22nd, 2008, 2:22 pm

Re: [UNRAID DOCKER] script help for folder with today's date

Post by sander »

idmanager wrote: August 12th, 2019, 12:33 pm from the command line i can make the folder i need in the location i want using the following command but i am unsure then how to tell sab to use the new folder each time it changes as i only want the file downloaded from that category to use the command so how do i tell the script which files i need moving as it will not be the entire download folder as i have sonarr and wathcer running also
Sorry ... 3 lines of text without interpunction ... that's above my head.

idmanager wrote: August 12th, 2019, 12:33 pm today=$(date +"%m_%d_%y")
mkdir $today
OK, and that works?
Then move the directory with the download to that new dated directory ...
idmanager
Newbie
Newbie
Posts: 11
Joined: December 12th, 2010, 2:47 pm

Re: [UNRAID DOCKER] script help for folder with today's date

Post by idmanager »

Then move the directory with the download to that new dated directory
thats the part i am stuck with, i am unsure how to find the location of the folder thats just downloaded, it will be in \data\downloads\ but how do i pick the one thats just downloaded ?, how do i tell sab to use the folder i have just made ?
User avatar
sander
Release Testers
Release Testers
Posts: 9061
Joined: January 22nd, 2008, 2:22 pm

Re: [UNRAID DOCKER] script help for folder with today's date

Post by sander »

Read https://sabnzbd.org/wiki/scripts/post-p ... ng-scripts ... especially Basic Paremeters ...
idmanager
Newbie
Newbie
Posts: 11
Joined: December 12th, 2010, 2:47 pm

Re: [UNRAID DOCKER] script help for folder with today's date

Post by idmanager »

HI,
Found the issue why its not working, the code has to be Python .py to run inside the docker, i have no idea about this
if anybody has worked out how to add a date to the front of a folder inside the download folder with python please could you share
thanks
Post Reply