Organizing AlmaLinux's operational foundations: the journald and rsyslog log flow with logrotate, accurate time synchronization via chrony, plus automatic task scheduling with cron and systemd timers, and boot speed analysis with systemd-analyze.

In the previous episode, Episode 11, we observed the system with Cockpit and monitoring commands. Now we organize three operational foundations that are often underestimated even though they determine success in the field: logging (the system's trail), time sync (time accuracy), and automation (repetitive work without humans).
A server with messy logs, a drifting clock, and manual tasks is an operations nightmare. This episode tidies up all three.
In episode 7 we got to know journald as systemd's main logger. However, AlmaLinux also runs rsyslog — the traditional logging daemon that writes logs to text files in /var/log/. The two coexist: journald stores structured logs, rsyslog writes to classic files.
| File | Contents |
|---|---|
/var/log/messages | General system messages |
/var/log/secure | Security events: logins, sudo, sshd |
/var/log/cron | Scheduled task execution |
/var/log/dnf5.log | Package manager transaction trail |
sudo tail -n 20 /var/log/secureFor specific services, you can redirect logs from journald to text files — useful when integrating with systems that only read files:
:programname, isequal, "myapp" /var/log/myapp.log
& stopThis line tells rsyslog to write all messages from the myapp program to a dedicated file, then stop processing. After adding the file, restart rsyslog.
Logs grow out of control if left unchecked. logrotate automates rotation: moving old logs, compressing them, and keeping a set number.
/var/log/myapp.log {
daily
rotate 7
compress
missingok
notifempty
}This pattern rotates the log daily, keeps the last 7 files, and compresses them. The default configuration is in /etc/logrotate.conf, and per-service files go in /etc/logrotate.d/. Test rotation without waiting for the schedule:
sudo logrotate -d /etc/logrotate.d/myappAccurate time is an absolute requirement of modern servers: cross-host logs can be compared, TLS certificates stay valid, and database replication runs correctly. AlmaLinux uses chrony as its NTP client.
timedatectl
chronyc trackingTime servers are configured in /etc/chrony.conf:
pool 2.pool.ntp.org iburst
makestep 1 3
rtcsyncpool ... iburst pulls time from several servers at once, makestep allows time jumps at startup, and rtcsync syncs the hardware clock. Restart after changing:
sudo systemctl restart chronyd
chronyc sourcesTip
For servers without internet access, run chrony in server mode itself (allow in the configuration) so other machines on the network can sync their time from it. This is a common pattern in labs and isolated internal networks.
Routine tasks like backups and log rotation shouldn't depend on humans. Three scheduling mechanisms are available on AlmaLinux.
cron is the classic scheduler. Every user has a crontab:
crontab -eThe cron format has five columns: minute hour day-of-month month day-of-week command:
0 2 * * * /usr/local/bin/backup.sh
30 1 * * 0 dnf5 autoremoveCron doesn't run tasks missed while the system was off. anacron closes this gap — it makes sure scheduled tasks still run after the system comes back up, even if late. On AlmaLinux, cron and anacron run together to handle daily/weekly tasks.
Systemd provides modern scheduling via timer units — with advantages: integration with service units, unified logging in journald, and the ability to catch up on missed tasks.
[Unit]
Description=Daily backup
[Timer]
OnCalendar=daily
Persistent=true
[Install]
WantedBy=timers.targetOnCalendar=daily runs it every day; Persistent=true runs tasks missed while the system was off. Pair it with a backup.service unit and enable:
sudo systemctl enable --now backup.timer
systemctl list-timersInfo
For new tasks, the modern preference is systemd timers over cron: you get centralized logs, unit management, and dependencies. Cron remains useful and widespread, so understand both.
Finally, a rarely explored diagnostic command: systemd-analyze. It measures boot time and finds services that slow down startup.
systemd-analyze
systemd-analyze blamesystemd-analyze shows the total boot time; blame sorts services by initialization time. Services taking a disproportionate amount of time are candidates for optimization — for example, delaying non-critical services so they don't compete at boot.
/etc/logrotate.d/.chronyc tracking regularly.Persistent=true in systemd timers or anacron for tasks that must still run.>> /var/log/task.log 2>&1) so errors are recorded.In this episode 12 you've organized AlmaLinux's operational foundations: the journald and rsyslog log flow with the /var/log/ hierarchy and logrotate, accurate time synchronization with chrony, automatic scheduling via cron, anacron, and systemd timers, and boot speed analysis with systemd-analyze.
Key takeaways:
/var/log/ like secure and messages./etc/logrotate.d/.chronyc tracking and chronyc sources.systemd-analyze blame finds services that slow down boot.A tidy operational foundation makes you ready to step into the security domain. In the next episode, Episode 13, we'll cover SELinux & Mandatory Access Control — the difference between MAC and DAC, enforcing, permissive, and disabled modes, reading and fixing contexts, booleans, and troubleshooting blocked services. See you there!