I have a NVR system that recording video surveilance into a linux server. This NVR system sometimes stops recordings (Bug) and I wanna know when that happens.
I'm looking into using the find command with a into a script and a cronjob to send me an email if no files is created within the passed 60 minutes.
The command I came up with is:
find /path/to/folder/* -name "*.ts" -mmin +0 -mmin -60 -exec echo "No New Recording Available" \; | mail -s "PP-NVR" me@server.com
But this command only sends me a list of "No New Recording Available" for the files older than 60 minutes
No New Recordinf Available
No New Recordinf Available
No New Recordinf Available
No New Recordinf Available
No New Recordinf Available
...
Can anyone please help!
EDIT: This is the script I came up with but it doesn't seem like it's working correctly:
#!/bin/sh
if test 'find /path_to_folder/* -name "*.ts" -mmin +1 -mmin -10'
then
echo "No New Recording Available" | mail -s "PP-NVR" me@server.com
fi