CLI only on a linux headless server

Any questions? Need some help?
Post Reply
wasabi-warrior
Posts: 4
Joined: 03 Mar 2014, 11:37

CLI only on a linux headless server

Post by wasabi-warrior »

Hey everyone,
Im running a headless linux server, and would like to use filebot as part of an assortment of scripts to help manage my collection of files. Being a headless server, I only have access to the CLI.

What is the most direct way to get FileBot working with CLI only without installing extras (e.g. all files in a single directory or easily located and secured, discounting dependencies like java, etc.)?

And (if possible, though not strictly necessary), can the portable version of filebot.sh be modified in such a way to launch filebot and pass arguments in order to avoid 'installing' a .deb and strictly use the portable files? (this would probably be an answer to the first question).

I would just like FileBot there, to accept my CLI arguments, and not strictly installed on my system. Hope my question makes sense!
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: CLI only on a linux headless server

Post by rednoah »

1. The only real dependency is Java. Though it's good to have libmediainfo as well which is bundled with the filebot packages anyway.

2. The portable package is, as it says, portable, and will not touch anything outside of it's own folder. Not sure how you're confused about filebot.sh, it's a simple startup script and yes, it will pass along your arguments.
:idea: Please read the FAQ and How to Request Help.
wasabi-warrior
Posts: 4
Joined: 03 Mar 2014, 11:37

Re: CLI only on a linux headless server

Post by wasabi-warrior »

Thanks rednoah. I was confused about the starting script, since when running ./filebot.sh on its own didnt produce any usage instructions for CLI, it just attempted to launch what I can assume was the GUI for the .jar and crashed. I assumed it was just a launcher and nothing more.

Guess I shouldve stuck at it a little while longer.

Is the portable version also x86 or x64 dependant for Java?
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: CLI only on a linux headless server

Post by rednoah »

Produces using instructions:

Code: Select all

filebot -help
64-bit Java is better. But it doesn't matter as long as you don't need any of the native libraries. Pure Java application are platform-independent, including architecture. Only when FileBot starts loading libmediainfo or lib7zip then bitness becomes important.
:idea: Please read the FAQ and How to Request Help.
wasabi-warrior
Posts: 4
Joined: 03 Mar 2014, 11:37

Re: CLI only on a linux headless server

Post by wasabi-warrior »

Thanks rednoah,
You are completely right, and I hope you excuse my ignorance.

To be clear (for any future user who stumbles on this thread), I used ./filebot.sh -help from the command line, and it showed the same result. So filebot.sh from the portable version does indeed take all command line arguments without needing to be added to PATH.

Thanks again for all your help.
wasabi-warrior
Posts: 4
Joined: 03 Mar 2014, 11:37

Re: CLI only on a linux headless server

Post by wasabi-warrior »

Hello again,
Run into a spot of bother. Let me know if I should start a new thread for my error.

Using the following command:

Code: Select all

./filebot.sh -rename "/disk1/Example Movie (2013) [1080p]" --db TheMovieDB --format "/disk4/Movies/{n.replaceTrailingBrackets().replaceAll(/[!?.]+\$/).replaceAll(/[\`´‘’ʻ]/, \"'\")}.{vf}.({y})/{n.replaceTrailingBrackets().replaceAll(/[!?.]+\$/).replaceAll(/[\`´‘’ʻ]/, \"'\")}.{vf}.({y})" -non-strict -r
I've made sure to escape all my characters correctly, although i'm not sure if special characters like ` are impacting this. The end result is supposed to recursively sort through a heap of folders and non-foldered files with a bunch of different naming conventions, and output them to a new directory using 'Title.720p.(2013)\Title.720p.(2013)' (e.g. each in a folder matching its name).


Your application is genius, but not sure how good you are with Linux. It appears to be a linux related error. I recieve an error when attempting to run, so here is the debugged result (from using bash -x):

Code: Select all

bash -x ./filebot.sh -rename "/disk1/Example Movie (2013)  [1080p]" --db TheMovieDB --format "/disk4/Movies/{n.replaceTrailingBrackets().replaceAll(/[!?.]+\$/).replaceAll(/[\`´‘’ʻ]/, \"'\")}.{vf}.({y})/{n.replaceTrailingBrackets().replaceAll(/[!?.]+\$/).replaceAll(/[\`´‘’ʻ]/, \"'\")}.{vf}.({y})" -non-strict -r
+ SOURCE=./filebot.sh
+ '[' -h ./filebot.sh ']'
+++ dirname ./filebot.sh
++ cd -P .
++ pwd
+ dir_bin=/home/media/FileBot_4.0
+ export LANG=en_US.utf8
+ LANG=en_US.utf8
+ java -Dunixfs=false -DuseGVFS=false -DuseExtendedFileAttributes=false -DuseCreationDate=false -Dfile.encoding=UTF-8 -Djava.net.useSystemProxies=true -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Djna.nosys=true -Dapplication.deployment=portable -Dapplication.analytics=true -Dapplication.warmup=false -Dnet.sourceforge.filebot.AcoustID.fpcalc=fpcalc -Dapplication.dir=/home/media/FileBot_4.0 -Djava.io.tmpdir=/home/media/FileBot_4.0/temp -Duser.home=/home/media/FileBot_4.0 -Djna.library.path=/home/media/FileBot_4.0 -Djava.library.path=/home/media/FileBot_4.0 -Djava.util.prefs.PreferencesFactory=net.sourceforge.tuned.prefs.FilePreferencesFactory -Dnet.sourceforge.tuned.prefs.file=/home/media/FileBot_4.0/prefs.properties -jar /home/media/FileBot_4.0/FileBot.jar -rename '/disk1/Example'\''s Movie (2013) [1080p]' --db TheMovieDB --format '/disk4/Movies/{n.replaceTrailingBrackets().replaceAll(/[!?.]+$/).replaceAll(/[`´‘’ʻ]/, "'\''")}.{vf}.({y})/{n.replaceTrailingBrackets().replaceAll(/[!?.]+$/).replaceAll(/[`´‘’ʻ]/, "'\''")}.{vf}.({y})' -non-strict -r

(process:12878): GLib-GIO-ERROR **: Settings schema 'org.gnome.system.proxy' is not installed

./filebot.sh: line 9: 12878 Trace/breakpoint trap   java -Dunixfs=false -DuseGVFS=false -DuseExtendedFileAttributes=false -DuseCreationDate=false -Dfile.encoding=UTF-8 -Djava.net.useSystemProxies=true -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Djna.nosys=true -Dapplication.deployment=portable -Dapplication.analytics=true -Dapplication.warmup=false -Dnet.sourceforge.filebot.AcoustID.fpcalc=fpcalc "-Dapplication.dir=$dir_bin" "-Djava.io.tmpdir=$dir_bin/temp" "-Duser.home=$dir_bin" "-Djna.library.path=$dir_bin" "-Djava.library.path=$dir_bin" -Djava.util.prefs.PreferencesFactory=net.sourceforge.tuned.prefs.FilePreferencesFactory "-Dnet.sourceforge.tuned.prefs.file=$dir_bin/prefs.properties" -jar "$dir_bin/FileBot.jar" "$@"
It appears your java application is looking for "org.gnome.system.proxy" perhaps? Maybe I should remove the SystemProxies argument from your java starter? After not finding it, it crashes with a Trace/breakpoint trap. I have no idea what a breakpoint trap is. A quick google lends me toward a Unix SIGTRAP error. Any ideas?

I'm running Filebot_4.0, portable. Java is installed and working.
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: CLI only on a linux headless server

Post by rednoah »

I suppose the system proxy Java implementation for Linux doesn't work on your server:

Code: Select all

-Djava.net.useSystemProxies=false
:idea: Please read the FAQ and How to Request Help.
Post Reply