mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-12 21:22:31 +00:00
Updated COMMAND Scheduling (markdown)
+14
-1
@@ -39,16 +39,29 @@ Setting custom variables on torrents
|
||||
You can set custom variables to allow for various events to take place automatically as well.
|
||||
|
||||
```
|
||||
# Old Style:
|
||||
|
||||
schedule = foo, 0, 10, "load.start=~/Download/watch_old/*.torrent,\"d.custom.set=incomplete,1\""
|
||||
method.set_key=event.download.finished, cldvar,"branch=d.custom=incomplete,\"d.custom.set=incomplete,0\""
|
||||
method.set_key=event.download.erased, rm_files,"branch=d.custom=incomplete,\"execute={rm,-rf,--,$d.base_path=}\""
|
||||
method.set_key=event.download.erased, rm_torrent_files,"branch=d.custom=incomplete,d.delete_tied="
|
||||
|
||||
# New Style:
|
||||
|
||||
schedule = foo, 0, 10, ((load.start, ~/Download/watch_old/*.torrent, ((d.custom.set, incomplete, 1)) ))
|
||||
method.set_key = event.download.finished, cldvar, ((branch, ((d.custom, incomplete)), ((d.custom.set, incomplete, 0)) ))
|
||||
method.set_key = event.download.erased, rm_files, ((branch, ((d.custom, incomplete)), ((execute, rm, -rf, --, ((d.base_path)) )) ))
|
||||
method.set_key = event.download.erased, rm_torrent_files, ((branch, ((d.custom, incomplete)), ((d.delete_tied)) ))
|
||||
|
||||
# Pass as "list containing function", rather than "escaped function", to avoid escaping args within.
|
||||
|
||||
method.set_key = event.download.erased, rm_files, {(branch, ((d.custom, incomplete)), ((execute, rm, -rf, --, (d.base_path) )) )}
|
||||
```
|
||||
|
||||
The above will auto-start any torrent downloaded to the watch directory and set the custom variable "incomplete" to 1 for that download.
|
||||
|
||||
When the download finishes, the custom variable "incomplete" will be set to 0.
|
||||
|
||||
If the torrent is erased from rTorrent before being finished, then both the torrent file (d.delete_tied=) and the downloaded data ($d.base_path=) will be erased as well. This is useful so that you can more easily manage your files, however please take care to move your torrent data elsewhere if you want to keep it, before removing it from the client, just in case.
|
||||
If the torrent is erased from rTorrent before being finished, then both the torrent file `d.delete_tied` and the downloaded data `d.base_path` will be erased as well. This is useful so that you can more easily manage your files, however please take care to move your torrent data elsewhere if you want to keep it, before removing it from the client, just in case.
|
||||
|
||||
Also note in the above that we have wrapped the command in quotes. This is to tell rTorrent that this is a list of commands that need to be run. Additionally, we have escaped quotes \" around the d.custom.set commands. That is because this is also a command itself, and since there are commas inside THIS command, we need to identify that this is a single command within another command.
|
||||
|
||||
Reference in New Issue
Block a user