]> git.hoellein.online Git - skripte/commitdiff
die ersten Skripte
authorMario Höllein <mhoellein@moellein.homeip.net>
Thu, 26 May 2016 08:51:55 +0000 (10:51 +0200)
committerMario Höllein <mhoellein@moellein.homeip.net>
Thu, 26 May 2016 08:51:55 +0000 (10:51 +0200)
cleanUpHD.sh [new file with mode: 0644]
moveSnapshots.sh [new file with mode: 0644]
record.sh [new file with mode: 0644]

diff --git a/cleanUpHD.sh b/cleanUpHD.sh
new file mode 100644 (file)
index 0000000..9080435
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+#   solange mehr als 95% von /home belegt sind:
+#   lösche  
+#
+DF=`which df`
+DIR="/home/video/Videos/"
+
+while [ 0$(${DF} /home/ |sed -e 1d -e "s#  *# #g"|cut -d' ' -f 5 | tr -c -d "[:digit:]") -gt 95 ]; do
+        F=$(find ${DIR} -type f \( -iname '*.jpg' -or -iname '*.mpg' -or -iname '*.mp4' \) -printf "%T@ %p\n" | sort -n | head -1 | awk '{print $2}')
+        [ -z "${F}" ] && exit 1
+        rm -v --interactive=never ${F}
+        #ls -l ${F}
+        #echo $(${DF} /home/)
+        #mv -v ${F} /tmp/
+done
diff --git a/moveSnapshots.sh b/moveSnapshots.sh
new file mode 100644 (file)
index 0000000..45484dc
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/bash
+mv /home/video/Videos/snap*.jpg /home/video/Videos/vorn/snapshots/
diff --git a/record.sh b/record.sh
new file mode 100644 (file)
index 0000000..7f225af
--- /dev/null
+++ b/record.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+pid=$(pidof vlc)
+if [ $pid != "" ]; then
+        kill -9 $pid
+fi
+/home/video/bin/cleanUpHD.sh &
+/home/video/bin/moveSnapshots.sh &
+/usr/bin/vlc --intf dummy rtsp://video:video@172.17.5.8/live/h264 --sout=file/ps:/home/video/Videos/vorn/`/usr/bin/date +%Y%m%d_%H%M%S`.mpg