ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Check When Cron Jobs Last Ran

    IT Discussion
    linux cron job cron
    2
    8
    5.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • thanksajdotcomT
      thanksajdotcom
      last edited by

      Is there a way to check when the last time a cron job ran was? I have some scripts setup hourly and some daily and I just want to see if they are running or not. Pretty sure they are but just curious.

      Thanks,
      A.J.

      1 Reply Last reply Reply Quote 0
      • scottalanmillerS
        scottalanmiller
        last edited by

        By default it would be in your syslog. You can add something to the crontab to alert you as well.

        thanksajdotcomT 1 Reply Last reply Reply Quote 0
        • scottalanmillerS
          scottalanmiller
          last edited by

          No Apple, syslog != Stalin.

          1 Reply Last reply Reply Quote 0
          • thanksajdotcomT
            thanksajdotcom @scottalanmiller
            last edited by

            @scottalanmiller said:

            By default it would be in your syslog. You can add something to the crontab to alert you as well.

            Where and how would I check this?

            1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller
              last edited by

              RHEL / CentOS:

              grep cron /var/log/messages
              
              thanksajdotcomT 1 Reply Last reply Reply Quote 0
              • thanksajdotcomT
                thanksajdotcom @scottalanmiller
                last edited by

                @scottalanmiller said:

                RHEL / CentOS:

                grep cron /var/log/messages
                

                Yeah, no /var/log/messages in Ubuntu? Any idea of their equivalent?

                1 Reply Last reply Reply Quote 0
                • scottalanmillerS
                  scottalanmiller
                  last edited by

                  Ubuntu is Debian so it uses /var/log/syslog

                  You should be using this all of the time. This is where all of your system messages are going.

                  1 Reply Last reply Reply Quote 0
                  • thanksajdotcomT
                    thanksajdotcom
                    last edited by

                    I found a thread on the Ubuntu forums here: ubuntuforums.org/showthread.php?t=1845962

                    It pointed me to a conf file located here: /etc/rsyslog.d/50-default.conf

                    I used vi to uncomment this line:

                    cron.*                       /var/log/cron.log
                    

                    Now I should get cron logs. I'll check the other place too. Thanks!

                    1 Reply Last reply Reply Quote 1
                    • 1 / 1
                    • First post
                      Last post