API version: 0.3.0

---

# `cron:delete-expired-uploads`

Permanently deletes resumable uploads (started via [`POST /<uuid>/file`](/api/post-element-file.md) or
[`PUT /<uuid>/file`](/api/put-element-file.md)) that expired and were never completed, freeing their
already-uploaded chunks from storage.

Takes no arguments or options. An upload becomes eligible once its `expires` timestamp (see
[`PATCH /upload/<uuid>`](/api/patch-upload.md)) is further in the past than the configured grace period - the
grace period is added on top of the expiry itself, so an upload isn't deleted the instant it
expires. Uploads that were explicitly deleted with [`DELETE /upload/<uuid>`](/api/delete-upload.md),
or removed automatically because their target element was deleted, are skipped since there is
nothing left to clean up.

> **ℹ Info**
>
> Every API instance already schedules this on its own interval (see
> [Background tasks](/reference/configuration.md#background-tasks)), so it does not need to be
> invoked manually. It's safe to run at any time, though - it only ever touches uploads that are
> already expired.

## Help

```bash
php bin/console cron:delete-expired-uploads --help
```

```text
Description:
  Deletes uploads which were not completed during their lifetime.

Usage:
  cron:delete-expired-uploads

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:delete-expired-uploads
```

```text
    ▄
  ▄▀ ▀▄  Ember Nexus API
   ▀█▀   v0.3.0, production mode

  Cron

  No expired uploads found.

▶ Finished.
```

---

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

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

Previous: [cron:calculate-embeddings](/command/cron-calculate-embeddings.md)

Next: [cron:expire-tokens](/command/cron-expire-tokens.md)
