Prevent the creation of subfolders

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
Lukas
Newbie
Newbie
Posts: 4
Joined: October 23rd, 2008, 5:25 am

Prevent the creation of subfolders

Post by Lukas »

Hey,
this has to be super easy but I can't make it to work, I have been searching the forums, to no avail. I'm running 0.4.4 on Leopard.

This is what I'm looking for:

- A RSS feed downloads MP3 files that meet certain criteria, these files are downloaded to a certain folder, for example ~/documents/mp3, WITHOUT creating subfolders.

- What I have achieved to get the RSS feed (from binsearch.info),  that only downloads mp3 files that meet my criteria (with different filters), and the files go to ~/documents/mp3 (via the Categories option), the problem is that for each file, a subfolder is created under ~/documents/mp3, typically  subfolders are like "~/documents/mp3/1224758127", "~/documents/mp3/1224758125", etc.

Is there a way to prevent these subfolders to be created?

thanks a bunch.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Prevent the creation of subfolders

Post by shypike »

Run a user script after each job.
You can set it in Config->Switches, more explanation in http://sabnzbd.wikidot.com/user-scripts

Code: Select all

#!/bin/sh
mv "$1/*" "$1/.."
rmdir "$1"
Lukas
Newbie
Newbie
Posts: 4
Joined: October 23rd, 2008, 5:25 am

Re: Prevent the creation of subfolders

Post by Lukas »

shypike wrote: Run a user script after each job.
You can set it in Config->Switches, more explanation in http://sabnzbd.wikidot.com/user-scripts

Code: Select all

#!/bin/sh
mv "$1/*" "$1/.."
rmdir "$1"
Thanks! although there is slight problem with this, I copied the code in a text file, saved it to /Users/lukas/documents/stuff/SCRIPTS/myscript.sh. When executed the files are not moved and I get this error "/Users/lukas/documents/stuff/SCRIPTS/myscript.sh: Permission denied" any ideas?

cheers.
"
rAf
Moderator
Moderator
Posts: 546
Joined: April 28th, 2008, 2:35 pm
Location: France
Contact:

Re: Prevent the creation of subfolders

Post by rAf »

Hi,

You can try to make the script executable :

Code: Select all

chmod +x /Users/lukas/documents/stuff/SCRIPTS/myscript.sh
rAf
Lukas
Newbie
Newbie
Posts: 4
Joined: October 23rd, 2008, 5:25 am

Re: Prevent the creation of subfolders

Post by Lukas »

Thanks rAf!, I made it executable, and the script was executed but with the following error
    mv: rename /Users/lukas/Sites/RSS/1224767277/* to /Users/lukas/Sites/RSS/1224767277/../*: No such file or directory
rmdir: /Users/lukas/Sites/RSS/1224767277: Directory not empty

thanks for any help
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Prevent the creation of subfolders

Post by shypike »

Sorry, slight mistake:

Code: Select all

#!/bin/sh
mv "$1/"* "$1/.."
rmdir "$1"
The * should be outside the quotes.
Lukas
Newbie
Newbie
Posts: 4
Joined: October 23rd, 2008, 5:25 am

Re: Prevent the creation of subfolders

Post by Lukas »

it works! thanks shypike!
Post Reply