Page 1 of 1
Total noob needs help setting up script for rTorrent(Ubuntu)
Posted: 07 Feb 2015, 19:41
by Dresden
I recently installed Filebot on my Linux server running Ubuntu 14.04. It appears filebot was installed correctly. However, after creating a file named 'rtorrent-postprocess' and inserting the following lines of code, it does not appear to be working correctly:
Code: Select all
#!/bin/bash
TORRENT_PATH=$1
TORRENT_NAME=$2
TORRENT_LABEL=$3
filebot -script fn:amc --output "/home/plex" --log-file amc.log --action symlink --conflict override -non-strict --def "seriesFormat=/home/plex/tv\ shows/{n}/{'S'+s}/{fn}" --def "animeFormat=/home/plex/Anime/{n}/{fn}" --def "movieFormat=/home/plex/movies/{n} {y}/{fn}" --def "musicFormat=/home/plex/Music/{n}/{fn}" --def subtitles=en "ut_dir=$TORRENT_PATH" "ut_kind=multi" "ut_title=$TORRENT_NAME" "ut_label=$TORRENT_LABEL"
Basically, I want it to create symlinks of my media and their subtitles in their respective library folders. The 4 libraries folders have already been made, and the entire /home/ directory has permissions of 775. I have no idea if I wrote that correctly or not... Anyone got any tips?
I can't find the log file, anywhere, so maybe someone could point me to how to view it and that might put me on the right track.
Re: Total noob needs help setting up script for rTorrent(Ubu
Posted: 08 Feb 2015, 13:26
by skullzy
I'm not familiar with the linux command line.. but you can "like all command lines and script", log the output of the bash file to a different location, something like.. >directory/to/place/log/file.txt
So something like this..
Code: Select all
#!/bin/bash
LOGFILE=/location/to/place/file.log
TORRENT_PATH=$1
TORRENT_NAME=$2
TORRENT_LABEL=$3
filebot -script fn:amc --output "/home/plex" --log-file amc.log --action symlink --conflict override -non-strict --def "seriesFormat=/home/plex/tv\ shows/{n}/{'S'+s}/{fn}" --def "animeFormat=/home/plex/Anime/{n}/{fn}" --def "movieFormat=/home/plex/movies/{n} {y}/{fn}" --def "musicFormat=/home/plex/Music/{n}/{fn}" --def subtitles=en "ut_dir=$TORRENT_PATH" "ut_kind=multi" "ut_title=$TORRENT_NAME" "ut_label=$TORRENT_LABEL" >>$LOGFILE
Then you can view that log and see where the problem is..
Re: Total noob needs help setting up script for rTorrent(Ubu
Posted: 09 Feb 2015, 02:15
by Dresden
Thanks for the assistance. I tried what you have, and it's not doing anything for me. No log file is created, which leads me to believe the script is not being executed. This is what I have pasted to the very bottom of my .rtorrent.rc file:
Code: Select all
system.method.set_key=event.download.finished,filebot_amc,"execute={/home/dresden/rtorrent-postprocess,$d.get_base_path=,$d.get_name=,$d.get_custom1=}"
Does that appear to be correct?
Re: Total noob needs help setting up script for rTorrent(Ubu
Posted: 09 Feb 2015, 08:50
by skullzy
Dresden wrote:Thanks for the assistance. I tried what you have, and it's not doing anything for me. No log file is created, which leads me to believe the script is not being executed. This is what I have pasted to the very bottom of my .rtorrent.rc file:
Code: Select all
system.method.set_key=event.download.finished,filebot_amc,"execute={/home/dresden/rtorrent-postprocess,$d.get_base_path=,$d.get_name=,$d.get_custom1=}"
Does that appear to be correct?
I am not entirely sure, but from what I could google about that specific command, when executing the bash file you should also be including the bash file extension to the end of the file name.
Code: Select all
/home/dresden/rtorrent-postprocess.sh
Here's an example which I found on the rtorrent ArchWiki
Code: Select all
system.method.set_key = event.download.finished,notify_me,"execute=/path/to/mail.sh,$d.get_name="
The only major difference I can see between that code and yours, is that you never included the extension for the bash file, so it appears that it isn't being executed.
Also replace the following on the bash script, I just looked something about redirecting the log information, and the one you have might not send both the standard output and the error output.
so replace
>>$LOGFILE with
&> $LOGFILE
For more information about redirecting the files output you can go here
...HOWTO/Bash-Prog-Intro-HOWTO-3.html
Re: Total noob needs help setting up script for rTorrent(Ubu
Posted: 09 Feb 2015, 14:19
by rednoah
Keep in mind that >> is ONLY REDIRECTING STANDARD OUTPUT, and is NOT REDIRECTING ERROR OUTPUT.
And for debugging any output is meaningless unless it include STDOUT and STDERR output.
