Question

I need to monitor NAS file system disk space, whenever file-system disk space goes above from a threshold value, I am I deleting oldest files from file system to bring back file system disk space below to threshold value. I read several article which suggested me two alternatives:

  • by creating a daemon process which will run in background

  • by creating a script and run through crontab

which would be a better way to run a file system monitoring service?

I need to run the monitoring script every 60 sec.For both options I will use python. it will run on *nix(unix/linux) environment.

Was it helpful?

Solution

Create a script (you wouldn't need python for this task, just df and find). This is pretty lightweight, needs less code than a daemon (much less maintenance in the long run), and running scripts once a minute by cron is not unheard of. :-)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top