0

Hi All,

I have written a JSP file which will run query, get the result in a csv file and send the csv file daily to an email address. But how can I execute this JSP file daily in Linux? Can anyone help in this?

Edited by vineetanimu: n/a

4
Contributors
10
Replies
11
Views
7 Years
Discussion Span
Last Post by masijade
Featured Replies
  • 1

    And you are [i]still[/i] in the wrong. This entire "setup" is so far out of whack it's not even funny anymore. Oh well, whatever works. You can also jam a knife into your eye in order to scratch the back of your head, but is it worth it? Read More

  • 1

    And [i]still[/i] the wrong tool for the job, but I think I'm finished talking to the walls now. Read More

0

By writing a stand-alone application to do this and using a cron-job to "run it daily". A JSP is not the right tool for this task and it never was. Use the right tool for the task.

0

If JSP is not the right tool for this task, can you tell me which is the right tool for this task?
Thanks

0

If JSP is not the right tool for this task, can you tell me which is the right tool for this task?
Thanks

a stand-alone application ... and ... a cron-job

regardless of the language in which the app is written in. Java, C/C++, perl, even a shell script.

0

can we write links in cron.daily?I have read that u can write a link in cron.daily?

0

What link? There is no need for a link. What the heck do you need a link for? Like I said (and quoted), write an application (a stand-alone command line application not a JSP) that performs the actions that you currently have this JSP doing (which is wrong anyway, a JSP should do nothing but deliver HTML) and use cron to execute that application. How is it so hard to understand that?

1

And you are still in the wrong. This entire "setup" is so far out of whack it's not even funny anymore. Oh well, whatever works. You can also jam a knife into your eye in order to scratch the back of your head, but is it worth it?

0

As you ask me what link,I understand that you do not know how to give a link for a cron.daily job

You said :-

can we write links in cron.daily?I have read that u can write a link in cron.daily?

So definitely he asked what link.

And next you are not exactly invoking a link, you are feeding the link to 'links' a text based browser which is doing the job of invoking the link of your JSP for you.

What masijade said and I concur is this is not a job for a JSP, covert it to a Java application (since then you can reuse the code), and run that Java application via cron.

Edited by stephen84s: n/a

0

I used http://jtheory.com/jdring.html
Put cron like job in servlet.
web.xml:

<servlet>
		<servlet-name>Cron</servlet-name>
		<servlet-class>com.my.hrit.servlet.Cron</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>

Following code in servlet init():

// run every day at 6:50 PM
			mgr.addAlarm("ComplexCron2", 50, 18, -1, -1, -1, -1,
					new AlarmListener() {
						public void handleAlarm(AlarmEntry entry) {
							System.out.println("\u0007Cron alarm1 ("
									+ new Date() + ")");


						}

					});

I put my cron like servlet at It works great.

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.