Skip to content

Bash script to automatically hardlink completed torrents

Notifications You must be signed in to change notification settings

gravelfreeman/qbit-hardlinker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f5c10e6 · Mar 16, 2025

History

15 Commits
Mar 16, 2025
Mar 16, 2025

Repository files navigation

Logo
qbit-hardlinker

This script automatically recreates the directory structure and creates hardlinks for all source files to a destination directory of your choice when a torrent is completed.

It’s particularly useful for keeping seeding on private trackers while post-processing files for your media server without wasting storage space.

The script works independently from the Arrs hardlink functionality, so you can keep the hardlink option enabled in Arrs.

Usage

  1. Run these commands in a folder qBittorrent have access
git clone https://github.com/gravelfreeman/qbit-hardlinker
chmod +x qbit-hardlinker.sh
  1. Edit the destination path, and base_path for your hardlinked files, base path is likely the same as your "default save path"
nano qbit-hardlinker.sh
  1. Modify the variable on line 9 to set your qBittorrent download directory.
  2. Modify the variable on line 10 to set your hardlink destination directory.

Note :

Source and destination folders must be on the same dataset and mount path.

  1. Modify the variables on line 12 to set excluded qBittorrent categories.

Note :

It's recommended to exclude the Arrs categories since those apps are already managing your media and their hardlinks.

  1. qBittorent > Tools > Options > Downloads Tab and scroll down to Run external program section and check the box Run external program on torrent finished

  2. Add the script path in the text field followed by "%N" "%D" "%L" variables.

Example :

/config/qbit-hardlinker/qbit-hardlinker.sh "%N" "%D" "%L"

Credits