Article 6J4VG I need a script to delete oldest files in directory to keep from using up all space

I need a script to delete oldest files in directory to keep from using up all space

by
Clutch2
from LinuxQuestions.org on (#6J4VG)
My security system sends alert video to a couple pi's in case the pc that does the monitoring is stolen. The problem is sometimes I space off and forget to delete files before I run out of storage.

Anyone have a script that I can run as a cron job to keep the directory contents under a specified size by deleting the oldest files. The directory right now is half full and has 6000 files in it to give you an idea.

Thanks,
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments