Crontab do not run on PM hours


 
Thread Tools Search this Thread
Operating Systems HP-UX Crontab do not run on PM hours
# 36  
Old 04-17-2012
Is that ping spawned by cron? Most unix-pings do not stop unless you tell them by using the -c flag.
# 37  
Old 04-17-2012
No that is cron entry:
Code:
#* 10-11 * * * /usr/sbin/ping 192.168.0.85 | while read pong; do echo "$(date): $pong"; done > /tmp/fr/ping_date.txt

That should not be running because is commented. but it appears in the ps command

Code:
ls -lrt | tail
-rw-r--r--   1 root       sys          19928 Feb  8 16:42 disk.080212
-rw-r--r--   1 root       sys          21058 Feb  8 16:45 present_new_disk.080212
-rw-r--r--   1 root       sys        3044648 Feb 17 08:57 mceldev.170212
-rwx------   1 root       sys          11914 Feb 17 11:09 vconf11
-rwxrwxrwx   1 root       sys            254 Mar 23 10:17 fs
-rwx------   1 root       sys           1398 Apr 16 15:03 netscp
-rw-r--r--   1 root       sys              0 Apr 16 16:00 outfile
-rw-r--r--   1 root       sys              0 Apr 16 16:00 errorfile
-rw-r--r--   1 root       sys        2877696 Apr 17 09:00 downlog
-rw-r--r--   1 root       sys              4 Apr 17 09:00 abc
mceldev[607]/tmp/fr #

# 38  
Old 04-17-2012
That cron alone was enough because it will try to start 119 concurrent jobs (one per minute between 10:00-11:59) .They do look faulty because they all started the day BEFORE you issued the ps -ef.
When you fix the process, note that the HP-UX ping command takes a parameter -n <number> to restrict the number of ping packets.
I can't explain why the ping jobs have PPID 1 unless cron has been stop/started since they started running or they were actually started with nohup command &.


A gash way of finding out what jobs are running directly from cron is to find out the PID of cron itself and then grep that as PPID from ps -ef . This will not tell you what is queued but might help diagnose where the 100 concurrent jobs are coming from (assuming it wasn't the faulty ping cron).

Last edited by methyl; 04-17-2012 at 08:42 AM.. Reason: spelling & layout
# 39  
Old 04-17-2012
Thank you very much for your email, I did not noticed that by running between 10:00-11:00, I was puting so much "stress" in the crontab (running lots of jobs). I did start/stop the cron earlier. Because that entry was already commented out, can I kill those pids with related with ping command?
# 40  
Old 04-17-2012
Yes you can kill the PIDs from the rogue "ping" processes.

Killing these processes may leave crout... files in /var/spool/cron/tmp . Just check that these files are not too big, otherwise they are harmless.



Footnote: Starting and stopping cron is the last resort and you need to be sure that cron is doing nothing at the time. I would only stop cron if I was doing something unusual like working on a database when I did not want any "interruptions".

Last edited by methyl; 04-17-2012 at 08:50 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Run a command once in three hours

Hi All, I have a bash script which is scheduled to run for every 20 minutes. Inside the bash script, one command which I am using need to be triggered only once in two or three hours.Is there anyway to achieve this. For example, if then echo "hi" else echo "Hello" UNIX Command---once... (5 Replies)
Discussion started by: ginrkf
5 Replies

2. Shell Programming and Scripting

Help 'speeding' up this 'parsing' script - taking 24+ hours to run

Hi, I've written a ksh script that read a file and parse/filter/format each line. The script runs as expected but it runs for 24+ hours for a file that has 2million lines. And sometimes, the input file has 10million lines which means it can be running for more than 2 days and still not finish.... (9 Replies)
Discussion started by: newbie_01
9 Replies

3. Shell Programming and Scripting

Can't get my crontab to run

I'm trying to get a crontab to run, every Friday at 11am and the problem is that it isn't running at all. 0 11 * * 6 /Users/martinb/Documents/SYSADMIN/Regular-Scripts/Info-And-Backups.sh Here's a link to a screenshot of my script (I've censored my email address). Screen Shot 2017 11 03... (3 Replies)
Discussion started by: $shell_Learner
3 Replies

4. Solaris

How to run cron entry every 5 min during office hours only?

Hi I need to setuop a cron entry to run every 5 min, only in office hours (between 8:00AM to 18:00PM, I did the following: 0,5,10,15,20,25,30,35,40,45,50,55 8,9,10,11,12,13,14,15,16,17,18 * * * /home/xxx/zzz.ksh But somehow does not work. Could it be wrong? (8 Replies)
Discussion started by: fretagi
8 Replies

5. Shell Programming and Scripting

Script fails to run properly when run from CRONTAB

Hello all, I'm trying to write a script to gather and send data and it works just fine at the bash command line, but when executing from CRON, it does not run properly. My scripting skills are pretty limited and there's probably a better way, but as I said it works at the command line, but... (12 Replies)
Discussion started by: rusman
12 Replies

6. UNIX for Dummies Questions & Answers

Execute crontab for every 4 hours and begin from current time

I want to add a crontab entry which should execute for every 4 hours and that 4 hours calculation should begin from the current time. Normally if I set the crontab entry like this, 00 */4 30 05 * root date >>/tmp/cronout The above will execute the date command for every 4 hours like... (7 Replies)
Discussion started by: Ganeshwari
7 Replies

7. Solaris

crontab to run every 20 second

Hi experts, I want to set the crontab for my script which will run every 20 seconds I think below could be the possible one- */3 * * * * /export/home/username/scripts/runing.sh As my system(SOLARIS 9) is live- i am confused to implement before make sure !!! I need... (4 Replies)
Discussion started by: thepurple
4 Replies

8. Solaris

How to define every 5 hours in Crontab

Hi Experts, I want to run a script which will move the files from particular directory to another backup directory After EVERY 5 hour. How can I put it in crontab- 5 hours!!! * * * * /home/movefilescritp.sh //purple (8 Replies)
Discussion started by: thepurple
8 Replies

9. Shell Programming and Scripting

How to make a script run for a maximum of "x" number of hours only

How to make a script run for a maximum of "x" number of hours only (7 Replies)
Discussion started by: ScriptDummy
7 Replies

10. UNIX for Dummies Questions & Answers

crontab every 2 minutes, 24 hours and once a week

can someone please check my answers for the crontabs I am making 1. how would I set up a crontab tab executes every 2 minutes each and every day of the week? answer: 2 * * * * /path/to/file.pl <-- is this correct? 2. how would I set up a crontab that executes every 24 hours at 2am?... (6 Replies)
Discussion started by: Bobafart
6 Replies
Login or Register to Ask a Question