easyengine/cron-command
Manages cron jobs in EasyEngine, (*1)
Quick links: Using | Contributing | Support, (*2)
Using
This package implements the following commands:, (*3)
ee cron
Manages cron on easyengine sites and host machine., (*4)
ee cron
ee cron create
Adds a cron job to run a command at specific interval etc., (*5)
ee cron create [<site-name>] --command=<command> --schedule=<schedule> [--user=<user>]
OPTIONS, (*6)
[<site-name>]
Name of site to run cron on.
--command=<command>
Command to schedule.
--schedule=<schedule>
Time to schedule. Format is same as Linux cron.
[--user=<user>]
User to execute command as.
We also have helper to easily specify scheduling format:, (*7)
Entry |
Description |
Equivalent To |
@yearly (or @annually) |
Run once a year, midnight, Jan. 1st |
0 0 1 1 * |
@monthly |
Run once a month, midnight, first of month |
0 0 1 * * |
@weekly |
Run once a week, midnight between Sat/Sun |
0 0 * * 0 |
@daily (or @midnight) |
Run once a day, midnight |
0 0 * * * |
@hourly |
Run once an hour, beginning of hour |
0 * * * * |
You may also schedule a job to execute at fixed intervals, starting at the time it's added or cron is run.
This is supported by following format:, (*8)
Where duration can be combination of:
h - hour
m - minute
s - second, (*9)
So 1h10m2s is also a valid duration, (*10)
EXAMPLES, (*11)
# Adds a cron job on example.com every 10 minutes
$ ee cron create example.com --command='wp cron event run --due-now' --schedule='@every 10m'
# Adds a cron job on example.com every 1 minutes
$ ee cron create example.com --command='wp cron event run --due-now' --schedule='* * * * *'
# Adds a cron job on example.com every 1 minutes run as user www-data
$ ee cron create example.com --command='wp cron event run --due-now' --schedule='* * * * *' --user=www-data
# Adds a cron job to host running EasyEngine
$ ee cron create host --command='wp cron event run --due-now' --schedule='@every 10m'
# Adds a cron job to host running EasyEngine
$ ee cron create host --command='wp media regenerate --yes' --schedule='@weekly'
ee cron delete
Deletes a cron job, (*12)
ee cron delete <cron-id>
OPTIONS, (*13)
<cron-id>
ID of cron to be deleted.
EXAMPLES, (*14)
# Deletes a cron jobs
$ ee cron delete 1
ee cron update
Updates a cron job., (*15)
ee cron update <id> [--site=<site>] [--command=<command>] [--schedule=<schedule>] [--user=<user>]
OPTIONS, (*16)
<id>
ID of cron to update.
[--site=<site>]
Command to schedule.
[--command=<command>]
Command to schedule.
[--schedule=<schedule>]
Time to schedule. Format is same as Linux cron.
[--user=<user>]
User to execute command as.
We also have helper to easily specify scheduling format:, (*17)
Entry |
Description |
Equivalent To |
@yearly (or @annually) |
Run once a year, midnight, Jan. 1st |
0 0 1 1 * |
@monthly |
Run once a month, midnight, first of month |
0 0 1 * * |
@weekly |
Run once a week, midnight between Sat/Sun |
0 0 * * 0 |
@daily (or @midnight) |
Run once a day, midnight |
0 0 * * * |
@hourly |
Run once an hour, beginning of hour |
0 * * * * |
You may also schedule a job to execute at fixed intervals, starting at the time it's added or cron is run.
This is supported by following format:, (*18)
Where duration can be combination of:
h - hour
m - minute
s - second, (*19)
So 1h10m2s is also a valid duration, (*20)
EXAMPLES, (*21)
# Updates site to run cron on
$ ee cron update 1 --site='example1.com'
# Updates command of cron
$ ee cron update 1 --command='wp cron event run --due-now'
# Updates command and user of cron
$ ee cron update 1 --command='wp cron event run --due-now' --user=root
# Updates schedule of cron
$ ee cron update 1 --schedule='@every 1m'
ee cron list
Lists scheduled cron jobs., (*22)
ee cron list [<site-name>] [--all]
OPTIONS, (*23)
[<site-name>]
Name of site whose cron will be displayed.
[--all]
View all cron jobs.
EXAMPLES, (*24)
# Lists all scheduled cron jobs
$ ee cron list
# Lists all scheduled cron jobs of a site
$ ee cron list example.com
ee cron run-now
Runs a cron job, (*25)
ee cron run-now <cron-id>
OPTIONS, (*26)
<cron-id>
ID of cron to run.
EXAMPLES, (*27)
# Runs a cron job
$ ee cron run-now 1
Contributing
We appreciate you taking the initiative to contribute to this project., (*28)
Contributing isnât limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation., (*29)
Reporting a bug
Think youâve found a bug? Weâd love for you to help us get it fixed., (*30)
Before you create a new issue, you should search existing issues to see if thereâs an existing resolution to it, or if itâs already been fixed in a newer version., (*31)
Once youâve done a bit of searching and discovered there isnât an open or fixed issue for your bug, please create a new issue. Include as much detail as you can, and clear steps to reproduce if possible., (*32)
Creating a pull request
Want to contribute a new feature? Please first open a new issue to discuss whether the feature is a good fit for the project., (*33)
Support
Github issues aren't for general support questions, but there are other venues you can try: https://easyengine.io/support/, (*34)
This README.md is generated dynamically from the project's codebase using ee scaffold package-readme
(doc). To suggest changes, please submit a pull request against the corresponding part of the codebase., (*35)