Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 487416

Summary: sosplugin to collect the details on cron including the system and user cron jobs
Product: Red Hat Enterprise Linux 5 Reporter: Vimal Kumar <vikumar>
Component: sosAssignee: Adam Stokes <astokes>
Status: CLOSED ERRATA QA Contact: BaseOS QE <qe-baseos-auto>
Severity: medium Docs Contact:
Priority: low    
Version: 5.4CC: agk, azelinka, bmr
Target Milestone: rc   
Target Release: 5.4   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-02 07:31:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
crontab.py none

Description Vimal Kumar 2009-02-25 21:15:00 UTC
Created attachment 333234 [details]
crontab.py

A sos plugin to gather the details on the system cron jobs and user specific cron jobs. This could help if there are cron jobs resetting any sort of system configurations, and one would not suspect a cron job in the scenario.


Steps to Reproduce:
-----------------------

a) Create a new file named 'crontab.py' in the sos plugins directory '/usr/lib/python2.4/site-packages/sos/plugins/'.

b) Add the following content in the file 'crontab.py' :
  
<snip>
import sos.plugintools
import os

class crontab(sos.plugintools.PluginBase):
    """ System and User's crontab details
    """
    
    def setup(self):
        self.addCopySpec("/etc/cron*")
        self.collectExtOutput("/usr/bin/crontab -l -u root", suggest_filename = "root_crontab")
        self.collectExtOutput("""for i in `ls /home/`;\
        do echo "User :" $i;/usr/bin/crontab -l -u $i;\
        echo "---------------";done""", suggest_filename = "users_crontab")
        return
</snip>

c) The above steps will create the sos plugin named 'crontab'. This plugin can be run individually using the command 'sosreport --only-plugins=crontab'. 

d) The collected details are :

 (i) The file under /etc/ starting with 'cron'.
 
 (ii) Collect the root user's crontab in the file 'sos_commands/crontab/root_crontab'.

 (iv) Collect the individual cron settings of every user under /home and save it under 'sos_commands/crontab/users_crontab'.

Comment 6 errata-xmlrpc 2009-09-02 07:31:45 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1418.html