Execute Shell Script On Completion Plugin?

Suggest, post, or discuss plugins for Deluge
luke16
New User
New User
Posts: 6
Joined: Sun Dec 23, 2007 6:18 pm

Re: Execute Shell Script On Completion Plugin?

Post by luke16 »

Having the ability to launch scripts upon completion of torrents would be nice.
Basically what I want to have deluge be able to do is to have it automatically copy the torrents to another computer upon completion and then finish seeding to a certain ratio before deleting the file and removing the torrent. Problems with doing this using move torrent arise because I don't think that move torrent can move over networks, move torrent moves rather than copies, and the other computer isn't always on. So I basically need a script that launches when the torrent is complete, and then another one that launches after the torrent reaches a decent share ratio.
eddieparker
Member
Member
Posts: 13
Joined: Mon Jan 14, 2008 7:10 pm

Re: Execute Shell Script On Completion Plugin?

Post by eddieparker »

If this helps anyone else, I've 'cheated' to get this functionality.

I've installed incrond on my linux box and basically set up 'watches' on my 'in progress' directory and my 'finished' directory, which sends e-mails when that occur. Naturally any script I write could do anything at that point.

I haven't figured out a way to get details like labels, seed info, or what not. Is there a way to pull this information out from deluge, via the command line? Might be nice to do once a script has finished.
damoxc
Top Bloke
Top Bloke
Posts: 117
Joined: Sat Jul 19, 2008 7:26 pm
Location: Hampshire, UK
Contact:

Re: Execute Shell Script On Completion Plugin?

Post by damoxc »

What arguments would be useful to pass to the command, currently I have it passing torrent_id, torrent_name, torrent_path. I'm not sure what people will find the most useful. I guess in a later version could make the arguments that get passed configurable, but I'd like to keep it simple for the time being.
eddieparker
Member
Member
Posts: 13
Joined: Mon Jan 14, 2008 7:10 pm

Re: Execute Shell Script On Completion Plugin?

Post by eddieparker »

damoxc wrote:What arguments would be useful to pass to the command, currently I have it passing torrent_id, torrent_name, torrent_path. I'm not sure what people will find the most useful. I guess in a later version could make the arguments that get passed configurable, but I'd like to keep it simple for the time being.
damoxc, you're my hero.

I'd hate to balloon the syntax of that script more than I have to, but for my usage the only thing I really would want above and beyond that is the 'labels' applied to the torrents. I plan on using labels as a way to differentiate where files get moved to once they're completed.

That said, those arguments might be useful enough if there's a way to query an active deluge daemon for the rest of the properties. Is there any way to do something like (pseudo-commandline): "deluge --torrent-id [x] --get-label", or some such? I think it would be cleaner to make your script as simple as possible and then support some sort of query mechanism, but I don't know how the architects of deluge feel about this.

Anyhow, to summarize: biggest thing for me is getting the 'label' associated with a torrent. I could see cases for other things (current seed ratio, etc, etc), but that'd probably be feature creep that might be better served by my second recommendation.
damoxc
Top Bloke
Top Bloke
Posts: 117
Joined: Sat Jul 19, 2008 7:26 pm
Location: Hampshire, UK
Contact:

Re: Execute Shell Script On Completion Plugin?

Post by damoxc »

http://dev.deluge-torrent.org/wiki/Deve ... iClient1.2

You can write a simple client without too much difficulty, which is where the torrent id would come in use. I think configurable arguments will probably be the solution here, and shouldn't be too difficult to implement. I'll take a peek when I have a spare moment.
rokkk

Re: Execute Shell Script On Completion Plugin?

Post by rokkk »

hello ppl
i used torrentnotification plugin, added a line, that runs a script. works for me.
DisasteR
New User
New User
Posts: 3
Joined: Mon Mar 03, 2008 4:36 am

Re: Execute Shell Script On Completion Plugin?

Post by DisasteR »

rokkk wrote:hello ppl
i used torrentnotification plugin, added a line, that runs a script. works for me.
Hi

are you running the last version of deluge ?
did you use the move on complete feature ?

can you share your modification ?
wen1987

Re: Execute Shell Script On Completion Plugin?

Post by wen1987 »

Hello,

I find a simple solution. You can run deluged with log level debug, and then use grep to monitor the output. When a task completes, there should be some message looks like

Code: Select all

[DEBUG   ] 12:44:39 alertmanager:107 state_changed_alert: abc.tar.gz : state changed to: finished
. Then you can get more information using

Code: Select all

deluge -u console -a "info"
Post Reply