Bash script to automatically hardlink completed torrents
When a torrent is completed this script will automatically recreate the directory structure and create hardlinks of all the source files to the destination directory of your choice. This is really practical if you want keep seeding on private trackers while being able to post-process your files for your media server without wasting storage space.
This should support using categories with *arr apps to isolate downloads as long as they're subpaths of your base path.
- 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 variables on line 7 & 12 and save
CTRL+X
Caution! Destination folder must be on the same dataset and mount path.
-
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,
%R
in the text field to match the example below
/configs/qbit-hardlinker.sh "%R"
You can also update line 19 to true
in order to clean up empty folders from previously snatched torrents. This should only delete empty folder paths so should be rather risk free.
- Dgibbons __ Code fixes to remove limit
- MageMinds __ $GTP Trainer
- Freeman __ $Original idea
- ChatGPT __ $Programmer