You have to tell transmission where the script is located. I have changed the starting post to point you in the right direction.meathane wrote:Could anybody explain how to 'install' this script, or get it to run once a download is finished?
Unrar and cleanup script - UPDATE 2013.05.24
Re: Unrar and cleanup script - UPDATE 2011.10.24
Re: Unrar and cleanup script - UPDATE 2011.10.24
Hello!
I run Ubuntu 11.1 and Transmission 2.33 I just installed unrar and tried the script below but it will not work??? What shall I do. Many many thanks for the help I spent hours trying to activate and test older scripts. There is no file according to "/var/log/unpacks.log" shall I create this file or is the absense of the file a proof that the script is not run? I have activeted transmission to run the script everytime the torrent is finalized this I have understood!
#!/bin/bash
#
# Simple extraction script for torrents with compressed files.
# Directory to store the un-compressed files in.
DEST_DIR="${TR_TORRENT_DIR}/${TR_TORRENT_NAME}/"
# Source directory, should not be changed.
SRC_DIR="${TR_TORRENT_DIR}/${TR_TORRENT_NAME}"
# Log file, file where we tell what files have been processed.
LOG_FILE="/var/log/unpacks.log"
# Get current time
RUN_AT=$(date +"%F %T")
I run Ubuntu 11.1 and Transmission 2.33 I just installed unrar and tried the script below but it will not work??? What shall I do. Many many thanks for the help I spent hours trying to activate and test older scripts. There is no file according to "/var/log/unpacks.log" shall I create this file or is the absense of the file a proof that the script is not run? I have activeted transmission to run the script everytime the torrent is finalized this I have understood!
#!/bin/bash
#
# Simple extraction script for torrents with compressed files.
# Directory to store the un-compressed files in.
DEST_DIR="${TR_TORRENT_DIR}/${TR_TORRENT_NAME}/"
# Source directory, should not be changed.
SRC_DIR="${TR_TORRENT_DIR}/${TR_TORRENT_NAME}"
# Log file, file where we tell what files have been processed.
LOG_FILE="/var/log/unpacks.log"
# Get current time
RUN_AT=$(date +"%F %T")
Re: Unrar and cleanup script - UPDATE 2011.10.24
Hello again!
Here is the entire script I use i missed the last rows:
#!/bin/bash
#
# Simple extraction script for torrents with compressed files.
# Directory to store the un-compressed files in.
DEST_DIR="${TR_TORRENT_DIR}/${TR_TORRENT_NAME}/"
# Source directory, should not be changed.
SRC_DIR="${TR_TORRENT_DIR}/${TR_TORRENT_NAME}"
# Log file, file where we tell what files have been processed.
LOG_FILE="/var/log/unpacks.log"
# Get current time
RUN_AT=$(date +"%F %T")
find "${SRC_DIR}" -iname "*.rar" -execdir unrar e -inul -o+ -kb '{}' "${DEST_DIR}" \; -printf "${RUN_AT}: Unpacked %f into %H\n" , -iname "*.zip" -execdir unzip -qq -o '{}' -d "${DEST_DIR}" \; -printf "${RUN_AT}: Unpacked %f into %H\n" >> "${LOG_FILE}"
Here is the entire script I use i missed the last rows:
#!/bin/bash
#
# Simple extraction script for torrents with compressed files.
# Directory to store the un-compressed files in.
DEST_DIR="${TR_TORRENT_DIR}/${TR_TORRENT_NAME}/"
# Source directory, should not be changed.
SRC_DIR="${TR_TORRENT_DIR}/${TR_TORRENT_NAME}"
# Log file, file where we tell what files have been processed.
LOG_FILE="/var/log/unpacks.log"
# Get current time
RUN_AT=$(date +"%F %T")
find "${SRC_DIR}" -iname "*.rar" -execdir unrar e -inul -o+ -kb '{}' "${DEST_DIR}" \; -printf "${RUN_AT}: Unpacked %f into %H\n" , -iname "*.zip" -execdir unzip -qq -o '{}' -d "${DEST_DIR}" \; -printf "${RUN_AT}: Unpacked %f into %H\n" >> "${LOG_FILE}"
Re: Unrar and cleanup script - UPDATE 2011.10.24
You do realize there is a WORKING script (Debian/Ubuntu) in the first post of this topic, right?TTTJOhan wrote:Hello!
I run Ubuntu 11.1 and Transmission 2.33 I just installed unrar and tried the script below but it will not work??? What shall I do. Many many thanks for the help I spent hours trying to activate and test older scripts. There is no file according to "/var/log/unpacks.log" shall I create this file or is the absense of the file a proof that the script is not run? I have activeted transmission to run the script everytime the torrent is finalized this I have understood!
Re: Unrar and cleanup script - UPDATE 2011.10.24
Hello Again,
Regarding working script I have tried this but it does not work: I cant find the file and folder according to below.
"To make the script work you have to add/change these lines in a configuration file named "settings.json" (usually /etc/transmission-daemon/settings.json) while transmission-daemon is not running. Oh and make sure unrar is installed. (aptitude install unrar)"
Questions: /etc/transmission-daemon/settings.json the folder and file does not exist on my computer, have the file system changed?
Regarding working script I have tried this but it does not work: I cant find the file and folder according to below.
"To make the script work you have to add/change these lines in a configuration file named "settings.json" (usually /etc/transmission-daemon/settings.json) while transmission-daemon is not running. Oh and make sure unrar is installed. (aptitude install unrar)"
Questions: /etc/transmission-daemon/settings.json the folder and file does not exist on my computer, have the file system changed?
Re: Unrar and cleanup script - UPDATE 2011.10.24
Hello!
Great job! However, I'm on Ubuntu 11.10 and I can't get your script to work. I don't get any log either so it's like the script doesn't run at all. What I did was add the script to my home folder and simply pointed transmission to it and that should be it, right? Or did I miss anything?
Thank you!
Great job! However, I'm on Ubuntu 11.10 and I can't get your script to work. I don't get any log either so it's like the script doesn't run at all. What I did was add the script to my home folder and simply pointed transmission to it and that should be it, right? Or did I miss anything?
Thank you!
Re: Unrar and cleanup script - UPDATE 2011.10.24
I'm having similar issues on CentOS 6 with transmission-daemon 2.33
The log file claims to be running the script, but nothing that the script would be doing is taking place.
What sort of diagnostic information can I collect to help figure this out? This is very frustrating.
Thanks!
-brian
The log file claims to be running the script, but nothing that the script would be doing is taking place.
What sort of diagnostic information can I collect to help figure this out? This is very frustrating.
Thanks!
-brian
Re: Unrar and cleanup script - UPDATE 2011.10.24
Hello!
I have understood that the files that are hidden in order to view them this option needs to be enabled. However I have unrar installed and the settings.json are according to message number 1. The script does not work for files with name.rar does not work for single rar files????
Any other frame work etc that needs to be enabled in order to get the script to work?
I have understood that the files that are hidden in order to view them this option needs to be enabled. However I have unrar installed and the settings.json are according to message number 1. The script does not work for files with name.rar does not work for single rar files????
Any other frame work etc that needs to be enabled in order to get the script to work?
Re: Unrar and cleanup script - UPDATE 2011.10.24
Now I have read all posts in this thread.
1. I have updated login and password according to login and password in Transmission
2. Changed permission for the script file and its folder to 777
3. Tested to run the script manually then I get "2011-11-16 20:36:01 Error unrarring " in the posttorrent logfile, this is all the text in there. Thus the script is not executed by Transmission!?
4. Transmission is pointing to the right script
5. settings.json are set-up according to the instructions in the first message in this thread.
6. Unrar is installed
I am running Ubuntu 11.1 why does not Transmission execute the script?
HELP! I will give up this very soon.
1. I have updated login and password according to login and password in Transmission
2. Changed permission for the script file and its folder to 777
3. Tested to run the script manually then I get "2011-11-16 20:36:01 Error unrarring " in the posttorrent logfile, this is all the text in there. Thus the script is not executed by Transmission!?
4. Transmission is pointing to the right script
5. settings.json are set-up according to the instructions in the first message in this thread.
6. Unrar is installed
I am running Ubuntu 11.1 why does not Transmission execute the script?
HELP! I will give up this very soon.
-
- Posts: 2
- Joined: Fri Nov 18, 2011 3:18 pm
Re: Unrar and cleanup script - UPDATE 2011.10.24
The script is working and it is unpacking my torrents. There is however one issue. The process is not cleaned up after the unpack script finishes unpacking.
I'm using ubuntu 11.04 2.6.38-8-generic
transmission-daemon 2.13 (11501)
UNRAR 4.00 beta 3
At first I thought it might have something to do with file permissions. After some checking this was not the case. Did I miss something else ?
could always make a cron that checks for these processes so now and then but don't think that's really a solution on the long run.
Any ideas ?
TIA
Code: Select all
16:35:40 up x days, 1:22, x users, load average: 0.01, 0.03, 0.05
karl 2458 1 1 15:52 ? 00:00:22 /usr/bin/transmission-daemon --config-dir /var/lib/transmission-daemon/info
karl 2637 1 0 15:55 ? 00:00:00 /bin/bash /etc/transmission-daemon/unpack.sh
karl 2822 1 0 15:56 ? 00:00:00 /bin/bash /etc/transmission-daemon/unpack.sh
transmission-daemon 2.13 (11501)
UNRAR 4.00 beta 3
At first I thought it might have something to do with file permissions. After some checking this was not the case. Did I miss something else ?
could always make a cron that checks for these processes so now and then but don't think that's really a solution on the long run.
Any ideas ?
TIA
Re: Unrar and cleanup script - UPDATE 2011.10.24
Have you tried some patience and waiting for 1 hour? The script has a built-in waiting period for the clean up after unpacking. ( ps -ef | grep sleep )karlhungus wrote:The script is working and it is unpacking my torrents. There is however one issue. The process is not cleaned up after the unpack script finishes unpacking.
I'm using ubuntu 11.04 2.6.38-8-generic
transmission-daemon 2.13 (11501)
UNRAR 4.00 beta 3
Since you have got the script working on Ubuntu 11+, could you share some insight with your fellow Ubuntu users?
-
- Posts: 2
- Joined: Fri Nov 18, 2011 3:18 pm
Re: Unrar and cleanup script - UPDATE 2011.10.24
Tried using previous versions of the script. They did not work with Ubuntu 11.04. After your latest update (2011-10-24) Ive tried the script again and it works on Ubuntu 11.04 apart from the fact that it now ends in a defunct state. It DOES unpack the files.
Yes I have tried some patience. waited out the hour
When I unpack a file I get the following in my posttorrent.log:
ps -ef|grep posttorrent tells me the following:
current time
I will look into this a little further see what I can dig up on my ubuntu install.
Yes I have tried some patience. waited out the hour
When I unpack a file I get the following in my posttorrent.log:
Code: Select all
2011-11-21 12:08:31 Unrarred test.torrent.unrar.script.file1
Code: Select all
trans 11900 11889 0 12:08 ? 00:00:00 [posttorrent.sh] <defunct>
Code: Select all
16:23:56 up 6 days, 1:10, 2 users, load average: 0.02, 0.06, 0.13
Re: Unrar and cleanup script - UPDATE 2011.10.24
"sleep" available and executable by the same user that runs the script?karlhungus wrote:I will look into this a little further see what I can dig up on my ubuntu install.
"transmission-remote" available and executable by the same user that runs the script?
-
- Posts: 12
- Joined: Tue Oct 25, 2011 4:30 pm
Re: Unrar and cleanup script - UPDATE 2011.10.24
Was reading through the script and it looks interesting, but could you tell me where $TR_TORRENT_ID and $TR_TORRENT_NAME come from? Are these passed to the script from the daemon as parameters some how?
Re: Unrar and cleanup script - UPDATE 2011.10.24
yes those are special environmental variables passed to the script on completion of a torrent. see the wiki for all the listing:
https://trac.transmissionbt.com/wiki/Scripts
they are valid for any script you might use.
https://trac.transmissionbt.com/wiki/Scripts
they are valid for any script you might use.