- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Command to display all crontabs for a given system
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
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
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-19-2003 01:10 PM
тАО09-19-2003 01:10 PM
Are the crontabs shown in that directory necessarily active?
Thanks,
Dave
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-19-2003 02:15 PM
тАО09-19-2003 02:15 PM
SolutionBut that only works for each user.
You can do a su - username -c "crontab -l" for each user authorized for cron.
Or you can look at the raw files.
watch this.
while xx
read
cron.allow
/usr/bin/su - $xx -c "crontab -l"
done < /var/adm/cron/cron.allow
That will do it.
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-19-2003 02:46 PM
тАО09-19-2003 02:46 PM
Re: Command to display all crontabs for a given system
If you change the script I wrote to /var/spool/cron it will display the crontabs.
I know of know more elegant way to do the job.
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-21-2003 01:40 AM
тАО09-21-2003 01:40 AM
Re: Command to display all crontabs for a given system
"All the road lead to Rome"
To try it out just download the attachement invoke it as root like
./show_all_crontab.sh
should do the job of diplaying the content of th various crontabs, you could output this to a report file like
ex:
#./show_all_crontab.sh > report_crontab.rep
then when you need to check if it as been modified you could
ex:
# mv report_crontab.rep report_crontab_old.rep
# ./show_all_crontab.sh > report_crontab.rep
# diff report_crontab_old.rep report_crontab.rep
this way you would know WHAT has been changed.
If you are more intested by WHEN it has been changed then you could do
ex:
#for i in `find /var/spool/cron/ -name "*" -type f` ; do stat $i ; done > when_change_crontab.rep
this when_change_crontab.rep could also be mv to an old version when needed and checked again's difference's with newly created when_change_crontab.rep
all theses ex: could be put into a script invoke so to make it more robust and easy.
Hope this will get you rolling
Keep us informed.
enjoy
J-P
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2003 02:37 AM
тАО09-21-2003 02:37 AM
Re: Command to display all crontabs for a given system
It is just say the I named attachement script show_all_crontab.sh
the forums rename's it to 14807.sh
so remplace show_all_crontab.sh with 14807.sh in my prior reply.
J-P
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-23-2003 09:16 AM
тАО09-23-2003 09:16 AM
Re: Command to display all crontabs for a given system
Thats pretty much what I figured though, its not a hidden cron switch from 1975 or something that has just been left out of the man pages.
SEP you get points for fast command line job, but I think huc wins as far as script features :)
Again thanks a lot guys,
Dave