LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   rtorrent - move completed files (https://www.linuxquestions.org/questions/ubuntu-63/rtorrent-move-completed-files-624004/)

imagineaxion 02-26-2008 12:44 PM

rtorrent - move completed files
 
Hey

I have a line of code in the .rtorrent.rc file that moves the completed downloads to different dir.
Code:

# Move completed downloads
on_finished = move_complete,"execute=mv,-u,$d.get_base_path=,/home/torrnt/downloading/ ;d.set_directory=/netdata/torrents/done/"

I got this from http://libtorrent.rakshasa.no/

What happens is rtorrent crashes / shuts down when a torrent completes. I have to manually move the files and restart rtorrent and del the reference in the download cue.

I have had a look in the logs and there is nothing in there to speak of...

So not sure why this isn't working
I have also tried replacing the -u with -n as suggested for Unix / Mac but does make any difference.

I initially thought it was a permissions problem but have changed the permissions of that file so the owner:group belongs to the same owner:group as the rtorrent session is loaded in (unless permissions of parent folder somehow override them??).

Please let me know if you need some more info!

Thanks
G

unSpawn 02-27-2008 07:43 AM

If the app crashes on what it advertises as feature then IMHO you should run the app through 'strace', make it crash and submit output to their bug tracker.

sm311ycat 03-10-2008 07:32 PM

ok 2 weeks late but may interest some :-)

The syntax isn't correct.
Below is probably what you need.

# Move completed downloads
on_finished = move_complete,"execute=mv,-u,$d.get_base_path=,/netdata/torrents/done/ ;d.set_directory=/netdata/torrents/done/"


This is how I interpret it.
on_finished is the trigger that fired for a particular torrent when it has finished downloading.
When that happens, we perform a number of actions action we have labelled move_complete.

The move_complete will do the following 2 actions:
1. mv (in update mode) the torrent from its current directory
to a new directory
mv, -u, $d.get_base_path=, /netdata/torrents/done/

2. Once we've done the move, update the torrent's directory attribute.
d.set_directory = /netdata/torrents/done/


notes:
~~~~~~
In update mode only means that we do not overwrite an existing file
ie target file doesnt exist.
in linux we use mv -u
in ox-x we use mv -n


$d.get_base_path= is a command for getting the pathname of the torrent.

$ : command mode
d : 'd' signifies the object is a torrent
(ie we are acting on a specific torrent)
.get_base_path : torrent method, gets the pathname of the torrent
= : command terminator





caveats:
I'm not an expert. I'm still learning;
hopefully most of the above is true,
an I've cast more light than fog :-)

imagineaxion 03-11-2008 04:17 AM

Thanks sm311ycat !

Will try this tonight when I get home...


All times are GMT -5. The time now is 08:49 PM.