Page 1 of 1

Selective delete based on category

Posted: December 7th, 2011, 3:14 pm
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?

Re: Selective delete based on category

Posted: December 7th, 2011, 3:27 pm
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

Re: Selective delete based on category

Posted: December 7th, 2011, 4:05 pm
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.

Re: Selective delete based on category

Posted: December 7th, 2011, 5:04 pm
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

Re: Selective delete based on category

Posted: December 7th, 2011, 7:13 pm
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?

Re: Selective delete based on category

Posted: December 8th, 2011, 2:58 am
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.

Re: Selective delete based on category

Posted: December 8th, 2011, 1:11 pm
by HopelessNotHelpless
OH MY GOSH DUH. Thanks.