I need to execute a jsp page after every 30 minutes. I am using glassfish server. I want to uses cron job for that, but I never work before with cron job.
Please give me any link or example from where I can understand how to configure a cron job for jsp page and execute it after a specific time period?
thanks in advance, Enamul
If you simply want to cause the webserver to "execute" a JSP page, you need to send the webserver a suitable HTTP request. The simplest way to do this is to use a command line tool like
wget
orcurl
(or the Windoze alternatives). Once you can do that successfully, it is a simple matter to turn that into acron
job.Refer to:
wget(1)
orcurl(1)
for how to use these commands.crontab(1)
andcrontab(5)
to find out how to create a cron job.Trying to do this in Java is most likely going to make the task more complicated than it needs to be.