Page 1 of 1

Synology - Post Process Script Permission denied

Posted: May 16th, 2016, 3:59 am
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

Re: Synology - Post Process Script Permission denied

Posted: May 16th, 2016, 4:57 am
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

Re: Synology - Post Process Script Permission denied

Posted: May 16th, 2016, 8:56 am
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?

Re: Synology - Post Process Script Permission denied

Posted: May 16th, 2016, 2:47 pm
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.