Script on Synyology NAS

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
MoraX
Posts: 11
Joined: 03 May 2013, 11:20

Script on Synyology NAS

Post by MoraX »

Hi Guys,

i have here my little .sh Script.

Code: Select all

PATH=$PATH:/volume1/@appstore/java8/ejdk1.8.0_33/linux_arm_sflt/jre/bin:/volume1/@appstore/java8/ejdk1.8.0_33/linux_arm_sflt/jre/bin

filebot -script fn:housekeeping -rename /volume1/pyload/downloads/ --output "/volume1/Serien/" --format "{n} - {s00e00} - {t} [{def db = net.filebot.WebServices.TheTVDB; db.getEpisodeList(db.search(n,Locale.ENGLISH)[0], null, Locale.ENGLISH).find{ episode.season == it.season && episode.episode == it.episode}.title}]" --db TheTVDB --lang de -non-strict

I want to run this script all the time. But i don't get it managed. it runs from the shell via "sh housekeeping.sh" But if i add it as as task in the Synology Diskstation it does not run. Also it does not run if i add it to crontab.
Has anyone an idea?
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Script on Synyology NAS

Post by rednoah »

I'd start by getting some logs => viewtopic.php?f=3&t=1802#p12015
:idea: Please read the FAQ and How to Request Help.
MoraX
Posts: 11
Joined: 03 May 2013, 11:20

Re: Script on Synyology NAS

Post by MoraX »

best man rednoah!

Code: Select all

Failed to initialize cache: java.nio.file.AccessDeniedException: /volume1/@appstore/filebot/data/cache/0/.lock
This was the result when i started as "admin". Then ran the script as "root"

Code: Select all

Press ENTER to abort
Done ヾ(@⌒ー⌒@)ノ

Any idea why it says "Done", although it should -just run-?
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Script on Synyology NAS

Post by rednoah »

1.

Code: Select all

Failed to initialize cache: java.nio.file.AccessDeniedException: /volume1/@appstore/filebot/data/cache/0/.lock
By running the script as root you've probably initialized certain files with root permissions, and the admin user now doesn't have access breaking everything. Delete all folder in /data/* to fix the problem and never ever run scripts as root, but admin only.

2.
Note that these two scripts here are console-interactive so you must not redirect I/O
Probably because it's executed by a non-interactive shell. I guess if you redirect output it'll receive it's shutdown signal immediately. That being said, you're not supposed to run shell interactive scripts via DSM Scheduler anyway.

3.
Whatever it is you're trying to do, these scripts here are probably not a good solution, and the amc script (hourly with --def excludeList) is always the best option for any sort of automation task.
Use a proper scheduled task and don't keep filebot running indefinitely.
:idea: Please read the FAQ and How to Request Help.
MoraX
Posts: 11
Joined: 03 May 2013, 11:20

Re: Script on Synyology NAS

Post by MoraX »

Thank you rednoah.

It's working now with the AMC Script. I modified it, to get German Shownames..

Code: Select all

PATH=$PATH:/volume1/@appstore/java8/ejdk1.8.0_33/linux_arm_sflt/jre/bin:/volume1/@appstore/java8/ejdk1.8.0_33/linux_arm_sflt/jre/bin

filebot -script /volume1/pyload/filebot-github-repo/amc.groovy --output /volume1/Media --log-file /volume1/pyload/amc.log --action move --conflict skip -non-strict "/volume1/Media/Downloads" --def artwork=n --def excludeList=/volume1/pyload/amc-exclude.txt --def "seriesFormat=/volume1/Media/Serien/{n}/{episode.special ? 'Special' : 'Staffel '+s.pad(1)}/{n} - {S00E00} - {t} [{net.filebot.WebServices.TheTVDB.getEpisodeList(info.id, null, Locale.ENGLISH).find{ it.numbers == episode.numbers }.title}]" "animeFormat=X:/Anime/{n}/{fn}" "movieFormat=volume1/Media/Filme/{n} {y}/{n}" "musicFormat=Z:/Music/{n}/{fn}" >> /volume1/pyload/dsm_amc.log 2>&1
One Problem is pending. It is just working if I start the script in Synology Task Scheduler as "root". If I start as "admin" or another administrative user i get an error. I already deleted the files u said.

Code: Select all

Failed to initialize cache: java.nio.file.AccessDeniedException: /volume1/@appstore/filebot/data/cache/0/.lock
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Script on Synyology NAS

Post by rednoah »

So what's the owner / permissions of the files in /volume1/@appstore/filebot/data then? It's clearly a permission issue, exactly as I've explained above.
filebot must not be run as root and it is recommended that you always run filebot as admin
By running filebot as root you've messed up all application data / cache / etc permissions which have been created with root permissions since the app was running as root. Uninstall & reinstall filebot and never ever run as root.

@see viewtopic.php?f=3&t=1802
:idea: Please read the FAQ and How to Request Help.
MoraX
Posts: 11
Joined: 03 May 2013, 11:20

Re: Script on Synyology NAS

Post by MoraX »

thanks for that, it is working after reinstall. Didn't get it the first time..
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Script on Synyology NAS

Post by rednoah »

Last time you run filebot as root the first, at which point it's broken for the less privileged admin user. ;)
:idea: Please read the FAQ and How to Request Help.
Post Reply