Mission 214

Logrotate dry run

Dry-run log rotation without moving files.

Text and logs
8 minutes Admin Lesson 214 of 360
logrotatefind
Lesson 214 of 360 0/360 lessons 0/17 missions Text and logs · 8 minutes
0%
Continue View profile
Ops lab terminal Training lab
New learnerrank 0XP 0%complete
learner@clairos:/home/learner $ Unix ops lab: type a command, press Enter
Instructions 8 minutes

Click any instruction for the command details, the why, and the common mistake to avoid.

Dry-run rotation

Run logrotate -d /etc/logrotate.d/nginx.

logrotate -d /etc/logrotate.d/nginx
Find rotated logs

Run find /var/log -name .1.

find /var/log -name .1
Read rotated access log

Run tail -n 2 /var/log/nginx-access.log.1.

tail -n 2 /var/log/nginx-access.log.1
Lesson support

What to notice while you play.

Objective

Dry-run log rotation without moving files.

Hint

Run the commands in order and compare the outputs.

Why it matters

Junior operators build confidence by gathering evidence before changing systems.

Common mistakes
  • Skipping the inspection step.
  • Assuming one command tells the whole story.
Reference

Commands in this lesson.

find [path] [-name text]

Search lab filesystem paths.

logrotate -d <config>

Dry-run a simulated log rotation config.