Skip to content

3.4 Logs and Monitoring

Systemd collects logs in a central journal.

# View all logs (scrollable)
journalctl

# tails: View latest logs and follow new ones (like tail -f)
journalctl -f

# Filter by service unit
journalctl -u nginx

# Filter by priority (e.g., Error)
journalctl -p err

# Filter by time
journalctl --since "1 hour ago"

Many applications still modify plain text files in /var/log.

  • /var/log/syslog or /var/log/messages: General system log.
  • /var/log/auth.log or /var/log/secure: Authentication/SSH logs.
  • /var/log/dmesg: Kernel buffer (boot messages).

The cron daemon runs tasks at specific times.

  • crontab -e: Edit current user’s cron table.
  • crontab -l: List tasks.

Format: m h dom mon dow command

# Run backup.sh every day at 3:30 AM
30 03 * * * /home/user/scripts/backup.sh