- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Anybody write script (ksh) to report crontab entri...
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
Forums
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
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
07-19-2004 03:53 AM
07-19-2004 03:53 AM
Anybody write script (ksh) to report crontab entries ?
I shearch a script to report entries of the crontabs file, sort by schedule.
By example I would like to know every day what will be execute in my box from 17:00 today until 16:59 tomorrow, all order by time.
It is dificult for me to interpret all the caractere of the crontal file, by example
I can find, *, -, numbers etc... I know the format and signification of the record but I would like to make un report easyer to read for a non unix person. I start to write the script but I have difficulties to program the script to read and interpret the schedule.
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2004 04:03 AM
07-19-2004 04:03 AM
Re: Anybody write script (ksh) to report crontab entries ?
crontab -l|sort -rnk5|sort -rnk4|sort -rnk3|sort -rnk2|sort -rnk1
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2004 04:03 AM
07-19-2004 04:03 AM
Re: Anybody write script (ksh) to report crontab entries ?
crontab -l user_name |sort -rnk5|sort -rnk4|sort -rnk3|sort -rnk2|sort -rnk1
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2004 04:30 AM
07-19-2004 04:30 AM
Re: Anybody write script (ksh) to report crontab entries ?
It may be not what you are looking for, but I needed a way to visualize what jobs were running in parallel with other jobs.
For each job from crontab I add a line into the script that has the day ranges (SMTWUFS), the start hour/minute, and the end hour/minute.
Then the script dumps out a a chart showing all the jobs and the time range they are running. Since our jobs start before midnight I had to take in account the time roll over.
Maybe with a little editting you can find use for it...
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2004 06:08 AM
07-19-2004 06:08 AM
Re: Anybody write script (ksh) to report crontab entries ?
I have another question for Rodney.
I think you understand what I need but I studie and practice a lot of programming language, like PLI, fortran, cobol, basic, apl etc but I forget it. Now I am fluently in korn shell and I don't know nothing about Perl.
What I need to run your script on my box. Do I have to install some fileset to have the interpreter of Perl who can understand your script ?
thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2004 06:17 AM
07-19-2004 06:17 AM
Re: Anybody write script (ksh) to report crontab entries ?
If you don't then you can get it from the porting center-
http://hpux.cs.utah.edu/hppd/hpux/Languages/perl-5.8.3/
perl brings the benefit of shell scripting, grep, awk, sed all into one spiffy programming language. It has been called the system administrators "glue" language. Documentation can be found all over the internet.
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2004 06:19 AM
07-19-2004 06:19 AM
Re: Anybody write script (ksh) to report crontab entries ?
http://www.software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=PERL
It may already be there:
# which perl
/usr/bin/perl
# ll /usr/bin/perl
lrwxr-xr-x 1 root sys 18 May 7 13:06 /usr/bin/perl -> /opt/perl/bin/perl
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2004 07:30 AM
07-19-2004 07:30 AM
Re: Anybody write script (ksh) to report crontab entries ?
I verifie if i have perl on my box.
When I type this command :
# perl -v
I received this anwser :
This is perl, version 4.0
$RCSfile: perl.c,v $$Revision: 4.0.1.8 $$Date: 1993/02/05 19:39:30 $
Patch level: 36
Copyright (c) 1989, 1990, 1991, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 4.0 source kit.
But when I execute the command :
# perl -c testcron.pl
NB testcron.pl is the script then I downlaod from your previous answer.
I have this anwser
the flag minus c meaning testing the syntax of the script
syntax error in file testcron.pl at line 5, next 2 tokens "(["
syntax error in file testcron.pl at line 21, next 2 tokens "(["
syntax error in file testcron.pl at line 26, next 2 tokens "]["
syntax error in file testcron.pl at line 28, next 2 tokens "]["
syntax error in file testcron.pl at line 46, next token "}"
syntax error in file testcron.pl at line 49, next 2 tokens "++)"
syntax error in file testcron.pl at line 59, next 2 tokens "++)"
syntax error in file testcron.pl at line 74, next token "}"
syntax error in file testcron.pl at line 108, next 2 tokens "]["
testcron.pl had compilation errors.
If I execute this command
# perl testcron.pl
I received the same last awnser.
I explore the perl world for the fist time
sorry for my inexperience with that.
thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2004 07:45 AM
07-19-2004 07:45 AM
Re: Anybody write script (ksh) to report crontab entries ?
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2004 04:07 AM
07-21-2004 04:07 AM
Re: Anybody write script (ksh) to report crontab entries ?
I have installed the version of Perl that I found on CD number 4 of the applications cd of dec 2003 and I can run your script without any problem.
Your script make a great job but when I examine this script I can understand that this script doesn't read the crontab file, all the cron are coded at the beginning of the script.
This script doesn't take care of the * and - and , that I can found in the crontab file. But your script is very interressant and I am sure it will be helpful for me.
Thanks a lot for your help.
Have a nice day.