26 lines
1.5 KiB
Bash
26 lines
1.5 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 /volumeUSB2/usbshare/ \( -iname "*.rar" \) -type f \( ! -regex '/volumeUSB2/usbshare/lost+found/.*' \)` ; 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<65>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 /volumeUSB2/usbshare/*/* \( -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 '/volumeUSB2/usbshare/lost+found/' \) \( ! -regex '/volumeUSB2/usbshare/@eaDir/' \) \( ! -regex '/volumeUSB2/usbshare/@tmp/' \) -exec mv {} /volumeUSB2/usbshare/ \;
|
||
|
||
# L<>scht samples aus dem root.
|
||
find /volumeUSB2/usbshare/ -iname "*sample*" -exec rm -r "{}" \;
|
||
|
||
#L<>scht alle ordner ohne inhalt
|
||
# find /volumeUSB2/usbshare/* -type d -size -3100k -exec rm -rf "{}" \;
|
||
#find /volumeUSB2/usbshare/* -type d -size -3100k -exec echo rm -rf "{}" \;
|