Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Run Nightly Tasks

 
Patrick McDonogh
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there everyone,

I have a struts web application and have some actions which i want to run every night for instance, every night run the action that searches the database for users who have been marked as deleted and remove them from the database.

I was wondering what the best(most performant) way is to run these actions that need to run at certain times of the day, month, year, etc. So i guess what i am asking is what the best was is to run tasks that need to run every day, year, etc at a certain time in Java.

Thanks for any help given.

Patrick
 
John Melton
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are many different ways to do this. The simplest would probably be a command line shell script/batch job on the server to call the servlet. However if you want something more robust, you might want to check out the quartz package for scheduling jobs
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic