- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Cron job (proces handling)
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
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
Community
Resources
Forums
Blogs
- 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
10-21-2014 03:44 AM - edited 10-21-2014 04:11 AM
10-21-2014 03:44 AM - edited 10-21-2014 04:11 AM
Cron job (proces handling)
Hi to all,
I'm curious to find out why cronjobs which runs every hour for example i have script which runs every hour leaves process in sleep state when finishes and again on same call leave new process in sleep state with new PID so i have multiple prcocesses on system in sleep state. System is HP-UX 11.23 i guess that process from cron should override previous jobs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2014 07:14 AM
10-21-2014 07:14 AM
Re: Cron job (proces handling)
Cron itself will NOT terminate any scripts that were previously started via cron.
Basically, if you have a script that runs via cron and one instance of the script does not finish before cron runs it the next time, you WILL wind up with multiple copies of the script running.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2014 11:17 AM
10-21-2014 11:17 AM
Re: Cron job (proces handling)
>I guess that process from cron should override previous jobs.
Only if you add code to kill any PIDs from previous runs.
Do you know why it is sleeping?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2014 06:11 PM
10-21-2014 06:11 PM
Re: Cron job (proces handling)
cron does only one thing: start processes
nothing else.
There is no code in cron to monitor what is started or to prevent overlapping processes.
This is a common problem when trying to schedule sequential backups. There is no guarentee that a backup will always take the same length of time to run.
Run the process or script by hand and troubleshoot the result.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2014 11:29 PM
10-21-2014 11:29 PM
Re: Cron job (proces handling)
First thank for answers,
Well that's why i'm wondering why they are in sleep state so i see many sleeping process which are from sh or ksh.
For example cronjob
/usr/sbin/sh or ksh then some shell.script which collects certain data
When i check process from script it have parrent process with child process which are encountering again and again with new pid.
Problem here is because on system it is defined that max process per user is 1024 and crontabs of that user came to that limit and exceed it and now from 1029 process i have many that are in sleep state. They don't consume CPU but on every hour when crontab job is on run load are on highly level.
What here concerns me is that average load is on 8 8 8 and from restart of Server it was 0.17 0.19 0.19 which is big difference.
I try to kill some of process by hand but on every crontab, load go up and amount of process rise up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2014 03:34 AM
10-22-2014 03:34 AM
Re: Cron job (proces handling)
The script needs to be debugged. Use the -x option to manually trace the script, and check the user's (root) email for error messages. If the script runs OK when run from a login shell, it is likely the script writer did not know that cron does not provide the same environment as a login.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2014 01:41 AM
10-23-2014 01:41 AM
Re: Cron job (proces handling)
>I'm wondering why they are in sleep state so I see many sleeping process which are from sh or ksh.
You could try using tusc to see what they are doing.
tusc -fp -ea -o tusc.out -p <pid>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2014 04:59 AM
10-24-2014 04:59 AM
Re: Cron job (proces handling)
Well for sure i will have to check some scripts because they dont run fine as they should. But that doesn't deal with process because process do what they need to to do by cron job and they write output in mail of user which cron job is not running if there is some problem. Process that run hourly made problems so i need to stop many of them by kill and also to stop cron job. Anyway i will have to run that cronjobs again because they have to be running on system. What here concerns me that process from crontab with every execution runs and load CPU while other go in sleep time and occupies CPU time (in sleep state) also which have impact on performance. So it would be tiresome to kill all sleeping proces all the way. That's why i post this thread to see if i could do something to cut of sleeping process of having impact on system.
I didn't use tusc command and seems that it doesn't exist in list of hp-ux commands or man pages.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2014 01:40 PM - edited 10-24-2014 01:42 PM
10-24-2014 01:40 PM - edited 10-24-2014 01:42 PM
Re: Cron job (proces handling)
> occupies CPU time (in sleep state)
If sleeping, it shouldn't use CPU time, unless continually waking.
>I didn't use tusc command and seems that it doesn't exist in list of HP-UX
You can download it here:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2014 01:54 AM - edited 10-27-2014 01:55 AM
10-27-2014 01:54 AM - edited 10-27-2014 01:55 AM
Re: Cron job (proces handling)
Well yes it occupies CPU while they sleepng (after some time they wake up) because they are mmlmacro commands i will take deep investigation about these process. It's nice to see some free tool. Thanks for sharing. I mainly lean on sar, top and vmstat for monitoring system. Glance is very good also but its not free.