Skip to main content

cron

Runs every registered background task once, in sequence. It does not itself schedule anything or run in a loop - every API container instance already invokes it automatically every 5 minutes (see the configuration reference), so no external scheduler needs to be set up for this to run.

Takes no arguments or options. Currently runs cron:delete-expired-uploads followed by cron:reindex-files. If cron is disabled instance-wide, the command exits immediately without running any of the individual tasks.

Each task can also be run on its own, e.g. for testing or to run it on a different schedule than the others - see cron:delete-expired-uploads.

Help

php bin/console cron --help
Description:
  Executes background tasks

Usage:
  cron

Options:
  -h, --help            Display help for the given command. When no command is given display help for the list command
      --silent          Do not output any message
  -q, --quiet           Only errors are displayed. All other output is suppressed
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -e, --env=ENV         The Environment name. [default: "prod"]
      --no-debug        Switch off debug mode.
      --profile         Enables profiling (requires debug).
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Example

php bin/console cron
    ▄   
  ▄▀ ▀▄  Ember Nexus API
   ▀█▀   production mode

  Cron


    ▄   
  ▄▀ ▀▄  Ember Nexus API
   ▀█▀   production mode

  Cron

  No expired uploads found.

▶ Finished.


    ▄   
  ▄▀ ▀▄  Ember Nexus API
   ▀█▀   production mode

  Cron

  Reindexing files marked as updated...

▶ Reindexed 0 element file(s).

▶ Finished.