Com o GNU find
ou compatível:
if
! find /volume1/surveillance/@Snapshot -name '*.jpg' -mmin -60 |
grep -q '^'
then
echo No movement detected in the last hour
exit 1
fi
Ou com zsh
:
last_hour=(/volume1/surveillance/@Snapshot/*.jpg(Nmh-1))
if (($#last_hour = 0)); then
echo No movement detected in the last hour
exit 1
fi