Filebot cli don't exit

Support for Ubuntu and other Desktop Linux distributions
Post Reply
oleronning
Posts: 2
Joined: 07 Nov 2019, 09:39

Filebot cli don't exit

Post by oleronning »

Hi,

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

#!/bin/bash

# Input Parameters
ARG_PATH=$1
ARG_NAME=$2
ARG_LABEL="N/A"

LOGFILE="/var/log/transmission-post-process.log"

# Configuration
MEDIA_DIR="/media/gringotts"

/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 \
            seriesFormat="$MEDIA_DIR/tv-shows/{plex}"
            movieFormat="$MEDIA_DIR/movies/{plex}"
            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
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot cli don't exit

Post by rednoah »

1.
What version of FileBot are you using? Please include filebot -script fn:sysinfo output.


2.
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?


3.
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:
viewtopic.php?t=3067


: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
:idea: Please read the FAQ and How to Request Help.
oleronning
Posts: 2
Joined: 07 Nov 2019, 09:39

Re: Filebot cli don't exit

Post 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
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot cli don't exit

Post by rednoah »

Capturing all console output is still good practice though, so you have it if you need it:
viewtopic.php?t=3067
:idea: Please read the FAQ and How to Request Help.
Post Reply