- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- want to restart httpd ( tomcat apache service) thr...
Operating System - Linux
1823113
Members
3213
Online
109646
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2008 07:47 AM
02-04-2008 07:47 AM
want to restart httpd ( tomcat apache service) through cron
Hi All,
I want to restart the httpd service for the application p2ms.
When I did through command then it is giving me below output tat is successful
testrt:/root #sh /usr/java/apache-tomcat-5.5.23/bin/sample.sh
Mon Feb 4 21:08:42 IST 2008
21:08:42 up 124 days, 12:23, 1 user, load average: 0.00, 0.00, 0.00
Using CATALINA_BASE: /usr/java/apache-tomcat-5.5.23
Using CATALINA_HOME: /usr/java/apache-tomcat-5.5.23
Using CATALINA_TMPDIR: /usr/java/apache-tomcat-5.5.23/temp
Using JRE_HOME: /usr/java/jdk1.5.0_05
Using CATALINA_BASE: /usr/java/apache-tomcat-5.5.23
Using CATALINA_HOME: /usr/java/apache-tomcat-5.5.23
Using CATALINA_TMPDIR: /usr/java/apache-tomcat-5.5.23/temp
Using JRE_HOME: /usr/java/jdk1.5.0_05
But when I am trying same script through crontab using user root and redirected the output to the file /tmp/output then I got only the output of date & uptime command as per below
testrt:/root #crontab -e
# Entry(s) in /opt/hpservices/RemoteSupport are for HP Instant Support Enterprise Edition
0 0 * * 1 /opt/hpservices/RemoteSupport/config/pruneIncidents.sh > /dev/null 2>&1
00,15,30,45 * * * * sh /tmp/cpu_mem_util.sh>>/tmp/ioutil.sh
2 22 * * * sh /tmp/flush_diag.sh
###################
1 2 * * * /etc/vsa/bin/dragnet >/dev/null 2>&1
#Run system activity accounting tool every 10 minutes
*/10 * * * * root /usr/lib/sa/sa1 -d 1 1
# 0 * * * * root /usr/lib/sa/sa1 -d 600 6 &
# Generate a daily summary of process accounting at 23:53
#18 06 * * * root /usr/lib/sa/sa2 -A
50 20 * * * sh /usr/java/apache-tomcat-5.5.23/bin/sample.sh >> /tmp/sample
~
and the contents of file /tmp/sample is as per below:
testrt:/tmp #more sample
Mon Feb 4 20:50:00 IST 2008
20:50:00 up 124 days, 12:04, 1 user, load average: 0.00, 0.00, 0.00
what is the cause here....please do the needful
Thanks in advance for your help
Many Thanks,
Sachin
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2008 10:42 AM
02-04-2008 10:42 AM
Re: want to restart httpd ( tomcat apache service) through cron
Cron doesn't go out and invoke your .bash_profile (or any other environment files), so it just doesn't know all about your CATALINA_HOME, etc. When it comes to environment variables, it really doesn't know much at all. So you need your cron job to a script that you write, in which you set all of these environment variables, and then invoke the commands to restart Tomcat.
We are the people our parents warned us about --Jimmy Buffett
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP