Torrent Mover is a Bash script designed to automate the processing of completed torrents in Transmission. It moves or copies downloaded files from a Transmission‑reported download location to designated destination directories on your system. This enhanced version includes robust locking, advanced error handling, parallel processing, configurable path mapping, improved archive extraction, and optional file integrity verification.
/downloads
) and maps it to your local file system (e.g. /mnt/dsnas2
) via configurable settings.flock
to ensure that only one instance of the script runs at a time.torrent-mover.sh
) to your desired location (e.g., /usr/local/bin/
).chmod +x /usr/local/bin/torrent-mover.sh
/etc/torrent/mover.conf
. See the configuration section below.Edit or create /etc/torrent/mover.conf
with the following content:
# Transmission settings TRANSMISSION_IP="192.168.1.100" # Replace with your Transmission server's IP TRANSMISSION_PORT="9091" # Replace with your Transmission server's port TRANSMISSION_USER="your_username" # Transmission username (if set) TRANSMISSION_PASSWORD="your_password" # Transmission password (if set) # Path mapping settings TRANSMISSION_PATH_PREFIX="/downloads" LOCAL_PATH_PREFIX="/mnt/dsnas2" # Destination directories DIR_GAMES_DST="/mnt/dsnas1/Games" DIR_APPS_DST="/mnt/dsnas1/Apps" DIR_MOVIES_DST="/mnt/dsnas1/Movies" DIR_BOOKS_DST="/mnt/dsnas1/Books" DEFAULT_DST="/mnt/dsnas1/Other" # Additional storage directories (comma-separated list) STORAGE_DIRS="/mnt/dsnas/Movies" # Performance settings PARALLEL_THREADS="32" PARALLEL_PROCESSING=1 # Operation mode: "move" or "copy" COPY_MODE="copy" # File tracking & integrity PROCESSED_LOG="/var/log/torrent_processed.log" CHECKSUM_DB="/var/lib/torrent/checksums.db" # Logging settings LOG_FILE="/var/log/torrent_mover.log" LOG_LEVEL="INFO" # Set to "DEBUG" for more verbose logging USE_SYSLOG="false" # Set to "true" to log messages to syslog # Optional integrity verification after transfer ("true" to enable) CHECK_TRANSFER_INTEGRITY="true"
Run the script using the following options:
/usr/local/bin/torrent-mover.sh --dry-run
/usr/local/bin/torrent-mover.sh --interactive
/usr/local/bin/torrent-mover.sh --cache-warmup
/usr/local/bin/torrent-mover.sh --debug
You can combine options as needed. For example:
/usr/local/bin/torrent-mover.sh --dry-run --debug
flock
to ensure only one instance runs at a time./downloads
) to the local file system path (e.g., /mnt/dsnas2
) using the configured mapping.transmission-remote
and processes torrents that are 100% complete. It skips torrents already processed or those with duplicate source directories.This script is provided as-is without any warranty. Use it at your own risk. Contributions and improvements are welcome.