0

Could someone help in writing a shell script to monitor different cron jobs in crontab. As everyone knows different cron jobs run at different time I want to capture following things in ".csv" format:

  1. Script Name
  2. Scheduled times
  3. Next scheduled time
  4. Last Run time.
  5. Did the script ended successfully or it had an error after executing (Success/Fail).

I have certain limitations:

  1. syslog is not printing all the debug logs.
  2. Can't edit crontab.

I have logs which are directed which could be used.

  • 1
    Unless you have root access this is next to impossible because the necessary information is not available to non- root users. If you do have root you can edit crontab (technically, if not administratively). – roaima Mar 31 '18 at 13:41
  • logs cannot be used??? – Vivek Mar 31 '18 at 15:50
  • cron scheduling syntax is pretty hairy. what's the difference between 2,3,4 – Jasen Apr 1 '18 at 8:50
  • if Vixie cron use -L15 on the command-line – Jasen Apr 1 '18 at 8:52
0

Given the criteria you have specified this is not possible.

The necessary information is not available to non- root users. If you do have root you can edit crontab (technically, if not administratively) or change the flags used to run from, or read the cron log files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.