42 lines
1.4 KiB
Bash
42 lines
1.4 KiB
Bash
#!/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="log-$NOW.log"
|
|
|
|
# Entpackt und löscht rar,s nach erfolgreichen entpacken.
|
|
# for RAR in `find /volume1/Filesharing/!!X!/ \( -iname "*.rar" \) -type f` ; do cd `dirname $RAR`; unrar x -kb -o- '$RAR' && rm *.r?? ; done
|
|
#for RAR in `find /volume1/Filesharing/!!X!/ \( -iname "*.rar" \) -type f \( ! -regex '/volume1/System/#recycle/.*' \)` ; do cd `dirname $RAR`; unrar x -kb -o- '$RAR' && rm *.r?? ; done >>/volume1/Backup/NAS_Scripte/LOG/$LOGFILE
|
|
|
|
# Löscht auch rar,s die noch so umherfliegen ohne oben gelöscht zu werden (weil schon vorhandene film datei).
|
|
# find /volume1/System/ \( -iname "*.r??" \) -type f \( ! -regex '/volume1/Filesharing/#recycle/.*' \) -delete
|
|
|
|
# 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 -exec mv {} /volume1/Filesharing/!!X!/ \;
|
|
|
|
# Löscht samples aus dem root.
|
|
find /volume1/Filesharing/!!X!/ -iname "*sample*" -exec rm -r "{}" \;
|
|
|
|
#Löscht alle ordner ohne inhalt
|
|
# find "/volume1/Filesharing/!!X!/*" -type d -size -3100k -exec echo rm -rf "{}" \;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|