Created
July 29, 2023 13:12
-
-
Save kantjer01/12928a8455b23afa8eb316302849fd0e to your computer and use it in GitHub Desktop.
upgraderr-move_noHL.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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