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.
- Run these commands in a folder qBittorrent have access
git clone https://github.com/gravelfreeman/qbit-hardlinker
chmod +x qbit-hardlinker.sh
- 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
- Modify the variable on line 9 to set your qBittorrent download directory.
- 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.
- 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.
-
qBittorent > Tools > Options > Downloads Tab and scroll down to Run external program section and check the box Run external program on torrent finished
-
Add the script path in the text field followed by
"%N" "%D" "%L"
variables.
Example :
/config/qbit-hardlinker/qbit-hardlinker.sh "%N" "%D" "%L"
- Paul Chambers - Original Code