Page 1 of 1

Filebot cli don't exit

Posted: 07 Nov 2019, 10:06
by oleronning

I've just installed Filebot command line interface to manage files downloaded from Transmission.

I have build a script that I use for testing before deploying it to the Transmission work flow.

The script is s follows

Code: Select all


# Input Parameters


# Configuration

/usr/bin/filebot -script fn:amc \
        --output "$MEDIA_DIR" \
        --action duplicate \
        -non-strict "$1"
        --conflict auto
        --log-file /var/log/filebot.log \
        --def \
            unsorted=y \
            music=n \
            artwork=y \
            subtitles=en \
            excludeList=".excludes" \
            deleteAfterExtract=n \
            clean=y \

function edate 
  echo "`date '+%Y-%m-%d %H:%M:%S'`    $1" >> "$LOGFILE"

edate "_____________________NEW TORRENT FINISHED ____________________"
edate "Transmission version: $TR_APP_VERSION"
edate "Time:  $TR_TIME_LOCALTIME"
edate "Directory: $ARG_PATH"
edate "Torrent Hash: $TR_TORRENT_HASH"
edate "Torrent ID: $TR_TORRENT_ID"
edate "Torrent name: $ARG_NAME "
When I run the script from the command line, everything seems to work fine until the file is being copied.

First I get the following message:

Code: Select all

[DUPLICATE] from [/path/file.mkv] to [/newpath/newfile.mkv]
cp: failed to clone '/newpath/newfile.mkv' from '/path/file.mkv': Invalid cross-device link
I'm copying the file to a NAS, so this message is expected, and I guess in the background the fallback is to do a copy.

My main issues is that the script never exits. After the error message above, nothing happens. The file is indeed copied as I can see in the destination folder, but the log file is never written.

Any idea what may be the cause of this?

Thank you in advance

Re: Filebot cli don't exit

Posted: 07 Nov 2019, 10:45
by rednoah
What version of FileBot are you using? Please include filebot -script fn:sysinfo output.

filebot commands never freeze, as it's a step by step process that doesn't really allow for "nothing" to happen. It's either doing something, or it'll crash.

:idea: Since hardlink / reflink copy isn't possible in your situation, it's doing a physical copy, which isn't instant, and can take a while, especially for very large files. Presumably, it's just copying files. How long did you wait for it to finish?

Are you running the script yourself? Or just checking the log file later on? If the process crashes, then there will be console output, but looking at your script, that console output is not redirected to file, so it would look like it just stopped suddenly, because crash logs aren't recorded:

:idea: Run commands yourself, or make sure to capture full console output when calling scripts via 3rd party tools:

Code: Select all

/path/to/my/script > "/path/to/console-output.txt" 2>&1

Re: Filebot cli don't exit

Posted: 07 Nov 2019, 11:24
by oleronning
I've just rebooted my server, and everything seems to be working fine now. Not sure if it was a network issue or what, but anyways thank you very much for your support.

Kind regards

Re: Filebot cli don't exit

Posted: 07 Nov 2019, 12:08
by rednoah
Capturing all console output is still good practice though, so you have it if you need it: