I have a small webapplication (PHP and XSLT based) which uses an intern file cache and saves the user's search data.
Now, I don't want to run out of disk space, so I need a program for cleaning up and warning. It should do the following:
- start once every 24 hours
- check the files in the intern cache directory and delete all files which are older than 1 hour
- sum up the whole disk space used and if it is greater than 1 gb, send an email to the admin.
- stop
So, I think the programming is rather simply and I think I can cope with that (I know a little bit C++ and PHP). But I have no idea how to set up this program in an efficient way so that it only starts once every 24 hours and stops immediately after it has done its tasks: Which program language should I use? Is there a certain framework for programs like this?
My system is openSUSE 13.1 64 bit, the webserver is Apache 2.4.6.