Script to delete events when 32000 file system limit.

Support and queries relating to all previous versions of ZoneMinder
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

If you have the room, use empty space to make the RieserFS partition, move things over, and grow the RieserFS partition. Of coarse there is allot more involved in moving things like that and I am defiantly not the one you would want to walk you through it. I played a bit doing this last year. I would strongly suggest that if you are determined to do this, use a test machine first and keep some notes.
Regards,
Cordel

See this thread:
http://forums.serverbeach.com/showthread.php?t=4972
nickcol
Posts: 26
Joined: Tue Sep 06, 2005 10:08 am
Location: devon,uk

Post by nickcol »

Thanks for the partition info. Its a bit late to do a reload at the moment as I dont have anything to backup 600gb to.

Can anyone help with a mysql delete command ?

which needs to delete the oldest 1000 events on a camera if count(id)>31000

The following would delete the oldest 1000 events for cam 1
delete * from Events where MonitorId=1 order by starttime limit 1000;

I need this to only happen when you have more than 31000 events for the camera and not sure on how to do the delete line. (count bit)?

delete * from Events where MonitorId=1 and count(id)>31000order by starttime limit 1000;


Thanks

Nick
nickcol
Posts: 26
Joined: Tue Sep 06, 2005 10:08 am
Location: devon,uk

Post by nickcol »

Thanks for all the info.

Next week Im going to backup the mysql db and events folder (over 600gb) and then do a total format-reload using the RieserFS partition and restore the data.


Thanks

Nick
Locked