Page 1 of 1

Save Successful NZB Files ONLY

Posted: September 7th, 2023, 3:33 am
by methanoid
I have long used the NZB Backup folder to store NZBs but I find quite a few NZBs fail to download due to DMCA etc and I want to store the NZBs of successful downloads ONLY. Is that possible or do I need to somehow script it?

Looking on Wiki I found this with a typo BTW?

Code: Select all

.nzb Backup Folder

Advanced	When SABnzbd adds an nzb to the queue it creates a local [word missing COPY???] of the NZB file in this folder. If you leave this box empty, no files will be saved.

Re: Save Successful NZB Files ONLY

Posted: September 7th, 2023, 4:02 am
by sander
Post-processing script.

Or: use history1.db to see Failed downloads, and (re)move them from your backup dir

Code: Select all

sander@zwart2204:~/.sabnzbd/admin$ sqlite3 history1.db .dump  | grep Failed | awk -F, '{ print $3 }'

'reftestnzb-obfuscated-rar-files-no-par-073afc9c3cb0'
'reftestnzb__fully_encrypted__meta_password__46d021b78b44'
'fully2'
'fully3'
'test_download_100MB'
'113-a440126c62802ef1560c17c99fd9fe84-yEnc-104857600'
'1666285694'
'missing_stuff_download_100MB'
'missing_stuff_download_100MB'
'63fbdf3799fd053eaa15343e'
'63fbdf3799fd053eaa15343c'
Or, less brute force:
go into your backup dir, and of each .nzb find out the status in history1.db. If Failed, (re)move from backup dir.

Re: Save Successful NZB Files ONLY

Posted: September 7th, 2023, 8:38 am
by methanoid
Could I tack something LIKE (I dont claim to follow the script rules!!)

if ($7 NE 0) rm /location_of_NZB_backups/$SAB_FILENAME

to the end of all my post processing scripts which basically do some simple file manipulations on jobs that have passed?

Re: Save Successful NZB Files ONLY

Posted: September 7th, 2023, 9:11 am
by sander
Looks like a plan!


Tip:
you could use $1 instead of $SAB_FILENAME
nzb's are backed up as ...gz . So add that at the end of $SAB_FILENAME

Re: Save Successful NZB Files ONLY

Posted: September 12th, 2023, 8:49 am
by methanoid
I think a friend is gonna tack this at beginning of a script he's made to store NZB files by the category they were in. Kinda think this could be a switch option in SABnzbd if @safihre wanted to add some feaures ;)