AMC Script On Raspian

Running FileBot from the console, Groovy scripting, shell scripts, etc
dacari
Donor
Posts: 44
Joined: 20 Mar 2013, 14:42

AMC Script On Raspian

Post by dacari »

I currently have this script working in windows but can't get in working with raspian on Raspberry 3 with Utorrent. I am complete Linux noob but learning quickly. Any help would be appreciated:

Code: Select all

filebot -script fn:amc --output “/mnt/Volume1/Digital/Media" --log-file amc.log --action move --conflict override -non-strict --def pushover=XXXXX music=n artwork=y backdrops=n plex=XXXX "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=%L" "ut_state=%S" "clean=y" --def "movieFormat=/Movies/{n} {y}/{fn}" --def "seriesFormat=/Tv Shows/{n}/{'S'+s}/{fn}"
Forgot to include this:

I have done the following:
ln -s /home/pi/Filebot/filebot.sh /usr/local/bin/filebot
sudo chmod +x /usr/local/bin/filebot
filebot -version
FileBot 4.7 (r3923) / Java(TM) SE Runtime Environment 1.8.0_65 (headless)

Error that I get when run from the CLI:
java.io.FileNotFoundException: Script not found: amc

Chromaprint: java.io.IOException: Cannot run program "fpcalc": error=2, No such file or directory

Thanks
dacari
Donor
Posts: 44
Joined: 20 Mar 2013, 14:42

Re: AMC Script On Raspian

Post by dacari »

Hello Folkes,

Can anyone point me in the direction of the most up to date guide to install and run scripts on a Raspberry PI 3 with Raspian. I see guides but they are outdated.

Thanks,
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Re: AMC Script On Raspian

Post by devster »

I'm using FileBot on a Raspberry Pi 3, I have a very similar setup, but I installed it after building it in a docker container.
My first guess is that your version is a bit too old and somehow can't find the scripts it needs. How did you install it?

Also would you mind running the command again but this time with:

Code: Select all

-Dnet.filebot.logging.debug=ALL
See @viewtopic.php?t=3913 for a reference.
I only work in black and sometimes very, very dark grey. (Batman)
dacari
Donor
Posts: 44
Joined: 20 Mar 2013, 14:42

Re: AMC Script On Raspian

Post by dacari »

Hi Devster,

Thanks for the response. I downloaded 4.7.9 potable and extracted and created a symlink as above. When I run the command I get back: bash: -Dnet.filebot.logging.debug=All: command not found. I would guess I have not installed properly, any help would be appreciated.

FileBot 4.7.9 (r4984)
JNA Native: 5.1.0
MediaInfo: 0.7.73
Apache Commons VFS: [zip, rar]
Chromaprint: java.io.IOException: Cannot run program "fpcalc": error=2, No such file or directory
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2017-05-15 (r500)
Groovy: 2.4.10
JRE: Java(TM) SE Runtime Environment 1.8.0_65
JVM: 32-bit Java HotSpot(TM) Client VM
CPU/MEM: 4 Core / 224 MB Max Memory / 16 MB Used Memory
OS: Linux (arm)
Package: PORTABLE

looks like I can run: sudo filebot -script "fn:amc" from the CLI but is not running from Utorrent...hmmmm




Thanks
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Re: AMC Script On Raspian

Post by devster »

dacari wrote: 28 Aug 2017, 22:49 Thanks for the response. I downloaded 4.7.9 potable and extracted and created a symlink as above. When I run the command I get back: bash: -Dnet.filebot.logging.debug=All: command not found.
That isn't a command, I linked in the reference how to use it, I'll copy it here:

Code: Select all

$ export JAVA_OPTS="-Dnet.filebot.logging.debug=ALL"
$ filebot -script fn:sysinfo ; filebot -script fn:sysenv
I believe there's also a --log option, so for example:

Code: Select all

$ filebot --log ALL -script fn:amc
should work.
I didn't see the 4.7.9 in your previous output, but that is one of the latest releases.
If running with sudo works it might be a permission issue, you could try checking that.
I only work in black and sometimes very, very dark grey. (Batman)
dacari
Donor
Posts: 44
Joined: 20 Mar 2013, 14:42

Re: AMC Script On Raspian

Post by dacari »

Thanks, this is the response I get when I run the command above:

Code: Select all

Error during startup: java.nio.file.AccessDeniedException: /home/pi/filebot/data/cache/0/.lock
java.lang.ExceptionInInitializerError
	at net.filebot.Main.main(Main.java:107)
Caused by: net.sf.ehcache.CacheException: java.nio.file.AccessDeniedException: /home/pi/filebot/data/cache/0/.lock
	at net.filebot.CacheManager.<init>(CacheManager.java:36)
	at net.filebot.CacheManager.<clinit>(CacheManager.java:22)
	... 1 more
Caused by: java.nio.file.AccessDeniedException: /home/pi/filebot/data/cache/0/.lock
	at net.filebot.CacheManager.acquireDiskStore(CacheManager.java:78)
	at net.filebot.CacheManager.<init>(CacheManager.java:33)
	... 2 more
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Re: AMC Script On Raspian

Post by devster »

It really seems like a permission issue, try and check perms on the /home/pi/filebot directory.
I don't remember if that's the default location though.
I only work in black and sometimes very, very dark grey. (Batman)
dacari
Donor
Posts: 44
Joined: 20 Mar 2013, 14:42

Re: AMC Script On Raspian

Post by dacari »

This is the permissions on the directory:

drwxr-xr-x 6 pi pi 4096 Aug 29 00:24 data
-rw-r--r-- 1 pi pi 583 Feb 9 2017 filebot.cmd
-rw-r--r-- 1 pi pi 47616 Apr 3 02:47 filebot.portable.launcher.exe
-rwxr-xr-x 1 pi pi 1824 Feb 15 2017 filebot.sh
drwxr-xr-x 6 pi pi 4096 Aug 29 00:12 lib

Noticed that data folder and lib file have a (6) and other have a (1)
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC Script On Raspian

Post by rednoah »

Make sure that the user that is running FileBot has full read/write permission for the FileBot application data folder.

If you run as root and as normal user at random, then it's very likely that files are initialized with root permissions which normal users won't have access to, so make sure to never run as root.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC Script On Raspian

Post by rednoah »

Code: Select all

Error during startup: java.nio.file.AccessDeniedException: /home/pi/filebot/data/cache/0/.lock
This error message means that FileBot cannot get a read+write lock on the cache folder. FileBot cannot work without full read+write permissions to it's application data folder.
:idea: Please read the FAQ and How to Request Help.
dacari
Donor
Posts: 44
Joined: 20 Mar 2013, 14:42

Re: AMC Script On Raspian

Post by dacari »

Thanks, that did the trick, but when I run the following script and check the folder it is empty...just the Amc.log..I guess I will try "--action move"

Code: Select all

filebot -script fn:amc --output "/mnt/Volume1/Testout" --action test -non-strict "/mnt/Volume1/TestIn" --log-file amc.log --def excludeList=amc.txt
Ok that works..This is the script that I have in utorrent, but nothing happens. What am I doing wrong?

Code: Select all

filebot -script fn:amc --output “/mnt/Volume1/Digital/Media" --log-file amc.log --action move --conflict override -non-strict --def pushover=XXX music=n artwork=y backdrops=n "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=%L" "ut_state=%S" "clean=y" --def "movieFormat=/Movies/{n} {y}/{fn}" --def "seriesFormat=/Tv/{n}/{'S'+s}/{fn}"
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC Script On Raspian

Post by rednoah »

What does the console output say?

@see viewtopic.php?f=4&t=3067
:idea: Please read the FAQ and How to Request Help.
dacari
Donor
Posts: 44
Joined: 20 Mar 2013, 14:42

Re: AMC Script On Raspian

Post by dacari »

When I run the AMC script from CLI I get the error "Syntax error: unterminated quoted string"

When I run the sysinfo I get:

FileBot 4.7.9 (r4984)
JNA Native: 5.1.0
MediaInfo: 0.7.73
Apache Commons VFS: [zip, rar]
Chromaprint: java.io.IOException: Cannot run program "fpcalc": error=2, No such file or directory
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2017-05-15 (r500)
Groovy: 2.4.10
JRE: Java(TM) SE Runtime Environment 1.8.0_144
JVM: 32-bit Java HotSpot(TM) Client VM
CPU/MEM: 4 Core / 224 MB Max Memory / 9 MB Used Memory
OS: Linux (arm)
Package: PORTABLE
uname: Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC Script On Raspian

Post by rednoah »

This is probably a bash error message telling you that your command is wrong:

Code: Select all

Syntax error: unterminated quoted string
WTF?

Code: Select all

--output “..."

:!: Are you using MS Word to write commands? The shell would never convert " to “ when typing a command.


Please read this:
viewtopic.php?f=4&t=1899
:idea: Please read the FAQ and How to Request Help.
dacari
Donor
Posts: 44
Joined: 20 Mar 2013, 14:42

Re: AMC Script On Raspian

Post by dacari »

LOL....take it easy on me..just learning this coding thing. Ok, I fixed that but I can't get utorrent to execute script to save my life. I created a test.sh which executes fine on download complete. Made an amc.sh that will run from CLI but not on download complete..this is the run program in utorrent.

sh /home/pi/filebot/amc.sh
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC Script On Raspian

Post by rednoah »

:idea: haha, just curious how you managed to enter a character that isn't on the keyboard :lol:


Please read Shell Script Debugging for Beginners for help on the next step.
:idea: Please read the FAQ and How to Request Help.
dacari
Donor
Posts: 44
Joined: 20 Mar 2013, 14:42

Re: AMC Script On Raspian

Post by dacari »

I see what happened..shamed to say, yes I was using "texedit" on Mac which messed it up...I am still fighting with having Utorrent execute the script. It executes fine when I run it from the CLI. I checked the permissions of the folder and .sh file. I tried putting the script itself in the run program line without luck. should it be this hard???....

/bin/sh /home/pi/filebot/amc.sh

Tested with utorrent running sysenv on download and that executes ok..just not amc script..Is there a error log that I can check..the /data/logs/amc.log only showing sysenv info.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC Script On Raspian

Post by rednoah »

Have you confirmed that utorrent calls your script? Or confirmed that it isn't calling your script? Because if it isn't called then we first need to figure out the problem on the utorrent side.
:idea: Please read the FAQ and How to Request Help.
dacari
Donor
Posts: 44
Joined: 20 Mar 2013, 14:42

Re: AMC Script On Raspian

Post by dacari »

Yes, confirmed that Utorrent calls echo test script - and filebot -sysenv script fine, but not any AMC script. When I run the following AMC script from CLI it executes fine but not from Utorrent call. I have checked all permissions..Why doesn't just calling the code in Utorrent work without have to make a sh file?Wondering if its because I am running the portable version or there needs to be a delay before script runs..works like a charm on windows. I made a executable test .sh to run on file complete and even that will not run...but runs fine from the CLI..Even a reboot script works on download complete...executing everything besides amc script.

/bin/sh /home/pi/filebot/test.sh

filebot -script fn:amc --output "/mnt/Volume1/Testout" --action move -non-strict "/mnt/Volume1/TestIn" --log-file amc.log --def excludeList=amc.txt
dacari
Donor
Posts: 44
Joined: 20 Mar 2013, 14:42

Re: AMC Script On Raspian

Post by dacari »

When Utorrent calls the sysenv script I get:
/home/pi/filebot/filebot.sh: 52: /home/pi/filebot/filebot.sh: /usr/bin/java: not found

Script runs ok from CLI

When utorrent calls: printenv > /home/pi/filebot/log.txt, I get:
PWD=/home/pi


Any help???...please..
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC Script On Raspian

Post by rednoah »

The $PATH is probably different when it's called by utorrent. So some executables may be in the $PATH when you use your shell, but not when called by utorrent.
:idea: Please read the FAQ and How to Request Help.
dacari
Donor
Posts: 44
Joined: 20 Mar 2013, 14:42

Re: AMC Script On Raspian

Post by dacari »

Thanks, I put the absolute path to the script in Utorrent..what would I have to do to fix? Is there a config file that I can take a look at?
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC Script On Raspian

Post by rednoah »

Please fix the $PATH environment variable so that all the executable you need are in the $PATH. Using absolute paths is not a good solution.
:idea: Please read the FAQ and How to Request Help.
dacari
Donor
Posts: 44
Joined: 20 Mar 2013, 14:42

Re: AMC Script On Raspian

Post by dacari »

FB, Java, and all scripts in the $PATH. uTserver just not finding Java or executing any Java related scripts. At a lost at this point. I'm sure someone has this working somewhere...just can't find a current install guide...the last thing I can think to do is change Java version and from JRE to JDK.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC Script On Raspian

Post by rednoah »

Code: Select all

ls -l /usr/bin/java
What does it say?
:idea: Please read the FAQ and How to Request Help.
Post Reply