Member Avatar for conandor

how can i have a automatically check folder size and when the contain of the folder is reach to some limit it will deletes all the contains the files inside.

Hey There,

du is a good command to use to check a folder size. Compare that against your baseline (whatever your "too big" limit is) and, at that point, just use rm -rf to remove the contents. You'll probably want to run it in cron if it's a persistent check.

Best wishes,

Mike

Member Avatar for conandor

thanks.
how can i write a cron script for it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.