You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Cédric Buschini <cb...@carax.com> on 2005/03/17 17:24:59 UTC
Start and stop Tomcat + Cron
Hi
I'd like to stop and start my tomcat using cron so I added this in the
root's crontab and /etc/crontab :
00 22 * * * root /PATH/TO/JAKARTA/bin/shutdown.sh
02 22 * * * root /PATH/TO/JAKARTA/bin/startup.sh
but it does work :s
Any got ideas ???
Thk
Cedric
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Start and stop Tomcat + Cron
Posted by Lionel Farbos <li...@free.fr>.
Yes and it depends on your crontab version.
In my version,
the system-wide crontab seems like this :
00 22 * * * /PATH/TO/JAKARTA/bin/shutdown.sh
and the user-wide crontab seems like this :
00 22 * * * /PATH/TO/JAKARTA/bin/shutdown.sh
...
but are not executed by the same user.
On Thu, 17 Mar 2005 10:27:58 -0600
"Robert r. Sanders" <ro...@ipov.net> wrote:
> Are your JAVA_HOME and other vars defined in a global context? Other
> than that I don't really know.
>
> Cédric Buschini wrote:
>
> > Hi
> >
> > I'd like to stop and start my tomcat using cron so I added this in the
> > root's crontab and /etc/crontab :
> >
> > 00 22 * * * root /PATH/TO/JAKARTA/bin/shutdown.sh
> > 02 22 * * * root /PATH/TO/JAKARTA/bin/startup.sh
> >
> > but it does work :s
> >
> > Any got ideas ???
> >
> > Thk
> >
> > Cedric
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
>
> --
> Robert r. Sanders
> Chief Technologist
> iPOV
> (334) 821-5412
> www.ipov.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Start and stop Tomcat + Cron
Posted by Cédric Buschini <cb...@carax.com>.
yes everything is fine.
all vars have been export. I've done a JAVA_HOME=path/to/java then
export JAVA_HOME.
Same thing for CATALINA_HOME ....
Robert r. Sanders wrote:
> Are your JAVA_HOME and other vars defined in a global context? Other
> than that I don't really know.
>
> Cédric Buschini wrote:
>
>> Hi
>>
>> I'd like to stop and start my tomcat using cron so I added this in
>> the root's crontab and /etc/crontab :
>>
>> 00 22 * * * root /PATH/TO/JAKARTA/bin/shutdown.sh
>> 02 22 * * * root /PATH/TO/JAKARTA/bin/startup.sh
>>
>> but it does work :s
>>
>> Any got ideas ???
>>
>> Thk
>>
>> Cedric
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Start and stop Tomcat + Cron
Posted by "Robert r. Sanders" <ro...@ipov.net>.
Are your JAVA_HOME and other vars defined in a global context? Other
than that I don't really know.
Cédric Buschini wrote:
> Hi
>
> I'd like to stop and start my tomcat using cron so I added this in the
> root's crontab and /etc/crontab :
>
> 00 22 * * * root /PATH/TO/JAKARTA/bin/shutdown.sh
> 02 22 * * * root /PATH/TO/JAKARTA/bin/startup.sh
>
> but it does work :s
>
> Any got ideas ???
>
> Thk
>
> Cedric
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
--
Robert r. Sanders
Chief Technologist
iPOV
(334) 821-5412
www.ipov.net
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Start and stop Tomcat + Cron
Posted by Cédric Buschini <cb...@carax.com>.
1/ Sorry having replied to an unrelated message.
2/ Yes Tomcat always run as root.
3/ I am newbie, so I will get info about 'wapper script'.
4/ uhmmm a newbie question : Where can I find these logs ..... sorry :s
QM wrote:
>On Thu, Mar 17, 2005 at 05:24:59PM +0100, C?dric Buschini wrote:
>: I'd like to stop and start my tomcat using cron so I added this in the
>: root's crontab and /etc/crontab :
>: 00 22 * * * root /PATH/TO/JAKARTA/bin/shutdown.sh
>: 02 22 * * * root /PATH/TO/JAKARTA/bin/startup.sh
>
>1/ please post a *new* message when writing to the list. Replying to
>an old (unrelated) message confuses thread-aware mailers, which makes
>your question harder to find (and thus answer).
>
>2/ does Tomcat always run as root? That's just a side concern, but you
>probably don't want to do that.
>
>3/ You mentioned that all of the proper environment variables are set,
>but are they set just in root's shell? Keep in mind, cron is a barebones
>environment. You'd do well to use wrapper scripts for cron jobs, such
>that the wrapper can set any needed env vars.
>
>4/ What are the messages in the error logs, cron logs, etc? What
>"doesn't work?"
>
>-QM
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Start and stop Tomcat + Cron
Posted by QM <qm...@brandxdev.net>.
On Thu, Mar 17, 2005 at 05:24:59PM +0100, C?dric Buschini wrote:
: I'd like to stop and start my tomcat using cron so I added this in the
: root's crontab and /etc/crontab :
: 00 22 * * * root /PATH/TO/JAKARTA/bin/shutdown.sh
: 02 22 * * * root /PATH/TO/JAKARTA/bin/startup.sh
1/ please post a *new* message when writing to the list. Replying to
an old (unrelated) message confuses thread-aware mailers, which makes
your question harder to find (and thus answer).
2/ does Tomcat always run as root? That's just a side concern, but you
probably don't want to do that.
3/ You mentioned that all of the proper environment variables are set,
but are they set just in root's shell? Keep in mind, cron is a barebones
environment. You'd do well to use wrapper scripts for cron jobs, such
that the wrapper can set any needed env vars.
4/ What are the messages in the error logs, cron logs, etc? What
"doesn't work?"
-QM
--
software -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Start and stop Tomcat + Cron
Posted by Ben Kim <bk...@coe.tamu.edu>.
1. Which platform and crond are you on? Is the crontab format correct for
your environment?
00 22 * * * root /PATH/TO/JAKARTA/bin/shutdown.sh
vs. 00 22 * * * /PATH/TO/JAKARTA/bin/shutdown.sh
2. You may want to see if shutdown.sh works as root.
3. You can also try
00 22 * * * /PATH/TO/JAKARTA/bin/shutdown.sh >> logfile 2>&1
or whatever works in your shell, and post caught errors.
4. If you're in Fedora, you can put these 2 lines in a script (say,
tomcat1.sh) and
00 22 * * * root /YOUR/PATH/tomcat1.sh
su - tomcat /PATH/TO/JAKARTA/bin/setclasspath.sh
su - tomcat /PATH/TO/JAKARTA/bin/startup.sh
HTH.
Regards,
Ben Kim
Database Developer/Systems Administrator
434E Harrington Tower / College of Education
Texas A&M University
------------ Original Message ------------
Hi
I'd like to stop and start my tomcat using cron so I added this in the
root's crontab and /etc/crontab :
00 22 * * * root /PATH/TO/JAKARTA/bin/shutdown.sh
02 22 * * * root /PATH/TO/JAKARTA/bin/startup.sh
but it does work :s
Any got ideas ???
Thk
Cedric
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org