Hi
Running motion and I'm using a lot of file space with.jpg and .avi files
I need to run ideally a daemon to delete the oldest files once the used space in a directory exceeds say 70 %.
Is there any application that will do this ?
or is it a case of write a script and use cron or something to invoke it say once an hour.
$this->bbcode_second_pass_code('', '[richard@localhost Live_MUF_V73]$ df --direct /dev/sda5
Filesystem     1K-blocks  Used Available Use% File
-                1993968     0   1993968   0% /dev/sda5
')
using the above maybe using SED or AWK to get the third block, Used,  and then sorta
       If [SED/AWK ] > 70
          then delete, and here's a hard bit, all order than 1 day
rm doesn't have switches to delete on age
the start of each file is date stamped  in day-month-year
 maybe using SED or AWK to get the greatest decimal day  and the lowest decimal day and delete all less than the greatest decimal day.
I would really appreciate some help with this, as its not as simple as "just delete everything older than a day if too much disk space is used."
Thanks
			

