Move to different folder? (execute script)

Suggest, post, or discuss plugins for Deluge
Post Reply
shinkasa4
New User
New User
Posts: 7
Joined: Mon Jun 07, 2010 7:14 pm

Move to different folder? (execute script)

Post by shinkasa4 »

Hi,
Running latest deluge on Windows!

I want to use execute plugin to do the following:
On completion of a torrent, WAIT 180 seconds, then move to "C:\" directory. So move to C:\ after waiting 180 seconds upon torrent completion

The wait 180 seconds part is very important, but will be complicated and long-winded to explain here :)

Can you please help me write this script?
CSB
Leecher
Leecher
Posts: 66
Joined: Fri Dec 03, 2010 1:55 am

Re: Move to different folder? (execute script)

Post by CSB »

Unless you want the same file to be downloaded over and over, or you don't want to seed, this cannot be done.

The daemon blocks on execute plugin scripts, so any execute script attempting to interact with the daemon as a client will stall the daemon, thus the above caveats. This also means that every time a torrent finishes, the daemon would block for 180 seconds.

Alternatively, the execute script could execute a client script as a background task, which would do all of the work.
chimpy
New User
New User
Posts: 6
Joined: Sun Mar 11, 2012 4:06 pm

Re: Move to different folder? (execute script)

Post by chimpy »

I don't know about Windows, but the equivalent on Linux would be something like:

Code: Select all

       
torrentid=$1
torrentname=$2
torrentpath=$3
sleep 180
mv "$torrentpath/$torrentname" /
This is using the Execute plugin upon torrent completion, obviously.
Lazybones
Leecher
Leecher
Posts: 62
Joined: Sat Dec 31, 2011 11:00 pm

Re: Move to different folder? (execute script)

Post by Lazybones »

I believe the blocking behavior of scripts will be changed in 1.3.4, but if you don't want deluge to hang duing your sleep statement you need to lauch your script from all calling script.

In linux you would put an & at the end of the line.

In windows put your actual code in a second script file and then call it like this

call otherCommand.bat

this should cause it to run separately.
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: Move to different folder? (execute script)

Post by johnnyg »

1.3.4 has been released and yes it doesn't wait on scripts to finish anymore (so it won't hang).

As a side note you shouldn't use mv as deluge will no longer be able to seed that torrent.
I believe you want to either use deluge's "move completed to" feature or just copy the file to another location.
Post Reply