This commit is contained in:
Rico Sta. Cruz 2017-08-29 00:58:09 +08:00
parent 54e12ddae9
commit 8e91d64dba
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
2 changed files with 55 additions and 38 deletions

69
cron.md
View File

@ -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
* * * * * command to be executed ```
┬ ┬ ┬ ┬ ┬ Min Hour Day Mon Weekday
│ │ │ │ │ ```
│ │ │ │ │ {: .-setup}
│ │ │ │ └───── day of week (0 - 6) (0 or 6 are Sunday to Saturday, or use names)
│ │ │ └────────── month (1 - 12) ```
│ │ └─────────────── day of month (1 - 31) * * * * * command to be executed
│ └──────────────────── 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 ### 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
echo "@reboot echo hi" | crontab
```
# Adding tasks easily ```bash
echo "@reboot echo hi" | crontab # Open in editor
crontab -e
```
# Open in editor ```bash
crontab -e # List tasks
crontab -l [-u user]
# List tasks ```
crontab -l [-u user]

View File

@ -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
``` ```