Monitoring of cron jobs in crontab using shell script

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












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.







share|improve this question


















  • 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 at 13:41










  • logs cannot be used???
    – Vivek
    Mar 31 at 15:50










  • cron scheduling syntax is pretty hairy. what's the difference between 2,3,4
    – Jasen
    Apr 1 at 8:50










  • if Vixie cron use -L15 on the command-line
    – Jasen
    Apr 1 at 8:52















up vote
0
down vote

favorite












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.







share|improve this question


















  • 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 at 13:41










  • logs cannot be used???
    – Vivek
    Mar 31 at 15:50










  • cron scheduling syntax is pretty hairy. what's the difference between 2,3,4
    – Jasen
    Apr 1 at 8:50










  • if Vixie cron use -L15 on the command-line
    – Jasen
    Apr 1 at 8:52













up vote
0
down vote

favorite









up vote
0
down vote

favorite











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.







share|improve this question














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.









share|improve this question













share|improve this question




share|improve this question








edited Mar 31 at 13:18









Yurij Goncharuk

2,2582521




2,2582521










asked Mar 31 at 12:23









Vivek

11




11







  • 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 at 13:41










  • logs cannot be used???
    – Vivek
    Mar 31 at 15:50










  • cron scheduling syntax is pretty hairy. what's the difference between 2,3,4
    – Jasen
    Apr 1 at 8:50










  • if Vixie cron use -L15 on the command-line
    – Jasen
    Apr 1 at 8:52













  • 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 at 13:41










  • logs cannot be used???
    – Vivek
    Mar 31 at 15:50










  • cron scheduling syntax is pretty hairy. what's the difference between 2,3,4
    – Jasen
    Apr 1 at 8:50










  • if Vixie cron use -L15 on the command-line
    – Jasen
    Apr 1 at 8:52








1




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 at 13:41




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 at 13:41












logs cannot be used???
– Vivek
Mar 31 at 15:50




logs cannot be used???
– Vivek
Mar 31 at 15:50












cron scheduling syntax is pretty hairy. what's the difference between 2,3,4
– Jasen
Apr 1 at 8:50




cron scheduling syntax is pretty hairy. what's the difference between 2,3,4
– Jasen
Apr 1 at 8:50












if Vixie cron use -L15 on the command-line
– Jasen
Apr 1 at 8:52





if Vixie cron use -L15 on the command-line
– Jasen
Apr 1 at 8:52











1 Answer
1






active

oldest

votes

















up vote
0
down vote













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.






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f434662%2fmonitoring-of-cron-jobs-in-crontab-using-shell-script%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    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.






    share|improve this answer
























      up vote
      0
      down vote













      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.






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        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.






        share|improve this answer












        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 1 at 10:15









        roaima

        39.5k545106




        39.5k545106






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f434662%2fmonitoring-of-cron-jobs-in-crontab-using-shell-script%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay