Page 1 of 1

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

Posted: August 12th, 2019, 10:55 am
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

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

Posted: August 12th, 2019, 11:34 am
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?

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

Posted: August 12th, 2019, 11:40 am
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

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

Posted: August 12th, 2019, 11:47 am
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.

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

Posted: August 12th, 2019, 12:02 pm
by idmanager
yes command line

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

Posted: August 12th, 2019, 12:08 pm
by sander
idmanager wrote: August 12th, 2019, 12:02 pm yes command line
Yes, but how would you do it on the command line?

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

Posted: August 12th, 2019, 12:33 pm
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

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

Posted: August 12th, 2019, 12:52 pm
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 ...

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

Posted: August 12th, 2019, 1:08 pm
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 ?

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

Posted: August 12th, 2019, 1:17 pm
by sander
Read https://sabnzbd.org/wiki/scripts/post-p ... ng-scripts ... especially Basic Paremeters ...

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

Posted: August 13th, 2019, 3:31 pm
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