Synology - Post Process Script Permission denied

Report & discuss bugs found in 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
geoffreymk
Newbie
Newbie
Posts: 3
Joined: May 16th, 2016, 3:29 am

Synology - Post Process Script Permission denied

Post by geoffreymk »

Hi all,

I am new to this but i have tried to set up Sabnzbd with sickbeard to do auto downloads for all my tv series. It has been doing the downloads fine but then i wanted to also transcode most of the files downaloaded are in .mkv type file but i want to use .mp4 files which works well with Chromecast.

I found this script which i m using but getting permission denied error not sure what i am doing wrong?

Code: Select all

python: can't open file '/volume1/Downloads/Scripts/sabToSickBeardwithConverter.py': [Errno 13] Permission denied

Code: Select all

#!/usr/bin/env python

import os
import sys
import autoProcessTV
from readSettings import ReadSettings
from mkvtomp4 import MkvtoMp4

settings = ReadSettings(os.path.dirname(sys.argv[0]), "autoProcess.ini")

path = str(sys.argv[1])
converter = MkvtoMp4(settings)
converter.output_dir = None
for r, d, f in os.walk(path):
    for files in f:
        inputfile = os.path.join(r, files)
        if MkvtoMp4(settings).validSource(inputfile):
            try:
            	print "Valid file detected: " + inputfile
            except:
            	print "Valid file detected"
            converter.process(inputfile)

"""Contents of sabToSickbeard.py"""
if len(sys.argv) < 2:
    print "No folder supplied - is this being called from SABnzbd?"
    sys.exit()
elif len(sys.argv) >= 3:
    autoProcessTV.processEpisode(sys.argv[1], sys.argv[2])
else:
    autoProcessTV.processEpisode(sys.argv[1])

Any ideas?

Thanks for help in advance
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Synology - Post Process Script Permission denied

Post by shypike »

Make sure the script has its X-bit set and that the /usr/bin/env exists
and can actually find Python.
You can try to change the first line to:

Code: Select all

#!/usr/bin/python
geoffreymk
Newbie
Newbie
Posts: 3
Joined: May 16th, 2016, 3:29 am

Re: Synology - Post Process Script Permission denied

Post by geoffreymk »

Hi Shypike

Thanks for your reply, i have tried to change it to the line suggested but still getting the same issue. Then i tried to follow some instructions how to browse into the root and basically have not got the folder present as i m getting the following:

Code: Select all

root@DiskStation:~# cd /usr/bin/env
-ash: cd: /usr/bin/env: Not a directory
root@DiskStation:~#
not sure how to create the env or if i remove that to just have Python.

When i do a dir i get these:

Code: Select all

lrwxrwxrwx 1 root   root       7 Mar 24 14:27 python -> python2
lrwxrwxrwx 1 root   root       9 Mar 24 14:27 python2 -> python2.7
-rwxr-xr-x 1 root   root    5688 Mar 23 04:31 python2.7
-rwxr-xr-x 1 root   root   26404 Mar  7 02:14 qrencode
When you said to make sure that the script has its X-bit set what do you mean by that as this doesn't mean anything to me at the moment :P Can you please explain what it is or how to set it?
geoffreymk
Newbie
Newbie
Posts: 3
Joined: May 16th, 2016, 3:29 am

Re: Synology - Post Process Script Permission denied

Post by geoffreymk »

Have managed to resolve this now, went into each file in the scripts folder and into properties and gave the users full access to the files.
Post Reply