Hi.
First of all, thanks a lot for a nice program. I have been trying to set up AMC according to the official guide here:
viewtopic.php?f=4&t=215
I am running rTorrent on FreeBSD.
In .rtorrent.rc, I have appended the following at the bottom and restarted rTorrent several times:
system.method.set_key=event.download.finished,filebot_amc,"execute={~/rtorrent-postprocess,$d.get_base_path=,$d.get_name=,$d.get_custom1=}"
In the same folder, that is the home folder of my service account, I have created a file rtorrent-postprocess with the following content:
#!/usr/local/bin/bash
TORRENT_PATH=$1
TORRENT_NAME=$2
TORRENT_LABEL=$3
java -jar ~/FileBot/FileBot.jar -script fn:amc --output "/mnt/" --log-file amc.log --action copy --conflict override -non-strict --def artwork=y --def xbmc=htpc --def "seriesFormat=/tvshows/{n}/{'Season '+s}/{n} - {s00e00} - {t}" "ut_dir=$TORRENT_PATH" "ut_kind=multi"
"ut_title=$TORRENT_NAME" "ut_label=$TORRENT_LABEL" &
I can run ~/rtorrent-postprocess from the terminal, but the script fails for obvious reasons (no parameters supplied). The error is written to the ~/.filebot/logs/amc.log log file.
However, rTorrent does not seem to trigger AMC. When a new download has finished, nothing seems to happen with the files and nothing is written to the ~/.filebot/logs/amc.log log file.
Any suggestions?
rTorrent. Event not triggered, script not executed?
Re: rTorrent. Event not triggered, script not executed?
Have you confirmed that the bash script is called at all?
FYI ~ is a sh construct like*that will most likely not work in other programs.
On an unrelated note. Using java -jar ~/FileBot/FileBot.jar is highly discouraged. Use filebot.sh instead. If you're using the jar, use the portable distribution instead.
FYI ~ is a sh construct like*that will most likely not work in other programs.
On an unrelated note. Using java -jar ~/FileBot/FileBot.jar is highly discouraged. Use filebot.sh instead. If you're using the jar, use the portable distribution instead.
Re: rTorrent. Event not triggered, script not executed?
Hi.rednoah wrote:Have you confirmed that the bash script is called at all?
FYI ~ is a sh construct like*that will most likely not work in other programs.
On an unrelated note. Using java -jar ~/FileBot/FileBot.jar is highly discouraged. Use filebot.sh instead. If you're using the jar, use the portable distribution instead.
I have not confirmed that the bash script is called at all, but since nothing is written to the amc.log, I assumed that it wasn't. Are there any other ways I can check?
I will use filebot.sh instead of the .jar. I do use the portable distribution, however.
Best regards.
Re: rTorrent. Event not triggered, script not executed?
I'd start with just writing the current date to file or some other really really basic shell script. And use absolute paths for everything, anything that might be variable. First you eliminate anything that could go wrong, and once you have something that works, you start building from there.
Re: rTorrent. Event not triggered, script not executed?
With absolute paths, I have managed to get the script to run - confirmed via rtorrent logging into /tmp/exec.log.
The problem seems to be that /home/user/FileBot/filebot.sh fails with the error that java is not found, even though java is installed and /home/user/FileBot/filebot.sh runs fine when run manually by the same user in the terminal. In short, I have an issue with permissions and/or path.
The problem seems to be that /home/user/FileBot/filebot.sh fails with the error that java is not found, even though java is installed and /home/user/FileBot/filebot.sh runs fine when run manually by the same user in the terminal. In short, I have an issue with permissions and/or path.
Re: rTorrent. Event not triggered, script not executed?
Most likely the PATH. The interactive login shell is not the same as a system call by a program. Things like ~/.profile or ~/.bashrc are never executed.
When rtorrent is calling a program, it's doing just that, calling a program. It's not implicitly calling a bash and then passing a command for that bash shell to execute. Though you could do that of course.
When rtorrent is calling a program, it's doing just that, calling a program. It's not implicitly calling a bash and then passing a command for that bash shell to execute. Though you could do that of course.
Re: rTorrent. Event not triggered, script not executed?
Ah, I see. It works now, but only because I entered the full path to java in filebot.sh.rednoah wrote:Most likely the PATH. The interactive login shell is not the same as a system call by a program. Things like ~/.profile or ~/.bashrc are never executed.
When rtorrent is calling a program, it's doing just that, calling a program. It's not implicitly calling a bash and then passing a command for that bash shell to execute. Though you could do that of course.
Can you tell me if the update-filebot.sh script also reverts the filebot.sh? If yes, do you have any ideas how I can solve my problem in a more persistent way?
Re: rTorrent. Event not triggered, script not executed?
It's only updating the jar, i.e. it's doing 1 curl call:
Code: Select all
cat update-filebot.sh