Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-66570

Allow disabling of cron output when capturing logs

XMLWordPrintable

    • MOODLE_36_STABLE
    • MOODLE_38_STABLE
    • MDL-66570-master
    • Hide
      1. Login to your site
      2. Navigate to Site admin > Server > Tasks > Task logs
      3. Make a note of the top "Start time"
      4. Ensure that upgrade is run
      5. Run cron in CLI:

        php admin/cli/cron.php
        

        1. Confirm that there was a load of output from each of the jobs that ran
      6. Refresh the list of Task logs
        1. Confirm that there have been new logs since the time you noted
      7. View one of the logs by clicking on the Magnifier
        1. Confirm that there was content in it
      8. Note the time of the most recent task
      9. Run a single scheduled task:

        php admin/tool/task/cli/schedule_task.php --execute="\mod_forum\task\cron_task"
        

        1. Confirm that there was a load of output
      10. Refresh the list of Task logs
        1. Confirm that there have been new logs since the time you noted
      11. View the most recent log by clicking on the Magnifier
        1. Confirm that there was content in it
      12. Note the time of the most recent task
      13. Navigate to Site admin > Server > Tasks > Task log configuration
      14. Uncheck "Display log output"
      15. Run a single scheduled task:

        php admin/tool/task/cli/schedule_task.php --execute="\mod_forum\task\cron_task"
        

        1. Confirm that there was no output
      16. Refresh the list of Task logs
        1. Confirm that there have been new logs since the time you noted
      17. View the top log by clicking on the Magnifier
        1. Confirm that there was content in it
      18. Note the time of the most recent task
      19. Wait a minute or so
      20. Run cron in CLI:

        php admin/cli/cron.php
        

        1. Confirm that there was very little output
      21. Refresh the list of Task logs
        1. Confirm that there have been new logs since the time you noted
      22. View the top log by clicking on the Magnifier
        1. Confirm that there was content in it
      Show
      Login to your site Navigate to Site admin > Server > Tasks > Task logs Make a note of the top "Start time" Ensure that upgrade is run Run cron in CLI: php admin/cli/cron.php Confirm that there was a load of output from each of the jobs that ran Refresh the list of Task logs Confirm that there have been new logs since the time you noted View one of the logs by clicking on the Magnifier Confirm that there was content in it Note the time of the most recent task Run a single scheduled task: php admin/tool/task/cli/schedule_task.php --execute="\mod_forum\task\cron_task" Confirm that there was a load of output Refresh the list of Task logs Confirm that there have been new logs since the time you noted View the most recent log by clicking on the Magnifier Confirm that there was content in it Note the time of the most recent task Navigate to Site admin > Server > Tasks > Task log configuration Uncheck " Display log output " Run a single scheduled task: php admin/tool/task/cli/schedule_task.php --execute="\mod_forum\task\cron_task" Confirm that there was no output Refresh the list of Task logs Confirm that there have been new logs since the time you noted View the top log by clicking on the Magnifier Confirm that there was content in it Note the time of the most recent task Wait a minute or so Run cron in CLI: php admin/cli/cron.php Confirm that there was very little output Refresh the list of Task logs Confirm that there have been new logs since the time you noted View the top log by clicking on the Magnifier Confirm that there was content in it

      For Moodle users on shared hosting, they may only have the option of using a web-based cron automation service (e.g., cron-jobs.org) to run cron jobs. However, these services (specifically cron-jobs.org) consider > 1KB of returned data as a script failure and will suspend the schedule after 15 failures.

      cron.php already takes an optional_param of 'password' so it would be helpful if we could add another optional_param like 'restrictoutput' which would limit the output to some trivial amount (or eliminate the output altogether).

      Steps to reproduce:

      1. Go to cron-jobs.org and schedule it to call /admin/cron.php every 1 minute
      2. Wait 15 minutes
      3. Go back to cron-jobs.org and see the schedule has been disabled (after 15 times of getting back more than 1KB of data)

       

            dobedobedoh Andrew Lyons
            johna931 John Andre
            Simey Lameze Simey Lameze
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 53 minutes
                1h 53m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.