Update
This commit is contained in:
parent
54e12ddae9
commit
8e91d64dba
53
cron.md
53
cron.md
|
@ -1,41 +1,58 @@
|
||||||
---
|
---
|
||||||
title: Cron
|
title: Cron
|
||||||
category: CLI
|
category: CLI
|
||||||
|
layout: 2017/sheet
|
||||||
|
tags: [Featured]
|
||||||
---
|
---
|
||||||
|
|
||||||
### Format
|
## Format
|
||||||
|
{: .-two-column}
|
||||||
* Min Hour Day Month Weekday
|
|
||||||
|
|
||||||
|
|
||||||
### Format
|
### Format
|
||||||
|
|
||||||
|
```
|
||||||
|
Min Hour Day Mon Weekday
|
||||||
|
```
|
||||||
|
{: .-setup}
|
||||||
|
|
||||||
|
```
|
||||||
* * * * * command to be executed
|
* * * * * command to be executed
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
┬ ┬ ┬ ┬ ┬
|
┬ ┬ ┬ ┬ ┬
|
||||||
│ │ │ │ │
|
│ │ │ │ └─ Weekday (0=Sun .. 6=Sat)
|
||||||
│ │ │ │ │
|
│ │ │ └────── Month (1..12)
|
||||||
│ │ │ │ └───── day of week (0 - 6) (0 or 6 are Sunday to Saturday, or use names)
|
│ │ └─────────── Day (1..31)
|
||||||
│ │ │ └────────── month (1 - 12)
|
│ └──────────────── Hour (0..23)
|
||||||
│ │ └─────────────── day of month (1 - 31)
|
└───────────────────── Minute (0..59)
|
||||||
│ └──────────────────── hour (0 - 23)
|
```
|
||||||
└───────────────────────── min (0 - 59)
|
{: .-setup}
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
0 * * * * every hour
|
| Example | Description |
|
||||||
*/15 * * * * every 15 mins
|
| --- | --- |
|
||||||
0 */2 * * * every 2 hours
|
| `0 * * * *` | every hour |
|
||||||
0 0 0 * 0 every sunday midnight
|
| `*/15 * * * *` | every 15 mins |
|
||||||
|
| `0 */2 * * *` | every 2 hours |
|
||||||
|
| `0 0 0 * 0` | every Sunday midnight |
|
||||||
|
| --- | --- |
|
||||||
|
| `@reboot` | every reboot |
|
||||||
|
|
||||||
@reboot every reboot
|
### Crontab
|
||||||
|
|
||||||
### crontab
|
|
||||||
|
|
||||||
|
```bash
|
||||||
# Adding tasks easily
|
# Adding tasks easily
|
||||||
echo "@reboot echo hi" | crontab
|
echo "@reboot echo hi" | crontab
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
# Open in editor
|
# Open in editor
|
||||||
crontab -e
|
crontab -e
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
# List tasks
|
# List tasks
|
||||||
crontab -l [-u user]
|
crontab -l [-u user]
|
||||||
|
```
|
||||||
|
|
|
@ -30,13 +30,13 @@ Jekyll
|
||||||
|
|
||||||
As of github-pages v156.
|
As of github-pages v156.
|
||||||
|
|
||||||
jekyll-github-metadata
|
GitHub Metadata
|
||||||
----------------------
|
---------------
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
gems:
|
whitelist:
|
||||||
- jekyll-github-metadata
|
- jekyll-github-metadata
|
||||||
|
|
||||||
repository: username/project
|
repository: username/project
|
||||||
|
@ -63,13 +63,13 @@ See: [Repository metadata on GitHub pages](https://help.github.com/articles/repo
|
||||||
</a>
|
</a>
|
||||||
```
|
```
|
||||||
|
|
||||||
jekyll-gist
|
Gists
|
||||||
-----------
|
-----
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
gems:
|
whitelist:
|
||||||
- jekyll-gist
|
- jekyll-gist
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -83,13 +83,13 @@ See: [jekyll-gist](https://github.com/jekyll/jekyll-gist)
|
||||||
|
|
||||||
This places a Gist in your page.
|
This places a Gist in your page.
|
||||||
|
|
||||||
jekyll-mentions
|
Mentions
|
||||||
---------------
|
--------
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
gems:
|
whitelist:
|
||||||
- jekyll-mentions
|
- jekyll-mentions
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -104,14 +104,14 @@ Hey @rstacruz, what do you think of this?
|
||||||
Just mention anyone in any page. Their names will be turned into links.
|
Just mention anyone in any page. Their names will be turned into links.
|
||||||
|
|
||||||
|
|
||||||
jekyll-redirect-from
|
Redirects
|
||||||
--------------------
|
---------
|
||||||
{: .-three-column}
|
{: .-three-column}
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
gems:
|
whitelist:
|
||||||
- jekyll-redirect-from
|
- jekyll-redirect-from
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue