Limit the size of a directory by deleting old files

Posted by Sulliwane on Ask Ubuntu See other posts from Ask Ubuntu or by Sulliwane
Published on 2012-08-16T09:17:53Z Indexed on 2013/06/28 22:29 UTC
Read the original article Hit count: 240

Filed under:
|

I have a IP cam which save its recordings in a specific directory named Camera1 in my Ubuntu Server 12.04.

I would like to limit the size of this folder to 5 gigs, by deleting -say once a day- the oldest files.

I first checked the quota program but it doesn't seem to allow the creation of new files and deleting of the old ones.

So I think the best workaround would be to run a bash script ? But I have no idea how to write it...

Thank you guys !

© Ask Ubuntu or respective owner

Related posts about directory

Related posts about limit