Crontab not starting the application in every minute...


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Crontab not starting the application in every minute...
# 1  
Old 11-16-2012
Crontab not starting the application in every minute...

Hi Friends,

I have developed a standalone java application which is deployed in a Linux environment. I have created a script for starting this application if the process is not running or else do nothing.
The application is deployed as a .jar. I have also created a crontab entry like this...

Code:
*/1 * * * * /app/prd-data/abc/def/xyzMonitor.sh

This is the contents of the xyzMonitor.sh script...
Code:
#!/bin/bash 
# check daemon 
ps -ef | grep -v grep | grep common.App 
# if not found - notequals to 0, start it 
if [ $? -ne 0 ] 
then 
nohup /app/wl-data/Oracle/Middleware/jdk160_21/bin/java -cp Application.jar *.common.App & 
else 
echo "XYZ Watcher already running - do nothing" 
fi

The issue now is that even after one minute the crontab is not picking the script for running this application.
Can someone help me what is the issue here, whether the script is not correct or any others.

P.S: I am a Linux noob and this development is done for my company. I have done the deployment by getting info from various websites. So I might be wrong in this.
Experts please advice to solve this issue.



Thanks in advance,
Binoy
# 2  
Old 11-17-2012
You can just use:
Code:
 * * * * * /app/prd-data/abc/def/xyzMonitor.sh

And check crontab log, if it`s runs correctly.

Last edited by Scott; 11-17-2012 at 09:48 AM.. Reason: Code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Application services not starting with server reboot

Hi All, My application uses three different sub-services to make complete application up and running to normal. The entry of all the three services are present in /etc/init.d directory with proper softlink created to application home path where it actually exists. In one rare case one of the... (3 Replies)
Discussion started by: hk_kamozalwar
3 Replies

2. UNIX for Dummies Questions & Answers

How to grep a line not starting with # from a file (there are two lines starting with # and normal)?

e.g. File name: File.txt cat File.txt Result: #INBOUND_QUEUE=FAQ1 INBOUND_QUEUE=FAQ2 I want to get the value for one which is not commented out. Thanks, (3 Replies)
Discussion started by: Tanu
3 Replies

3. Web Development

Starting Web Application on Jboss

Hello, I installed Jboss EAP 6 on a remote Linux server in standalone mode, and deployed a HelloWorld war file successfully. Opened a browser on my PC and pointed to http://127.0.0.1:8080/filename. I can see “Hello World!” on my browser. However, if the browser points to http://server's... (3 Replies)
Discussion started by: learnix
3 Replies

4. Shell Programming and Scripting

Take minute per minute from a log awk

Hi, I've been trying to develop a script that performs the parsing of a log every 1 minute and then generating some statistics. I'm fairly new to programming and this is why I come to ask if I can lend a hand. this is my log: xxxx 16/04/2012 17:00:52 - xxxx714 - E234 - Time= 119 ms.... (8 Replies)
Discussion started by: jockx
8 Replies

5. UNIX for Dummies Questions & Answers

Cannot run crontab :1: bad minute error

Hi can any one help me out. while running crontab , m getting error bad minute time.. how to resolve this error. i created 1 txt file a.cron mirrordir -vm \home\t \homet1 & i saved it. then i created a crontab file ..with crontab -e & i added a line in it. * 1 * * * \root\a.cron & i save... (2 Replies)
Discussion started by: unxdost114
2 Replies

6. Shell Programming and Scripting

Crontab for every minute or every hour

How to set crontab for every minute or every hour (1 Reply)
Discussion started by: kaushik02018
1 Replies

7. UNIX for Advanced & Expert Users

crontab : bad minute error

when i say $crontab z it says ==> "z":6: bad minute "z":6: bad minute errors in crontab file, can't install. any clue why its happening? (1 Reply)
Discussion started by: crackthehit007
1 Replies

8. Shell Programming and Scripting

run script 1 minute interval without CronTab

I am using Solaris 9. I wish to run my script every 1 minute inteval. Though i can run it using below entry in crontab. * * * * /export/home/username/script/file_exist_&_run.sh in short above script will check whether a specific file exist in a directory. If it found it will inovke another... (10 Replies)
Discussion started by: thepurple
10 Replies

9. Shell Programming and Scripting

Starting application using shell scripts

Hi All, I want to write a shell script which will start some application lets say "Windows media player". Please let me know your inputs. Thanks in advance, Niyati (0 Replies)
Discussion started by: Niyati
0 Replies

10. Shell Programming and Scripting

GUI application through CRONTAB

I ve tried to initialise a GUI application by giving an entry in the CRONTAB. But its not working.could any one tell me how can I get this? (0 Replies)
Discussion started by: arun_v
0 Replies
Login or Register to Ask a Question