executing script returns: No such file

Any questions? Need some help?
Post Reply
sidcypher
Posts: 8
Joined: 22 Mar 2015, 17:55

executing script returns: No such file

Post by sidcypher »

Long time no post, fresh server install no more gui... one thing I can't seem to get..

when executing tpp.sh from my home directory (where tpp.sh is located) only slightly modified from 2 years ago..

Code: Select all

#!/bin/bash
filebot -script fn:amc --output "/mnt/500g/zeroday" --log-file amc.log --action test --conflict override -non-strict --def pushbullet=*removed for post* --def "seriesFormat=/tv/{n.replaceAll(/[.]/)}/{'Season '+s}/{n.replaceAll(/[.]/)} {s00e00} - {t}" music=n artwork=y "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"
I get the following error

Code: Select all

-bash: ./tpp.sh: /bin/bash^M: bad interpreter: No such file or directory
However, when executing fbtest.sh from my home directory (where fbtest.sh is located)

Code: Select all

#!/bin/bash
filebot -script fn:sysenv --log-file geez.log
It seems to work fine providing me with the log file as follows

Code: Select all

# Environment Variables #
_: /usr/local/bin/filebot
MAIL: /var/mail/james
LOGNAME: james
SHLVL: 2
LD_LIBRARY_PATH: /opt/filebot
XDG_RUNTIME_DIR: /run/user/1000
HOME: /home/james
SSH_CONNECTION: *removed for post*
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
SSH_TTY: /dev/pts/2
SSH_CLIENT: *removed for post*
XFILESEARCHPATH: /usr/dt/app-defaults/%L/Dt
XDG_SESSION_ID: 2
SHELL: /bin/bash
LESSOPEN: | /usr/bin/lesspipe %s
LESSCLOSE: /usr/bin/lesspipe %s %s
TERM: xterm
NLSPATH: /usr/dt/lib/nls/msg/%L/%N.cat
LANG: en_US.UTF-8
PWD: /home/james
USER: james
LS_COLORS: rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:


# Java System Properties #
path.separator: :
net.filebot.UserFiles.fileChooser: JavaFX
java.vm.name: Java HotSpot(TM) 64-Bit Server VM
application.cache: /home/james/.cache/FileBot/ehcache.disk.store
java.io.tmpdir: /home/james/.cache/FileBot/java.io.tmpdir
user.country: US
user.home: /home/james
useExtendedFileAttributes: true
org.apache.commons.logging.Log: org.apache.commons.logging.impl.NoOpLog
java.vm.vendor: Oracle Corporation
user.language: en
java.vendor: Oracle Corporation
java.vendor.url.bug: http://bugreport.sun.com/bugreport/
swing.crossplatformlaf: javax.swing.plaf.nimbus.NimbusLookAndFeel
sun.net.client.defaultReadTimeout: 60000
java.specification.name: Java Platform API Specification
jna.nosys: true
os.name: Linux
java.runtime.name: Java(TM) SE Runtime Environment
application.deployment: usc
application.update: skip
file.separator: /
sun.net.client.defaultConnectTimeout: 10000
java.vm.specification.version: 1.8
swing.aatext: true
sun.boot.class.path: /opt/filebot/jre/lib/resources.jar:/opt/filebot/jre/lib/rt.jar:/opt/filebot/jre/lib/sunrsasign.jar:/opt/filebot/jre/lib/jsse.jar:/opt/filebot/jre/lib/jce.jar:/opt/filebot/jre/lib/charsets.jar:/opt/filebot/jre/lib/jfr.jar:/opt/filebot/jre/classes
java.version: 1.8.0_66
unixfs: false
http.agent: FileBot 4.6.1
java.library.path: /opt/filebot:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
useGVFS: true
awt.toolkit: sun.awt.X11.XToolkit
java.vm.specification.name: Java Virtual Machine Specification
os.version: 3.19.0-25-generic
useCreationDate: false
file.encoding: UTF-8
grape.root: /home/james/.config/FileBot/grape
java.awt.printerjob: sun.print.PSPrinterJob
java.class.version: 52.0
java.ext.dirs: /opt/filebot/jre/lib/ext:/usr/java/packages/lib/ext
awt.useSystemAAFontSettings: on
java.specification.version: 1.8
net.filebot.AcoustID.fpcalc: /opt/filebot/fpcalc
java.vendor.url: http://java.oracle.com/
ehcache.disk.store.dir: /home/james/.cache/FileBot/ehcache.disk.store/0
sun.os.patch.level: unknown
sun.java.launcher: SUN_STANDARD
os.arch: amd64
user.dir: /home/james
user.timezone: 
line.separator: 

sun.cpu.endian: little
java.vm.specification.vendor: Oracle Corporation
sun.java2d.xrender: true
java.home: /opt/filebot/jre
java.net.useSystemProxies: true
sun.management.compiler: HotSpot 64-Bit Tiered Compilers
sun.arch.data.model: 64
java.endorsed.dirs: /opt/filebot/jre/lib/endorsed
file.encoding.pkg: sun.io
java.specification.vendor: Oracle Corporation
sun.boot.library.path: /opt/filebot/jre/lib/amd64
sun.jnu.encoding: UTF-8
java.runtime.version: 1.8.0_66-b17
java.vm.info: mixed mode
java.vm.version: 25.66-b17
sun.io.unicode.encoding: UnicodeLittle
application.dir: /home/james/.config/FileBot
java.awt.graphicsenv: sun.awt.X11GraphicsEnvironment
sun.java.command: /opt/filebot/FileBot.jar -script fn:sysenv --log-file geez.log
java.class.path: /opt/filebot/FileBot.jar
sun.cpu.isalist: 
user.name: james


# Arguments #
args[0] = -script
args[1] = fn:sysenv
args[2] = --log-file
args[3] = geez.log


Done ヾ(@⌒ー⌒@)ノ

Also tried having transmission call the fbtest.sh script on torrent completion and it didn't seem to work but that if for later.

I see did one other post referring to this error, but that was someone using the portable filebot package on a seedbox, it did not seem to help me.

A little rusty again with the terminal skills (because this awesome program worked flawlessly), so if anything more is needed just let me know what to post.

Thanks
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: executing script returns: No such file

Post by rednoah »

Unix doesn't like Windows line endings.

@see http://stackoverflow.com/a/15021070/1514467
:idea: Please read the FAQ and How to Request Help.
sidcypher
Posts: 8
Joined: 22 Mar 2015, 17:55

Re: executing script returns: No such file

Post by sidcypher »

So that was the carriage returns the other forum post was referring too.
viewtopic.php?f=8&t=138&p=1000&hilit=ba ... tory#p1000

Geez that was simple dos2unix fixed that..

Thanks rednoah
sidcypher
Posts: 8
Joined: 22 Mar 2015, 17:55

Re: executing script returns: No such file

Post by sidcypher »

I thought maybe transmission wasn't calling the script, so using the tips from viewtopic.php?f=4&t=3067

Using at the end of my post process script

Code: Select all

> "/home/james/test.txt" 2>&1
I now know it is attempting to call that script but I am getting:

Code: Select all

The environment variable 'HOME' must be set
I also searched the forums and found this viewtopic.php?f=11&t=3301&hilit=The+env ... ust+be+set

does that mean I need to set home in the script? (as previously when it had worked on a different system I did not need to set home)

It looks to be set... but I don't know why it isn't working

Code: Select all

james@Beast:~$ printenv
XDG_SESSION_ID=1
TERM=xterm
SHELL=/bin/bash
SSH_CLIENT=192.168.1.106 56206 982
SSH_TTY=/dev/pts/0
USER=james
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
MAIL=/var/mail/james
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
PWD=/home/james
LANG=en_US.UTF-8
SHLVL=1
HOME=/home/james
LOGNAME=james
SSH_CONNECTION=192.168.1.106 56206 192.168.1.205 982
LESSOPEN=| /usr/bin/lesspipe %s
XDG_RUNTIME_DIR=/run/user/1000
LESSCLOSE=/usr/bin/lesspipe %s %s
_=/usr/bin/printenv
james@Beast:~$ echo $HOME
/home/james
james@Beast:~$
Everything runs fine manually from terminal (short of the argument errors from script because transmission isn't passing the information since it isn't executing it)
Any ideas?
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: executing script returns: No such file

Post by rednoah »

SSH environment is NOT THE SAME as the environment that filebot is executed with. Do printenv in your post process script and see what it says. ;)

And then you can add a line like this somewhere at the beginning of your post process script:

Code: Select all

export HOME=/home/james
:idea: Please read the FAQ and How to Request Help.
sidcypher
Posts: 8
Joined: 22 Mar 2015, 17:55

Re: executing script returns: No such file

Post by sidcypher »

Did not realize the SSH was not the same environment as what the script was running it...

I did think for a minute that I needed to add that

Code: Select all

export HOME=/home/james
But I let my previous setup when this had been working fine the last couple years cloud my thinking.. Something must have been different elsewhere on that to cause me not to need it..

You, of course, were right yet again..

Code: Select all

TERM=linux
TR_TORRENT_DIR=/mnt/500g/torrent
TR_TIME_LOCALTIME=Sun Feb 28 22:14:32 2016
ADDRFAM=inet
TR_TORRENT_ID=2
METHOD=loopback
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
PWD=/
TR_TORRENT_HASH=4158139dc33d015640f89d584c48883cbee77858
SHLVL=1
UPSTART_INSTANCE=
UPSTART_EVENTS=filesystem net-device-up
IFACE=lo
UPSTART_JOB=transmission-daemon
LOGICAL=lo
TR_APP_VERSION=2.82
TR_TORRENT_NAME=Criminal.Minds.S11E15.HDTV.x264-FUM[ettv]
_=/usr/bin/printenv

added that

Code: Select all

export HOME=/home/james
and it works flawlessly now..

Such an awesome program supported by an awesome individual, thanks man!
Post Reply