This project dates back to ca. 6-7 years ago when my “homelab” only consisted of an Apple AirPort TimeCapsule and a few Raspberry Pi-s. The TimeCapsule served as my main router and it had a built-in 2 TB disk which content was available over AFP and SMB on my local network. Back in the time virtualization only meant manually creating a virtual machine in VirtualBox; I only heard some distant, basic information about docker and containers, and I didn’t even know what Ansible and Proxmox mean. My knowledge (and my homelab) have since come a long way.
I had already noticed that downloading various Linux ISOs via BitTorrent on a local machine (e.g. my laptop) is cumbersome. So I used a Raspberry Pi with an external HDD attached via USB to run a Transmission client. It even provided a nice web interface to manage the downloads. However, the space was limited on the external HDD, plus I wanted to have the completed downloads automatically available on the TimeCapsule. To implement this, I created a python script that performs this task, which I later refactored, cleaned up and packaged into a python package.
The TimeCapsule has been long retired, giving way to a more capable router and a dedicated Synology NAS for storing data. However, the Raspberry Pi with the external HDD is still in operation; running the Transmission client with this python pacakge synchronizing the completed downloads to the NAS. Why not running the Transmission directly on the NAS? Call me stubborn, I like to have my homelab services isolated from each other. Plus, the NAS is much louder than the Pi and its external HDD. It is currently located in the living room, and although it’s well sound-proofed with the common “velcro-mod”, silent Noctua fans and vibration dampers, I don’t want to hear the HDDs constantly operating when there are multiple downloads active.
This python package allows automatically synchronizing completed downloads from a Transmission client to a Network Attached Storage (NAS) via SMB.
Major features:
Read more, clone or fork the project at my GitHub repository:
akospasztor/transmission-watcher
Pipeline status:
Note: Recommended usage is within a virtualenv.
Install directly from GitHub:
pip install git+https://github.com/akospasztor/transmission-watcher
Alternatively, you can clone this repository and install the package:
cd transmission-watcher
pip install -e .
Refer to the command line interface help for the usage and available options:
transmission-watcher --help
Check out the repository and install package system-wide:
sudo pip3 install -e .
Create a transmission-watcher.service
file in /lib/systemd/system/
:
[Unit]
Description=Transmission Watcher Service
After=transmission-daemon.service
[Service]
ExecStart=transmission-watcher
Restart=always
User=pi
[Install]
WantedBy=multi-user.target
Reload services:
sudo systemctl daemon-reload
Enable service:
sudo systemctl enable transmission-watcher
Start service:
sudo systemctl start transmission-watcher
Install the package with the required extra packages for development and testing:
pip install -e ".[test]"
pytest -ra --junit-xml=tests/build/report.xml --html=tests/build/report.html --self-contained-html
Notes:
-v
flag for additional (verbose) output.-s
flag to disable all output capturing (useful for immediately
displaying print
outputs).