Dateien nach "/" hochladen
This commit is contained in:
52
Torrent7Tage.sh
Normal file
52
Torrent7Tage.sh
Normal file
@@ -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
|
||||
18
TransVersch.sh
Normal file
18
TransVersch.sh
Normal file
@@ -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 "{}" \;
|
||||
|
||||
32
versch.sh
Normal file
32
versch.sh
Normal file
@@ -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 "{}" \;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
32
versch1.sh
Normal file
32
versch1.sh
Normal file
@@ -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 "{}" \;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user