From f3fcb26512e93b4070d748c4cddcb4d6889fe422 Mon Sep 17 00:00:00 2001 From: Jari Sundell Date: Mon, 15 Jun 2026 11:13:21 +0900 Subject: [PATCH] Updated COMMAND Scheduling (markdown) --- COMMAND-Scheduling.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/COMMAND-Scheduling.md b/COMMAND-Scheduling.md index 1606a83..d685bf0 100644 --- a/COMMAND-Scheduling.md +++ b/COMMAND-Scheduling.md @@ -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.