#!/bin/bash CURRENT=$(df /data/output | grep /dev | awk '{ print $5}' | sed 's/%//g') THRESHOLD_CLEAN=60 THRESHOLD_FULL=85 if [ "$CURRENT" -gt "$THRESHOLD_CLEAN" ] ; then find /data/output -type f -mtime +3 -exec rm -f {} \; fi if [ "$CURRENT" -gt "$THRESHOLD_FULL" ] ; then rm -rf /data/output/Camera1 curl "https://api.clickatell.com/http/sendmsg?user=motioneye_sms_alert&password=MITT_LOESENORD&api_id=nnn1388&to=MITT_MOBILNUMMER&text=MotionEye_DISK_FULL_ALERT" fi