| Author |
can a cron job call a servlet?
|
Chris Montgomery
Ranch Hand
Joined: Jan 14, 2004
Posts: 141
|
|
if so, how? I've never done a cron job before... right now, I have a file called Email and I've placed it in my /etc/crod.d directory to be called once a minute. here are the contents of my Email file: GET use http://192.168.100.23:8080/Email/EmailServlet but nothing appears to be happening. Thanks!
|
 |
Gonzalo Nadal
Greenhorn
Joined: Dec 08, 2005
Posts: 15
|
|
hi chris, I made a file call runTest.sh, marked as executable, and it works. #! /bin/sh GET www.google.com [ December 11, 2005: Message edited by: Gonzalo Nadal ]
|
L'essentiel est invisible pour les yeux.(Le petit prince)
What is essential is invisible to the eyes.(The Little Prince)
Lo esencial es invisible a los ojos. (El principito)
|
 |
Chris Montgomery
Ranch Hand
Joined: Jan 14, 2004
Posts: 141
|
|
okay, now I have: #! /bin/sh GET 192.168.100.23:8080/Email/EmailServlet but still don't see it. The way I am able to tell is through logging. When I visit it using a browser, I get a row in my log table. I don't see any rows being added. I'm going to my services and restarting crond. Is it a port issue?
|
 |
Gonzalo Nadal
Greenhorn
Joined: Dec 08, 2005
Posts: 15
|
|
Well. Try to invoke directly the script from a command line and see if your servlet is called. If the servlet is called the problem is in the cron configuration. If the servlet is not called from command line then will be a bit harder find the problem. The servlet receive any parameters? The url that you invoke from browser is the same in the script?
|
 |
Peter Rooke
Ranch Hand
Joined: Oct 21, 2004
Posts: 779
|
|
The may be of interest: jCronTab. Never used it, could you tell us if you find it useful. You might find this site helpfull: JPackage - once you have the required update manager installed and configured - you can download the lastest open source java / j2ee tools without having to worry about package dependancies. [ December 11, 2005: Message edited by: Peter Rooke ]
|
Regards Pete
|
 |
Chris Montgomery
Ranch Hand
Joined: Jan 14, 2004
Posts: 141
|
|
getting closer. When I tried running it I received a Permission denied error. I ran a chmod on it, but as of now it's only set for user root and group root. The job still isn't running. What user "owns" cron jobs?
|
 |
Chris Montgomery
Ranch Hand
Joined: Jan 14, 2004
Posts: 141
|
|
got it. seesm cron.d isn't the way to go. I put the line in my crontab file and it worked perfectly. Thanks for the help
|
 |
Gonzalo Nadal
Greenhorn
Joined: Dec 08, 2005
Posts: 15
|
|
|
Great!
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14456
|
|
cron.d entries must be marked executable or they get ignored. In the RdHat/Fedora Vixie cron, you place the script in question (or a link to it, anyway) in the cron.daily, cron.hourly, cron.weekly or whatever directory. Cron normally will email its results to you. There are two different cron interfaces, BTW. the /etc/cron.d stuff is run as root, which is not recommended for user-level jobs. For userlevel jobs, each user has a crontab that can be edited. For details I'll have to refer you to the crontab man pages, though. It's been a while.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
Stefan Wagner
Ranch Hand
Joined: Jun 02, 2003
Posts: 1923
|
|
cron normally doesn't know the environmentsettings from /etc/profile, /etc/bash.bashrc or whatever is used on your machine. So instead of wget, you have to call /usr/bin/wget with the full path or which path is needed in your case (I don't know GET).
|
http://home.arcor.de/hirnstrom/bewerbung
|
 |
 |
|
|
subject: can a cron job call a servlet?
|
|
|