TORrent MOVer: a configurable torrent folder mover
Simple script program to move completed torrents to specific folders.
Sometimes it’s easy to let torrent download files to a generic directory and then move it afterwards. This program automates this task by:
The program is written in Rust so it’s very quick and light on your system. The source code is very small so you can check yourself what it does in few moments.
cargo install tormov
. This will install the latest published version. If you want the master branch use cargo install --git https://github.com/MindFlavor/tormov
instead.tormov
in the console to test the program execution. You’ll get an error because of missing parameters. We’ll cover them in the next section.TORMOV expects, from the command line, two parameters:
So, for example, if you have a configuration file called tormov_config.json
and you want to check the /var/lib/transmission-daemon/downloads/
you can write:
$ tormov tormov_config.json /var/lib/transmission-daemon/downloads/
A sample configuration file is available here: example_config.json. The format, however, is simple.
{
"skipextension": "part",
"matches": [
{
"regex": "Arrow",
"destination": "/mnt/shows/Arrow",
"action": "Move"
},
{
"regex": "Big.Bang",
"destination": "/mnt/shows/The.big.bang.theory",
"action": "Move"
},
{
"regex": "Marvels.Agents.of.S.H.I.E.L.D.*",
"destination": "/mnt/shows/agents_of_the_shield",
"action": "Link"
}
]
}
skipextension
is the extension appended whenever the file is not ready. Most torrent clients use part
or incomplete
but make sure to specify the right one.
The matches
section is an array of entries you want to check. Each entry must have:
regex
.destination
field. The destination is where the file/folder will be moved if the contents have been completely downloaded (that is, there is no file with skipextension
anywhere in the folder).Move
or Link
. The latter will create a symbolic link instead of moving the file. Note: right now linking is supported only on Linux, if you need Windows please drop a line.While TORMOV does not have a scheduler it’s fairly easy to automate it with cron jobs or systemd. For example with systemd you can schedule it creating two files. The first is tormov.service
with these contents:
[Unit]
Description=TORrent MOVer
[Service]
ExecStart=<full TORMOV bin path> <config> <folder>
And another one called tormow.timer
with the schedule:
[Unit]
Description=Runs tormov every minute
[Timer]
OnBootSec=5min
OnUnitActiveSec=1min
Unit=tormov.service
[Install]
WantedBy=timers.target
Now simply start end optionally enable the timer with:
$ sudo systemctl start tormov.timer
$ sudo systemctl enable tormov.timer
You can then check the output with sudo systemctl status tormov.service
as usual.