From c6b55a7a8acf12f5145f84cc3ee80c7da44d5d0e Mon Sep 17 00:00:00 2001 From: erich Date: Thu, 11 Dec 2025 14:50:01 +0100 Subject: [PATCH] Dateien nach "/" hochladen --- Torrent7Tage.sh | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ TransVersch.sh | 18 +++++++++++++++++ versch.sh | 32 ++++++++++++++++++++++++++++++ versch1.sh | 32 ++++++++++++++++++++++++++++++ 4 files changed, 134 insertions(+) create mode 100644 Torrent7Tage.sh create mode 100644 TransVersch.sh create mode 100644 versch.sh create mode 100644 versch1.sh diff --git a/Torrent7Tage.sh b/Torrent7Tage.sh new file mode 100644 index 0000000..d7d6e2f --- /dev/null +++ b/Torrent7Tage.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +# Clears finished downloads from Transmission. +# Version: 1.1 +# +# Newest version can always be found at: +# https://gist.github.com/pawelszydlo/e2e1fc424f2c9d306f3a +# +# Server string is resolved in this order: +# 1. TRANSMISSION_SERVER environment variable +# 2. Parameters passed to this script +# 3. Hardcoded string in this script (see below). + +# Server string: "host:port --auth username:password" +SERVER="192.168.20.1:9595 --auth torrend:1stonesQ + +# Which torrent states should be removed at 100% progress. +DONE_STATES=("Seeding" "Stopped" "Finished" "Idle") + +# Get the final server string to use. +if [[ -n "$TRANSMISSION_SERVER" ]]; then + echo -n "Using server string from the environment: " + SERVER="$TRANSMISSION_SERVER" +elif [[ "$#" -gt 0 ]]; then + echo -n "Using server string passed through parameters: " + SERVER="$*" +else + echo -n "Using hardcoded server string: " +fi +echo "${SERVER: : 10}(...)" # Truncate to not print auth. + +# Use transmission-remote to get the torrent list from transmission-remote. +TORRENT_LIST=$(transmission-remote $SERVER --list | sed -e '1d' -e '$d' | awk '{print $1}' | sed -e 's/[^0-9]*//g') + +# Iterate through the torrents. +for TORRENT_ID in $TORRENT_LIST +do + INFO=$(transmission-remote $SERVER --torrent "$TORRENT_ID" --info) + echo -e "Processing #$TORRENT_ID: \"$(echo "$INFO" | sed -n 's/.*Name: \(.*\)/\1/p')\"..." + # To see the full torrent info, uncomment the following line. + # echo "$INFO" + PROGRESS=$(echo "$INFO" | sed -n 's/.*Percent Done: \(.*\)%.*/\1/p') + STATE=$(echo "$INFO" | sed -n 's/.*State: \(.*\)/\1/p') + + # If the torrent is 100% done and the state is one of the done states. + if [[ "$PROGRESS" == "100" ]] && [[ "${DONE_STATES[@]}" =~ "$STATE" ]]; then + echo "Torrent #$TORRENT_ID is done. Removing torrent from list." + transmission-remote $SERVER --torrent "$TORRENT_ID" --remove + else + echo "Torrent #$TORRENT_ID is $PROGRESS% done with state \"$STATE\". Ignoring." + fi +done \ No newline at end of file diff --git a/TransVersch.sh b/TransVersch.sh new file mode 100644 index 0000000..d963747 --- /dev/null +++ b/TransVersch.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# usr/syno/bin +# Link erstellen ln -s /volume1/Backup/NAS_Scripte/porord.sh /usr/syno/bin/porord.sh + +# >>/volume1/Backup/NAS_Scripte/LOG/$LOGFILE + +# Logfile +NOW=`date +'%d.%m.%Y'` +LOGFILE="logVerschXXX-$NOW.log" + + + +# Verschiebt alles in Por Root +find /volume1/XXXFilesharingTemp/* -mtime 7 \( -iname "*.mov" -o -iname "*.avi" -o -iname "*.mkv" -o -iname "*.wmv" -o -iname "*.iso" -o -iname "*.mp4" -o -iname "*.img" -o -iname "*.asf" -o -iname "*.mpg" -o -iname "*.mpeg" -o -iname "*.m4v" -o -iname "*.vob" -o -iname "*.flv" \) -type f \( ! -regex '/volume1/XXXFilesharingTemp/$RECYCLE.*' \) \( ! -regex '.*/@eaDir/*.*' \) \( ! -regex '/volume1/XXXFilesharingTemp/$RECYCLE.*' \) -exec mv {} "/volume1/System/!NEU/" \; + +#Löscht alle ordner ohne inhalt +find /volume1/XXXFilesharingTemp/* -mtime 7 -type d \( ! -regex '.*/@eaDir/*.*' \) \( ! -regex '/volume1/XXXFilesharingTemp/$RECYCLE.*' \) -size -2M -exec rm -rf "{}" \; + diff --git a/versch.sh b/versch.sh new file mode 100644 index 0000000..f25984f --- /dev/null +++ b/versch.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# usr/syno/bin +# Link erstellen ln -s /volume1/Backup/NAS_Scripte/porord.sh /usr/syno/bin/porord.sh + +# >>/volume1/Backup/NAS_Scripte/LOG/$LOGFILE + +# Logfile +NOW=`date +'%d.%m.%Y'` +LOGFILE="logVersch-$NOW.log" + + + +# Verschiebt alles in Por Root +find /volume1/Filesharing/!X/* \( -iname "*.mov" -o -iname "*.avi" -o -iname "*.mkv" -o -iname "*.wmv" -o -iname "*.iso" -o -iname "*.mp4" -o -iname "*.img" -o -iname "*.asf" -o -iname "*.mpg" -o -iname "*.mpeg" -o -iname "*.m4v" -o -iname "*.vob" -o -iname "*.flv" \) -type f \( ! -regex '/volume1/Filesharing/!X/$RECYCLE.*' \) \( ! -regex '/volume1/Filesharing/!X/!NEU/.*' \) \( ! -regex '/volume1/Filesharing/!X/!OLD/.*' \) \( ! -regex '.*/@eaDir/*.*' \) \( ! -regex '/volume1/Filesharing/!X/$RECYCLE.*' \) -exec mv {} /volume1/System/!NEU/ \; + +# Löscht samples aus dem root. +#find /volume1/System/ -iname "*sample*" \( ! -regex '.*/@eaDir/*.*' \) \( ! -regex '/volume1/System/$RECYCLE.*' \) -exec rm -r "{}" \; + +#Löscht alle ordner ohne inhalt +find /volume1/Filesharing/!X/* -type d \( ! -regex '.*/@eaDir/*.*' \) \( ! -regex '/volume1/Filesharing/!X/$RECYCLE.*' \) \( ! -regex '/volume1/Filesharing/!X/!NEU.*' \) -size -2M -exec rm -rf "{}" \; + + + + + + + + + + + + diff --git a/versch1.sh b/versch1.sh new file mode 100644 index 0000000..f25984f --- /dev/null +++ b/versch1.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# usr/syno/bin +# Link erstellen ln -s /volume1/Backup/NAS_Scripte/porord.sh /usr/syno/bin/porord.sh + +# >>/volume1/Backup/NAS_Scripte/LOG/$LOGFILE + +# Logfile +NOW=`date +'%d.%m.%Y'` +LOGFILE="logVersch-$NOW.log" + + + +# Verschiebt alles in Por Root +find /volume1/Filesharing/!X/* \( -iname "*.mov" -o -iname "*.avi" -o -iname "*.mkv" -o -iname "*.wmv" -o -iname "*.iso" -o -iname "*.mp4" -o -iname "*.img" -o -iname "*.asf" -o -iname "*.mpg" -o -iname "*.mpeg" -o -iname "*.m4v" -o -iname "*.vob" -o -iname "*.flv" \) -type f \( ! -regex '/volume1/Filesharing/!X/$RECYCLE.*' \) \( ! -regex '/volume1/Filesharing/!X/!NEU/.*' \) \( ! -regex '/volume1/Filesharing/!X/!OLD/.*' \) \( ! -regex '.*/@eaDir/*.*' \) \( ! -regex '/volume1/Filesharing/!X/$RECYCLE.*' \) -exec mv {} /volume1/System/!NEU/ \; + +# Löscht samples aus dem root. +#find /volume1/System/ -iname "*sample*" \( ! -regex '.*/@eaDir/*.*' \) \( ! -regex '/volume1/System/$RECYCLE.*' \) -exec rm -r "{}" \; + +#Löscht alle ordner ohne inhalt +find /volume1/Filesharing/!X/* -type d \( ! -regex '.*/@eaDir/*.*' \) \( ! -regex '/volume1/Filesharing/!X/$RECYCLE.*' \) \( ! -regex '/volume1/Filesharing/!X/!NEU.*' \) -size -2M -exec rm -rf "{}" \; + + + + + + + + + + + +