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