Page 1 of 1

Searching for a simple script

Posted: September 3rd, 2012, 11:03 am
by scheinerman
Hi,

I am searching for a simple script that after downloading it will unpack and move the file to a certian folder.
I am using categories and path but the it is unpacking to the folder (I add in path) and I would it to unpack to same folder it is downloading and only then move the file to the catagory folder.

is there a script that can do this?

thank you

Re: Searching for a simple script

Posted: September 3rd, 2012, 11:54 am
by shypike
Why would you want to replace a significant part of SABnzbd?
Why do you want to use the same folder?
Isn"t it easier to simply put the incomplete and complete on the same drive?
After that you can run a script that just moves the folder to another drive.

Re: Searching for a simple script

Posted: September 4th, 2012, 1:08 am
by scheinerman
Hi,

this is exactly what I want after sabnzbd will do all his proccessing and unpacking I would like the script to move the file to a certain directory.
but I want it to be like sabnzbd creating show name / season / file name .

(I want it because I am using network drive and I would like that all the "heavy" chores will be in my local computer and then it will be moved to my drive)

thank you

Re: Searching for a simple script

Posted: September 4th, 2012, 3:38 am
by shypike
SABnzbd does all heavy lifting in the temporary folder.
It unpacks from the temporary folder to the destination folder.
Whether you use unrar to write to the network disk or a copy program
should make little difference.
Have you seen that it does make a difference?

Re: Searching for a simple script

Posted: September 6th, 2012, 3:32 am
by scheinerman
yes..
there are some diffrence.

I want that the unpack will be in the computer and only after unpacking it will move the file.
is it possible?

thank you

Re: Searching for a simple script

Posted: September 6th, 2012, 10:18 am
by shypike
It is possible, but like you remarked before, it requires a script.
There's no standard script, so you'll have to make your own.

Re: Searching for a simple script

Posted: September 14th, 2012, 5:24 am
by jingenior
I am also very interested in such script because my NAS is too slow to handle the live unpacking.

Could someone help us?

thank you

Re: Searching for a simple script

Posted: September 14th, 2012, 1:48 pm
by beaston02
If i understand correctly, you are trying to download the nzb on one box, unpack it, then transfer it to another box once everything is done? If so, heres part of a script I wrote to transfer movies from one readynas with sabnzbd installed, to another readynas on my network. I cant claim to know much of anything about scripting, so there may be a better way to handle this, but it gets the job done for me.

Code: Select all

#!/bin/bash

scp -r -c arcfour $1 [email protected]:/c/temp
ssh [email protected] mv /c/temp/* /c/Rename/
rm -r $1*
You will also need passwordless login setup between the two boxes (google how to do this if you dont know how) and I run sabnzbd as root. Passwordless login, I believe needs to be set up per user, so setting it while logged in through ssh as root will not work for sabnzbd scripts unless its running as root, unless Im mistaking..?

Modify the script to fit your needs of course. The "scp -r..." transfers the finished (unpacked) folder to "/c/temp " folder on the destination NAS, then once thats completed i have it transfer to the "Rename" folder on that same box. the Rename folder is watched by Couchpotato, and by going directly into that folder (instead of the temp folder) I would get errors due to Couchpotato renaming and moving the movies folder and files before the transfer was complete.. By going to the temp folder, then to the Rename folder solved that, so you can eliminate that line if you dont have anything thats going to grab it or modify it in some way and just go straight to the final folder. And of course the final line "rm -r $1" simply deletes the file from the original NAS freeing the space.

I hope this helps.

Re: Searching for a simple script

Posted: September 14th, 2012, 2:10 pm
by shypike
I'd use this little variant. It quotes to allow for spaces in names.

Code: Select all

#!/bin/bash
scp -r -c arcfour "$1" [email protected]:/c/temp
ssh [email protected] mv /c/temp/* /c/Rename/
rm -r "$1*"

Re: Searching for a simple script

Posted: September 14th, 2012, 2:33 pm
by beaston02
Now that you mention that, I remember I had to set SABnzbd to replace spaces with underscores or I would get errors.. never realized the quotes would have fixed that. Thanks for the tip.