Skip to content

Instantly share code, notes, and snippets.

@kantjer01
Created July 29, 2023 13:12
Show Gist options
  • Save kantjer01/12928a8455b23afa8eb316302849fd0e to your computer and use it in GitHub Desktop.
Save kantjer01/12928a8455b23afa8eb316302849fd0e to your computer and use it in GitHub Desktop.
upgraderr-move_noHL.sh
#!/bin/bash
# This script moves torrents to the lts catgrory if they are no longer hardlinked, qbit tmm wil then move the files to an other volume for long term seeding.
# load variables
set -o allexport
source /volume1/scripts/upgraderr/upgraderr.env
set +o allexport
log="$log_dir/move_noHL.$(date +"%Y-%m-%d_%H.%M").log"
# Move noHl movies torrents to lts volume
echo "Move 'noHl' movies torrents to lts volume" | tee $log
curl -X POST -H "Content-Type: application/json" -d @- "$webhook_url" <<CURL_DATA | tee -a $log
{"host":"${host_movies_local}",
"user":"${user_local}",
"password":"${password_local}",
"action":"category",
"subject":"movies-lts",
"query":"DisableCrossseed() && Category not endsWith '-lts' && Tags contains 'noHL' && ResultLimit(25)"}
CURL_DATA
# Move noHl series torrents to lts volume
echo "Move 'noHl' series torrents to lts volume" | tee -a $log
curl -X POST -H "Content-Type: application/json" -d @- "$webhook_url" <<CURL_DATA | tee -a $log
{"host":"${host_series_local}",
"user":"${user_local}",
"password":"${password_local}",
"action":"category",
"subject":"tv-lts",
"query":"DisableCrossseed() && Category not endsWith '-lts' && Tags contains 'noHL' && ResultLimit(25)"}
CURL_DATA
# cleanup log files
if ls -t $log_dir/move_noHL.*.log &>/dev/null; then
ls -t $log_dir/move_noHL.*.log | tail -n +4 | xargs rm -f --
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment