Skip to content

Deprecate and remove cron.php in favour of occ system:cron and the cron route #41914

Open

Description

@oc-tmueller

cron.php has two jobs today, and neither needs to be a standalone file any more:

We've been telling admins to use occ system:cron for years, but the product still points at cron.php:

  • core/js/backgroundjobs.js:24 calls $.get(OC.webroot+'/cron.php') on every page load in AJAX mode, which is the default.
  • settings/templates/panels/admin/backgroundjobs.php:49 and :57 tell admins to call cron.php for both webcron and system cron (the strings are translated in about 25 l10n files).
  • Existing webcron registrations and crontab lines (php -f …/cron.php) in the wild, in docs and Docker images.

Deleting the file now would silently stop background jobs on AJAX-mode installs and on every legacy webcron or crontab setup.

Proposed path

Next minor (non-breaking):

  • Point backgroundjobs.js at the core.Cron.run route instead of /cron.php.
  • Reword the admin panel: system cron → occ system:cron, webcron → the route URL.
  • Check the docs and our Docker images for cron.php crontab lines and switch them to occ.
  • Make the CLI branch of cron.php log and print a deprecation warning.

Next major (breaking):

  • CLI branch of cron.php exits non-zero with "use occ system:cron" instead of running jobs.
  • Keep the web redirect for one more major, then remove cron.php.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions