Post process scripting on Synology

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
TheW0ndaKid

Post process scripting on Synology

Post by TheW0ndaKid »

Hi All,

I have SABnzbd running on a Synology Diskstation and am looking for a little help with a post processing script. On a diskstation there is a binary file (synoindex) that can be used to update the uPnP database, if I copied the files to the NAS normally this process would run and update the uPnP database. However because the SABnzbd process moves them directly to the disk the process doesn't run.

The usage for synoindex is described below:

    Add:    synoindex -a filename
    Delete: synoindex -d filename
    Add folder:    synoindex -A folder
    Delete folder: synoindex -D folder
    Rename/move file/folder:  synoindex -N newfullpath oldfullpath
    Update Photo Images:  synoindex -U photo
    Get from DB:        synoindex -g filename -t [video|music|photo|playlist]

So I guess what I'm after is something to run /user/syno/bin/synoindex -a

I have plenty of experience with vbscript in windows but have no idea where to start with a post processing script running on linux
TheW0ndaKid

Re: Post process scripting on Synology

Post by TheW0ndaKid »

Hey all,

think I've got a bit further with this. If I create a script with the below

/user/syno/bin/synoindex -A $1

This should add the directory to the uPnP database

Does anyone have any idea if this would actually work?
TheW0ndaKid

Re: Post process scripting on Synology

Post by TheW0ndaKid »

Thanks PoD,

I did run it on its own, just to check it worked. Unfortunatly I left the "%1" in rather than replacing it with a folder name. My DiskStation is now trying to index everything it can see (including all the sys and usr stuff)!! Its been running for about 12 hours and hasn't finished yet, have a call logged with Synology. Just a word of warning to anyone else who is looking for this.

I notice your script doesn't include double quotes around the variable, if I remove mine what will happen if the folder path includes spaces? Also what does the bin/bash bit at the top do? I know its a probably got a really simple answer but I'm just trying to avoid breaking the NAS box (again!) ;)
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Post process scripting on Synology

Post by shypike »

On Windows, the parameters are passed with the quotes (so you don't need to add them in your script).
On Linux and OSX, the parameters do not have quotes, so your script needs to add them.

This difference is caused by the Python run-time library, we cannot fix this issue.
(Python is the programming language we use).
TheW0ndaKid

Re: Post process scripting on Synology

Post by TheW0ndaKid »

Thanks shypike,

If my NAS ever manages to finish indexing itself I'll use the below.

-----------------------------------------
#!/bin/bash

/user/syno/bin/synoindex -A "$1"
-----------------------------------------

thanks everyone.
yosh
Newbie
Newbie
Posts: 5
Joined: October 1st, 2009, 10:23 am

Re: Post process scripting on Synology

Post by yosh »

Hello,

i've the same problem. Does your last script is working ? Can you tel me the exact procedure to set it on my NAS ? (where i should copy it, how etc...) Thank you !!
starsys
Newbie
Newbie
Posts: 33
Joined: July 26th, 2011, 4:17 am

Re: Post process scripting on Synology

Post by starsys »

Hello. I really need this cool script. Can anyone help me to make it work with the last version of sabnzbd ?
What is the syntax ? How should I rename the script file ? Thanks a lot in advance.
Post Reply