Wp cron event list (WP-CLI)

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen
$ wp help cron event list

NAME

  wp cron event list

DESCRIPTION

  Lists scheduled cron events.

SYNOPSIS

  wp cron event list [--fields=<fields>] [--<field>=<value>] [--field=<field>] [--format=<format>]

OPTIONS

  [--fields=<fields>]
    Limit the output to specific object fields.

  [--<field>=<value>]
    Filter by one or more fields.

  [--field=<field>]
    Prints the value of a single field for each event.

  [--format=<format>]
    Render output in a particular format.
    ---
    default: table
    options:
      - table
      - csv
      - ids
      - json
      - count
      - yaml
    ---

AVAILABLE FIELDS

  These fields will be displayed by default for each cron event:
  * hook
  * next_run_gmt
  * next_run_relative
  * recurrence

  These fields are optionally available:
  * time
  * sig
  * args
  * schedule
  * interval
  * next_run


EXAMPLES

    # List scheduled cron events
    $ wp cron event list
    +-------------------+---------------------+---------------------+------------+
    | hook              | next_run_gmt        | next_run_relative   | recurrence |
    +-------------------+---------------------+---------------------+------------+
    | wp_version_check  | 2016-05-31 22:15:13 | 11 hours 57 minutes | 12 hours   |
    | wp_update_plugins | 2016-05-31 22:15:13 | 11 hours 57 minutes | 12 hours   |
    | wp_update_themes  | 2016-05-31 22:15:14 | 11 hours 57 minutes | 12 hours   |
    +-------------------+---------------------+---------------------+------------+

    # List scheduled cron events in JSON
    $ wp cron event list --fields=hook,next_run --format=json
    [{"hook":"wp_version_check","next_run":"2016-05-31 10:15:13"},{"hook":"wp_update_plugins","next_run":"2016-05-31
    10:15:13"},{"hook":"wp_update_themes","next_run":"2016-05-31 10:15:14"}]

Example

Formatting updated myself:

$ wp cron event list | grep jetpack

       hook                next_run_gmt      next_run_relative   recurrence
--------------------   -------------------   -----------------   ----------
jetpack_clean_nonces   2023-12-05 07:30:31	  now	           1 hour
jetpack_v2_heartbeat   2023-12-05 07:30:31	  now	           1 day

See also