this post was submitted on 08 Sep 2023
3 points (100.0% liked)
Servarr - Sonarr/Radarr/Prowlarr
535 readers
1 users here now
Unofficial Lemmy Community for the Servarr suite of apps.
Lidarr, Prowlarr, Radarr, Readarr, Sonarr, and Whisparr collectively referred to as "*Arr" or "*Arrs". They are designed to automatically grab, sort, organize, and monitor your Music, Movie, E-Book, or TV Show collections for Lidarr, Radarr, Readarr, Sonarr, and Whisparr; and to manage your indexers and keep them in sync with the aforementioned apps for Prowlarr.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Ok after a bit of testing and research, I came up with this script that seems to be working
#!usr/bin/bash
# Define the directory where you want to start searching for rar files
start_directory="/root/of/torrent/download/folder/"
# Locate all rar files in subdirectories
find "$start_directory" -type f -name "*.rar" | while read rar_file; do
# Extract the rar file into the same directory, skip if it already exists
unrar x -o- "$rar_file" "$(dirname "$rar_file")"
echo "Extracted $rar_file to $(dirname "$rar_file")"
done
I chown'ed it to the qBittorrent user and gave it execute permissions. In qBittorrent I added the following to "Run external program on torrent finished"
bash /path/to/script.sh