You are not logged in.

#1 2011-03-11 06:07:03

sironitomas
Member
From: Cordoba, Argentina
Registered: 2009-11-28
Posts: 174
Website

[SOLVED] Ring file-system for a surveillance server?

In my home, I have a (almost) dedicated (Arch-32) computer to use as a surveillance server. It continuously fetches video from a IP camera using motion and saving various GB of images and videos. Obviously, I have to manually delete older videos when the disk is getting full, but it would be better to have some kind of file-system that overrides the older files with the newer ones when it gets full.

Is there anything like that? Any recommendations?

Thanks!

PS: If your suggestion/solution could only delete videos (not images), better.

Last edited by sironitomas (2011-03-12 04:06:12)

Offline

#2 2011-03-11 08:18:55

Spider.007
Member
Registered: 2004-06-20
Posts: 1,176

Re: [SOLVED] Ring file-system for a surveillance server?

Do you have multiple video-files, or do the rips consist of multiple files? If there are multiple, it might be easier just to set up a cron-job to delete older files?

Offline

#3 2011-03-11 18:11:56

sironitomas
Member
From: Cordoba, Argentina
Registered: 2009-11-28
Posts: 174
Website

Re: [SOLVED] Ring file-system for a surveillance server?

Spider.007 wrote:

Do you have multiple video-files, or do the rips consist of multiple files? If there are multiple, it might be easier just to set up a cron-job to delete older files?

I have multiple video files (500+) so a cron job is not a bad idea. The only problem is, I don't know how to use a script in order to see which files are older.

Last edited by sironitomas (2011-03-11 18:12:20)

Offline

#4 2011-03-11 18:52:25

limaunion
Member
From: Argentina
Registered: 2011-03-11
Posts: 40

Re: [SOLVED] Ring file-system for a surveillance server?

One possiblity is to schedule a daily cron job with something like this:

find /home/videos/ -mindepth 2 -cmin +2880 -exec rm -rf {} \;

In this case cmin=2880 (in minutes) equals 48 hours; 'man find' is your friend wink

Regards (from baires)
LU

Offline

#5 2011-03-12 04:04:52

sironitomas
Member
From: Cordoba, Argentina
Registered: 2009-11-28
Posts: 174
Website

Re: [SOLVED] Ring file-system for a surveillance server?

limaunion wrote:

One possiblity is to schedule a daily cron job with something like this:

find /home/videos/ -mindepth 2 -cmin +2880 -exec rm -rf {} \;

In this case cmin=2880 (in minutes) equals 48 hours; 'man find' is your friend wink

Regards (from baires)
LU

Gracias! I didn't know about find's cmin, it is a great option. Exec gave me some problems so I ended up using more than one command. This is the script actually:

find /home/user/videos -cmin +4320 > temp
rm `cat temp | grep avi`
rm temp

The only thing bad about it, is that when find doesn't produce any output, rm shows a error message because there are no arguments. I know that's not the best way, but it works.

Any recommendation is accepted.

Thanks!

Last edited by sironitomas (2011-03-12 04:05:38)

Offline

#6 2011-03-12 04:17:52

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: [SOLVED] Ring file-system for a surveillance server?

find /home/user/videos -cmin +4320 -iname \*.avi -print0 | xargs -0 rm -f

Offline

Board footer

Powered by FluxBB