forked from GithubBackups/healthchecks
Docs: add the "Viewing cron logs using journalctl" section
This commit is contained in:
parent
ae578a29c2
commit
b4ba582255
@ -79,6 +79,9 @@ Transient error is a timeout or an HTTP 5xx response code.</dd>
|
||||
<dd>Redirect curl's stdout to /dev/null (error messages still go to stderr).</dd>
|
||||
</dl>
|
||||
<h2>Looking up Your Machine's Time Zone</h2>
|
||||
<p>If your cron job consistently pings SITE_NAME an hour early or an hour late,
|
||||
the likely cause is a timezone mismatch: your machine may be using a different timezone
|
||||
than what is configured on SITE_NAME.</p>
|
||||
<p>On modern GNU/Linux systems, you can look up the time zone using the
|
||||
<code>timedatectl status</code> command and looking for "Time zone" in its output:</p>
|
||||
<div class="text highlight"><pre><span></span><code>$ timedatectl status
|
||||
@ -91,3 +94,16 @@ Transient error is a timeout or an HTTP 5xx response code.</dd>
|
||||
NTP service: active
|
||||
RTC in local TZ: no
|
||||
</code></pre></div>
|
||||
|
||||
|
||||
<h2>Viewing cron logs using <code>journalctl</code></h2>
|
||||
<p>On a systemd-based system, you can use the <code>journalctl</code> utility to see system logs,
|
||||
including logs from the cron daemon.</p>
|
||||
<p>To see live logs:</p>
|
||||
<div class="bash highlight"><pre><span></span><code>journalctl -f
|
||||
</code></pre></div>
|
||||
|
||||
|
||||
<p>To see logs from e.g. the last hour, and only from the cron daemon:</p>
|
||||
<div class="bash highlight"><pre><span></span><code>journalctl --since <span class="s2">"1 hour ago"</span> -t CRON
|
||||
</code></pre></div>
|
@ -85,6 +85,10 @@ suit your needs.
|
||||
|
||||
## Looking up Your Machine's Time Zone
|
||||
|
||||
If your cron job consistently pings SITE_NAME an hour early or an hour late,
|
||||
the likely cause is a timezone mismatch: your machine may be using a different timezone
|
||||
than what is configured on SITE_NAME.
|
||||
|
||||
On modern GNU/Linux systems, you can look up the time zone using the
|
||||
`timedatectl status` command and looking for "Time zone" in its output:
|
||||
|
||||
@ -99,3 +103,20 @@ System clock synchronized: yes
|
||||
NTP service: active
|
||||
RTC in local TZ: no
|
||||
```
|
||||
|
||||
## Viewing cron logs using `journalctl`
|
||||
|
||||
On a systemd-based system, you can use the `journalctl` utility to see system logs,
|
||||
including logs from the cron daemon.
|
||||
|
||||
To see live logs:
|
||||
|
||||
```bash
|
||||
journalctl -f
|
||||
```
|
||||
|
||||
To see logs from e.g. the last hour, and only from the cron daemon:
|
||||
|
||||
```bash
|
||||
journalctl --since "1 hour ago" -t CRON
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user