OK, So I wasn't really sure which debugging to turn on in options, so I just switched them all on.
I had a few runs at it and I can't even tell why it just worked perfectly once. I didn't change anything except the debugging options.
I've been shrinking the folder size using my script and then running ZMaudit.pl to see what happens.
Since it obviously just repeats the same lines over, I'll just put in the first part of each log.
This was an unsuccessful audit:
Code: Select all
16/06/20 17:51:05.096254 zmaudit[24289].INF [main:199] [Auditing All Storage Areas]
16/06/20 17:51:05.305473 zmaudit[24289].WAR [ZoneMinder::Event:533] [Path not found for Event 8638 at /var/cache/zoneminder/HighResCamEvents/11/2020-06-15/8638]
16/06/20 17:51:05.314296 zmaudit[24289].WAR [main:630] [Not found at /var/cache/zoneminder/HighResCamEvents/11/2020-06-15/8638 was found at /var/cache/zoneminder/HighResCamEvents/11/2020-06-15/8638]
16/06/20 17:51:05.316453 zmaudit[24289].WAR [main:631] [ZoneMinder::Event: AlarmFrames => 190 AvgScore => 1 Cause => External Motion DefaultVideo => 8638-video.mp4 DiskSpace => 9465463 EndTime => 2020-06-15 23:37:10 Frames => 235 Height => 1536 Id => 8638 Length => 23.40 MaxScore => 1 MonitorId => 11 Name => Event- 8638 Notes => External Motion: Orientation => ROTATE_0 Scheme => Medium StartTime => 2020-06-15 23:36:47 StateId => 1 StorageId => 6 TotScore => 190 Width => 2304]
16/06/20 17:51:05.318399 zmaudit[24289].WAR [main:632] [ZoneMinder::Event: Id => 8638 MonitorId => 11 Scheme => Medium StartTime => 2020-06-16 16:50:39 StorageId => 6]
16/06/20 17:51:05.322824 zmaudit[24289].WAR [ZoneMinder::Event:533] [Path not found for Event 8966 at /var/cache/zoneminder/HighResCamEvents/11/2020-06-16/8966]
16/06/20 17:51:05.324995 zmaudit[24289].WAR [main:630] [Not found at /var/cache/zoneminder/HighResCamEvents/11/2020-06-16/8966 was found at /var/cache/zoneminder/HighResCamEvents/11/2020-06-16/8966]
16/06/20 17:51:05.326611 zmaudit[24289].WAR [main:631] [ZoneMinder::Event: AlarmFrames => 363 AvgScore => 1 Cause => External Motion DefaultVideo => 8966-video.mp4 DiskSpace => 12543606 EndTime => 2020-06-16 13:23:57 Frames => 408 Height => 1536 Id => 8966 Length => 20.51 MaxScore => 1 MonitorId => 11 Name => Event- 8966 Notes => External Motion: Orientation => ROTATE_0 Scheme => Medium StartTime => 2020-06-16 13:23:36 StateId => 1 StorageId => 6 TotScore => 363 Width => 2304]
16/06/20 17:51:05.329415 zmaudit[24289].WAR [main:632] [ZoneMinder::Event: Id => 8966 MonitorId => 11 Scheme => Medium StartTime => 2020-06-16 16:50:40 StorageId => 6]
16/06/20 17:51:05.333746 zmaudit[24289].WAR [ZoneMinder::Event:533] [Path not found for Event 8969 at /var/cache/zoneminder/HighResCamEvents/11/2020-06-16/8969]
16/06/20 17:51:05.336453 zmaudit[24289].WAR [main:630] [Not found at /var/cache/zoneminder/HighResCamEvents/11/2020-06-16/8969 was found at /var/cache/zoneminder/HighResCamEvents/11/2020-06-16/8969]
16/06/20 17:51:05.339201 zmaudit[24289].WAR [main:631] [ZoneMinder::Event: AlarmFrames => 371 AvgScore => 1 Cause => External Motion DefaultVideo => 8969-video.mp4 DiskSpace => 13046795 EndTime => 2020-06-16 13:24:51 Frames => 416 Height => 1536 Id => 8969 Length => 20.86 MaxScore => 1 MonitorId => 11 Name => Event- 8969 Notes => External Motion: Orientation => ROTATE_0 Scheme => Medium StartTime => 2020-06-16 13:24:30 StateId => 1 StorageId => 6 TotScore => 371 Width => 2304]
16/06/20 17:51:05.341886 zmaudit[24289].WAR [main:632] [ZoneMinder::Event: Id => 8969 MonitorId => 11 Scheme => Medium StartTime => 2020-06-16 16:50:40 StorageId => 6]
16/06/20 17:51:05.346195 zmaudit[24289].WAR [ZoneMinder::Event:533] [Path not found for Event 8802 at /var/cache/zoneminder/HighResCamEvents/11/2020-06-16/8802]
This was a successful audit:
Code: Select all
16/06/20 17:59:06.927182 zmaudit[24606].INF [main:199] [Auditing All Storage Areas]
16/06/20 17:59:07.111981 zmaudit[24606].WAR [ZoneMinder::Event:533] [Path not found for Event 8920 at /var/cache/zoneminder/HighResCamEvents/10/2020-06-16/8920]
16/06/20 17:59:07.168454 zmaudit[24606].INF [ZoneMinder::Event:373] [Deleting event 8920 from Monitor 10 StartTime:2020-06-16 13:07:59 from /var/cache/zoneminder/HighResCamEvents/10/2020-06-16/8920]
16/06/20 17:59:07.498645 zmaudit[24606].WAR [ZoneMinder::Event:533] [Path not found for Event 8859 at /var/cache/zoneminder/HighResCamEvents/10/2020-06-16/8859]
16/06/20 17:59:07.567378 zmaudit[24606].INF [ZoneMinder::Event:373] [Deleting event 8859 from Monitor 10 StartTime:2020-06-16 12:45:00 from /var/cache/zoneminder/HighResCamEvents/10/2020-06-16/8859]
16/06/20 17:59:07.641224 zmaudit[24606].WAR [ZoneMinder::Event:533] [Path not found for Event 8943 at /var/cache/zoneminder/HighResCamEvents/10/2020-06-16/8943]
16/06/20 17:59:07.643789 zmaudit[24606].INF [ZoneMinder::Event:373] [Deleting event 8943 from Monitor 10 StartTime:2020-06-16 13:14:00 from /var/cache/zoneminder/HighResCamEvents/10/2020-06-16/8943]
16/06/20 17:59:07.664572 zmaudit[24606].WAR [ZoneMinder::Event:533] [Path not found for Event 9056 at /var/cache/zoneminder/HighResCamEvents/10/2020-06-16/9056]
16/06/20 17:59:07.667084 zmaudit[24606].INF [ZoneMinder::Event:373] [Deleting event 9056 from Monitor 10 StartTime:2020-06-16 14:09:36 from /var/cache/zoneminder/HighResCamEvents/10/2020-06-16/9056]
16/06/20 17:59:07.688701 zmaudit[24606].WAR [ZoneMinder::Event:533] [Path not found for Event 9031 at /var/cache/zoneminder/HighResCamEvents/10/2020-06-16/9031]
16/06/20 17:59:07.691178 zmaudit[24606].INF [ZoneMinder::Event:373] [Deleting event 9031 from Monitor 10 StartTime:2020-06-16 13:51:26 from /var/cache/zoneminder/HighResCamEvents/10/2020-06-16/9031]
16/06/20 17:59:07.714149 zmaudit[24606].WAR [ZoneMinder::Event:533] [Path not found for Event 8710 at /var/cache/zoneminder/HighResCamEvents/10/2020-06-16/8710]
16/06/20 17:59:07.720960 zmaudit[24606].INF [ZoneMinder::Event:373] [Deleting event 8710 from Monitor 10 StartTime:2020-06-16 00:06:56 from /var/cache/zoneminder/HighResCamEvents/10/2020-06-16/8710]
I don't think there's anything helpful in here? I can see they're both different, I don't understand why the unsuccessful one has spit out information on the event and the successful one hasn't...
I'm going to post the bash script here that's doing the file deletion as I can just see someone asking for a look at it (not mine btw):
Code: Select all
#!/bin/bash
usage=$(du -sb /var/cache/zoneminder/HighResCamEvents | cut -d $'\t' -f 1)
max=8000000000
if (( usage > max ))
then
find /var/cache/zoneminder/HighResCamEvents -maxdepth 5 -type f -printf '%T@\t%s\t%p\n' | sort -n | \
while (( usage > max )) && IFS=$'\t' read timestamp size file
do
rm -- "$file" && (( usage -= size ))
done
fi