- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script to list and mail crontab entries for all us...
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
09-17-2008 03:28 AM
09-17-2008 03:28 AM
Script to list and mail crontab entries for all users in the server.
I our environment we have a lot of servers. I want to get the list of crontab file for each user emaild to me with full information.
Example:
In my server i have two crontab users root and oracle. I want the full details of all the crontab entries of both users. Can any one help me in this.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2008 03:32 AM
09-17-2008 03:32 AM
Re: Script to list and mail crontab entries for all users in the server.
cat /var/spool/cron/crontab/*
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2008 03:34 AM
09-17-2008 03:34 AM
Re: Script to list and mail crontab entries for all users in the server.
cat /var/spool/cron/crontabs/* |mail you@wherever.com
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2008 04:07 AM
09-17-2008 04:07 AM
Re: Script to list and mail crontab entries for all users in the server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2008 04:15 AM
09-17-2008 04:15 AM
Re: Script to list and mail crontab entries for all users in the server.
> I want the script that can sort the working and non working crontab entries.
If there is a file in '/var/spool/cron/crontabs' then there is a "working" crontab for that user. By "working" I mean that the 'cron' daemon will execute the script. Whether or not the executed script "works" is another matter.
Pete offered you a simple, straighforward solution. A simple embellishment would be to add the user to whom each crontab file belongs in the output.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2008 04:51 AM
09-17-2008 04:51 AM
Re: Script to list and mail crontab entries for all users in the server.
write a report to a file and use:
http://www.hpux.ws/mailfile2 to mail the attachment.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2008 10:11 PM
09-17-2008 10:11 PM
Re: Script to list and mail crontab entries for all users in the server.
That would be:
for file in /var/spool/cron/crontabs/*; do
user=${file##*/}
echo "crontab for user: $user ========="
cat $file
done | mailx -s "crontab list for $(hostname)" you@wherever.com