API version: dev

---

# `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](/reference/configuration.md#background-tasks)), so no
external scheduler needs to be set up for this to run.

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

> **⚠ Note**
>
> 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`](/command/cron-delete-expired-uploads.md).

## Help

```bash
php bin/console cron --help
```

```text
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

```bash
php bin/console cron
```

```text
    ▄   
  ▄▀ ▀▄  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.
```

---

Home: [Ember Nexus API docs](/index.md)

Full site map: [llms.txt](/llms.txt)

Previous: [cache:clear:etag](/command/cache-clear-etag.md)

Next: [cron:delete-expired-uploads](/command/cron-delete-expired-uploads.md)
