Skip to content

Commit 5eb83a4

Browse files
committed
Update README.md
1 parent 45f7a77 commit 5eb83a4

File tree

2 files changed

+121
-12
lines changed

2 files changed

+121
-12
lines changed

README.md

+118-11
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,24 @@ Quick links: [Using](#using) | [Contributing](#contributing) | [Support](#suppor
1111

1212
This package implements the following commands:
1313

14-
### ee cron add
14+
### ee cron
15+
16+
Manages cron on easyengine sites and host machine.
17+
18+
~~~
19+
ee cron
20+
~~~
21+
22+
23+
24+
25+
26+
### ee cron create
1527

1628
Adds a cron job to run a command at specific interval etc.
1729

1830
~~~
19-
ee cron add [<site-name>] --command=<command> --schedule=<schedule>
31+
ee cron create [<site-name>] --command=<command> --schedule=<schedule> [--user=<user>]
2032
~~~
2133

2234
**OPTIONS**
@@ -30,15 +42,48 @@ ee cron add [<site-name>] --command=<command> --schedule=<schedule>
3042
--schedule=<schedule>
3143
Time to schedule. Format is same as Linux cron.
3244

45+
[--user=<user>]
46+
User to execute command as.
47+
3348
We also have helper to easily specify scheduling format:
3449

35-
Entry | Description | Equivalent To
36-
----- | ----------- | -------------
37-
@yearly (or @annually) | Run once a year, midnight, Jan. 1st | 0 0 1 1 *
38-
@monthly | Run once a month, midnight, first of month | 0 0 1 * *
39-
@weekly | Run once a week, midnight between Sat/Sun | 0 0 * * 0
40-
@daily (or @midnight) | Run once a day, midnight | 0 0 * * *
41-
@hourly | Run once an hour, beginning of hour | 0 * * * *
50+
| Entry | Description | Equivalent To
51+
| ----- | ----------- | -------------
52+
| @yearly (or @annually) | Run once a year, midnight, Jan. 1st | 0 0 1 1 *
53+
| @monthly | Run once a month, midnight, first of month | 0 0 1 * *
54+
| @weekly | Run once a week, midnight between Sat/Sun | 0 0 * * 0
55+
| @daily (or @midnight) | Run once a day, midnight | 0 0 * * *
56+
| @hourly | Run once an hour, beginning of hour | 0 * * * *
57+
58+
You may also schedule a job to execute at fixed intervals, starting at the time it's added or cron is run.
59+
This is supported by following format:
60+
61+
- @every <duration>
62+
63+
Where duration can be combination of:
64+
<number>h - hour
65+
<number>m - minute
66+
<number>s - second
67+
68+
So 1h10m2s is also a valid duration
69+
70+
**EXAMPLES**
71+
72+
# Adds a cron job on example.com every 10 minutes
73+
$ ee cron create example.com --command='wp cron event run --due-now' --schedule='@every 10m'
74+
75+
# Adds a cron job on example.com every 1 minutes
76+
$ ee cron create example.com --command='wp cron event run --due-now' --schedule='* * * * *'
77+
78+
# Adds a cron job on example.com every 1 minutes run as user www-data
79+
$ ee cron create example.com --command='wp cron event run --due-now' --schedule='* * * * *' --user=www-data
80+
81+
# Adds a cron job to host running EasyEngine
82+
$ ee cron create host --command='wp cron event run --due-now' --schedule='@every 10m'
83+
84+
# Adds a cron job to host running EasyEngine
85+
$ ee cron create host --command='wp media regenerate --yes' --schedule='@weekly'
86+
4287

4388

4489
### ee cron delete
@@ -61,6 +106,69 @@ ee cron delete <cron-id>
61106

62107

63108

109+
### ee cron update
110+
111+
Updates a cron job.
112+
113+
~~~
114+
ee cron update <id> [--site=<site>] [--command=<command>] [--schedule=<schedule>] [--user=<user>]
115+
~~~
116+
117+
**OPTIONS**
118+
119+
<id>
120+
ID of cron to update.
121+
122+
[--site=<site>]
123+
Command to schedule.
124+
125+
[--command=<command>]
126+
Command to schedule.
127+
128+
[--schedule=<schedule>]
129+
Time to schedule. Format is same as Linux cron.
130+
131+
[--user=<user>]
132+
User to execute command as.
133+
134+
We also have helper to easily specify scheduling format:
135+
136+
| Entry | Description | Equivalent To
137+
| ----- | ----------- | -------------
138+
| @yearly (or @annually) | Run once a year, midnight, Jan. 1st | 0 0 1 1 *
139+
| @monthly | Run once a month, midnight, first of month | 0 0 1 * *
140+
| @weekly | Run once a week, midnight between Sat/Sun | 0 0 * * 0
141+
| @daily (or @midnight) | Run once a day, midnight | 0 0 * * *
142+
| @hourly | Run once an hour, beginning of hour | 0 * * * *
143+
144+
You may also schedule a job to execute at fixed intervals, starting at the time it's added or cron is run.
145+
This is supported by following format:
146+
147+
- @every <duration>
148+
149+
Where duration can be combination of:
150+
<number>h - hour
151+
<number>m - minute
152+
<number>s - second
153+
154+
So 1h10m2s is also a valid duration
155+
156+
**EXAMPLES**
157+
158+
# Updates site to run cron on
159+
$ ee cron update 1 --site='example1.com'
160+
161+
# Updates command of cron
162+
$ ee cron update 1 --command='wp cron event run --due-now'
163+
164+
# Updates command and user of cron
165+
$ ee cron update 1 --command='wp cron event run --due-now' --user=root
166+
167+
# Updates schedule of cron
168+
$ ee cron update 1 --schedule='@every 1m'
169+
170+
171+
64172
### ee cron list
65173

66174
Lists scheduled cron jobs.
@@ -111,7 +219,6 @@ We appreciate you taking the initiative to contribute to this project.
111219

112220
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.
113221

114-
115222
### Reporting a bug
116223

117224
Think you’ve found a bug? We’d love for you to help us get it fixed.
@@ -129,4 +236,4 @@ Want to contribute a new feature? Please first [open a new issue](https://github
129236
Github issues aren't for general support questions, but there are other venues you can try: https://easyengine.io/support/
130237

131238

132-
*This README.md is generated dynamically from the project's codebase using `ee scaffold package-readme` ([doc](https://github.com/easyengine/scaffold-package-command)). To suggest changes, please submit a pull request against the corresponding part of the codebase.*
239+
*This README.md is generated dynamically from the project's codebase using `ee scaffold package-readme` ([doc](https://github.com/EasyEngine/scaffold-command)). To suggest changes, please submit a pull request against the corresponding part of the codebase.*

composer.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
},
2424
"bundled": true,
2525
"commands": [
26-
"cron add",
26+
"cron",
27+
"cron create",
2728
"cron delete",
29+
"cron update",
2830
"cron list",
2931
"cron run-now"
3032
]

0 commit comments

Comments
 (0)