Selective delete based on category

Come up with a useful post-processing script? Share it here!
Post Reply
HopelessNotHelpless
Newbie
Newbie
Posts: 4
Joined: December 7th, 2011, 3:08 pm

Selective delete based on category

Post by HopelessNotHelpless »

I searched for a long time for this answer, I know it's easy but I'm kinda half dumb. I've got my post processing scripts running fine, and no problems there. My issue is that sometimes I need the .nfo's, and sometimes I don't. Since I sickbeard and wind up with a LOT of files, those stray nfo's just clutter everything up.

How could I add a line to the TV and Movies categories scripts to delete readme/nfo/sfv?
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Selective delete based on category

Post by shypike »

Create a post-processing script for these categories.
Assuming Windows:

Code: Select all

@echo off
cd %1
del /s/q *.nfo

For more info about scripts: http://wiki.sabnzbd.org/user-scripts
HopelessNotHelpless
Newbie
Newbie
Posts: 4
Joined: December 7th, 2011, 3:08 pm

Re: Selective delete based on category

Post by HopelessNotHelpless »

Thanks, will read. Whatever I read before wasn't especially helpful. Not windows, debian-based linux mint.

Hm, ok, would something like this work? Just appended to the bottom of the existing userscript?

Code: Select all

@echo off
cd $1
rm *.nfo
What is syntax for additional files, just newline rm *.sfv etc?

Oh..wait

Code: Select all

rm -f $1/*.nfo
rm -f $1/*.srr
rm -f $1/*.sfv
rm -f $1/*.nzb
Appended as necessary. That's prettier.

And edited for the gazillionth time...I'm dumb, the sickbeard post processing scripts are python not bash, no idea what I'm doing.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Selective delete based on category

Post by shypike »

For Linux:

Code: Select all

#!/bin/sh
cd "$1"
rm -r *.nfo

Don't forget to set the X bit of the file:

Code: Select all

chmod +x scriptname
HopelessNotHelpless
Newbie
Newbie
Posts: 4
Joined: December 7th, 2011, 3:08 pm

Re: Selective delete based on category

Post by HopelessNotHelpless »

Please forgive the quantity of my noobness here, and I've totally got this for most categories. However, what about my TV category where it's already using the sabtosickbeard.py script? How can I append this to that script?
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Selective delete based on category

Post by shypike »

Call the SB script from your's.

Code: Select all

#!/bin/sh
cd "$1"
rm -r *.nfo
sabtosickbeard.sh "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
Or whatever the SB script is called.
HopelessNotHelpless
Newbie
Newbie
Posts: 4
Joined: December 7th, 2011, 3:08 pm

Re: Selective delete based on category

Post by HopelessNotHelpless »

OH MY GOSH DUH. Thanks.
Post Reply