Hello! This may be an Apache/Tomcat topic, but I thought I'd come here first. I have a Struts 1.1 app running under Tomcat 5.0, using Oracle 9i for DB. My user wants a DB backup to occur every x minutes automatically. I would like to use my properties file to contain the interval (ie; backup_interval=015 (15 minutes)). Anybody know how I can schedule an app (Struts action) to run every x minutes/hours?
A Struts Action is probably not where to put such a thing.
Not being much of a backend expert, please forgive my lack of knowledge. I would think that any automatic backups should be run independent of your webapp, that it would be 100% backend.
If you DO trigger it from the front, you should probably have a servlet that starts at startup (much like how you configure ActionServlet in web.xml to use Struts). This servlet could run forever (or start a thread to do so) and every x minutes perform the backup, x defined by a value set in web.xml. Also, every 15 minutes seems pretty heavy and I doubt if the redundancy benefits would outweigh the performance hit.