Hazardous Duplicate Cron Entry?


 
Thread Tools Search this Thread
Operating Systems HP-UX Hazardous Duplicate Cron Entry?
# 1  
Old 07-13-2005
Hazardous Duplicate Cron Entry?

Hi All,
How to prevent starting of processes that have duplicate entries in cron file, i have written a shell script to validate with "ps |grep" command before starting the process, but still when same process started at same time, it may not be able to detect the existing process.

Sample cron Entry

00 10 * * * /usr/nag/startInterestCalculationBatch
00 10 * * * /usr/nag/startInterestCalculationBatch

startInterestCalculationBatch file willl validate with "ps |grep" command before starting the InterestCalculation (Java) process
Is there any other options? to prevent it.

Regards

Nag

Last edited by nag_sundaram; 07-13-2005 at 08:35 AM..
# 2  
Old 07-13-2005
You could easily look for a temporary file and if it doesn't exist, create it at the start of the cron job. This would then be your control file which doesn't allow other cron jobs to run (each cron job would look for the file, if it exists, exit).
# 3  
Old 07-13-2005
It is probably also worth looking at the root cause of this and establishing why there are duplicate jobs in the crontab in the first place (and who is putting them there) - and then delete them!

Cheers
ZB
# 4  
Old 07-14-2005
Bug

I do agree with ZB. try to find duplicate entries in cron and remove the same.
You can do it manually if crontab files for users are not big or else simply by using sort -u option.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Deleting duplicate glosses in a dictionary entry

I am working on an Urdu to Hindi dictionary and I have created the following file structure: Headword=Gloss1,Gloss2,Gloss3 i.e. glosses delimited by a comma. It so happens that in some cases (around 6000+ in a file of over 200,000+ the glosses are duplicated. Since this may be a... (3 Replies)
Discussion started by: gimley
3 Replies

2. Shell Programming and Scripting

checking duplicate entry in file

Hi i have a file like 110.10 120.10 -1120 110.10 and the lines are having more than 10k. do we have anycommand to check the duplicate entries in the file. I applied the while loop by greping each line with whole file, but it is taking huge amount of time as the file size is large. ... (5 Replies)
Discussion started by: saluja.deepak
5 Replies

3. Solaris

cron entry

Hi, I have to add two cron entry now. Please correct me if anything wrong Below script should run at every one and half hour. 30 01 * * * /export/home/gxadm/scripts/collect_mq_info.pl $HOME/GCSS/logs > /dev/null 2>&1 Below script should run at every 2 hours 0 02 * * *... (9 Replies)
Discussion started by: Mani_apr08
9 Replies

4. Shell Programming and Scripting

Need to delete duplicate lease entry

Hi *, I need to delete duplicate lease entries in file according to MAC/IP. I'm having tempfile which contains many lease info and need to have one entry for each IP(not more than that), if it contains more than one entry for same set, need to be deleted that entry... EX: lease... (4 Replies)
Discussion started by: SMNK
4 Replies

5. Solaris

User entry in both cron.allow and cron.deny

Hello All, Anybody please help me to know ,what happens when a user having entry in both cron.allow and cron.deny files.Wheather the user will be able to access the crontab??? Thanks in advance Vaisakh (5 Replies)
Discussion started by: ksvaisakh
5 Replies

6. Shell Programming and Scripting

Cron Entry

Hi folks, I have got the following cron entry ... 08 30 * * * /mp1/scripts/test.sh > /mp1/scripts/test_logs.txt 2>&1 The problem is that instead of generating a new test_logs.txt file every time it keeps on appending the outputs to the test_logs.txt file. What is it that I am doing wrong... (2 Replies)
Discussion started by: King Nothing
2 Replies

7. Shell Programming and Scripting

Print Only second Duplicate entry in the file

I have file where it contains 2 columns. In two columns the first column is repeated more than once. I wanted to take the unique record in first column and the corresponding second column value . The below is the example of the file: 8244100320012955|000b063471a4... (4 Replies)
Discussion started by: ravi_rn
4 Replies

8. UNIX for Dummies Questions & Answers

Remove duplicate entry in one line

Can anyone help me how can i print only the unique entry in a line? MI_AP MI_AP MI_CM MI_MF RC_NAP MBS_AP SF_RAN MBS_AP NT_CAR so that it will on output the one unique entry per line. MI_AP MI_CM MI_MF RC_NAP MBS_AP SF_RAN NT_CAR I can't find the same situation on the knowledge... (5 Replies)
Discussion started by: kharen11
5 Replies

9. UNIX for Dummies Questions & Answers

cron entry

Hi, Where can we find Cron job logs?i have a cron job which is not executing at all, 00 12 * * * /xx/yy/job > /pp/qq/log if i execute the job alone,it is executing fine. >/xx/yy/job > /pp/qq/log (is executing fine) but its not executing when it triggered from cron.is there any place cron... (7 Replies)
Discussion started by: rujus
7 Replies

10. AIX

Cron entry

Hi All, I want to run a cron job to run on the first saturday of each month at 1:30am. Would the following entry suffice this condition 30 1 6 * 6 wall %Will this work% Appreciate your time. (1 Reply)
Discussion started by: rramanuj
1 Replies
Login or Register to Ask a Question