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.

4
  • 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). Commented Mar 31, 2018 at 13:41
  • logs cannot be used???
    – Vivek
    Commented Mar 31, 2018 at 15:50
  • cron scheduling syntax is pretty hairy. what's the difference between 2,3,4
    – Jasen
    Commented Apr 1, 2018 at 8:50
  • if Vixie cron use -L15 on the command-line
    – Jasen
    Commented Apr 1, 2018 at 8:52

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .