Recall & Review
beginner
What is the main purpose of a log rotation script?
A log rotation script automatically renames, compresses, or deletes old log files to save disk space and keep logs organized.
Click to reveal answer
beginner
In a log rotation script, why do we compress old log files?
Compressing old log files reduces their size, saving disk space while keeping the logs accessible if needed.
Click to reveal answer
beginner
What does the command
mv logfile logfile.1 do in a log rotation script?It renames the current log file to
logfile.1, marking it as the first rotated log file.Click to reveal answer
beginner
Why is it important to create a new empty log file after rotating the old one?
Creating a new empty log file allows the system or application to continue writing logs without interruption.
Click to reveal answer
beginner
What does the
gzip command do in the context of log rotation?The
gzip command compresses the rotated log file to save disk space.Click to reveal answer
What is the first step in a basic log rotation script?
✗ Incorrect
The first step is to rename the current log file to mark it as rotated.
Why do we create a new empty log file after rotating?
✗ Incorrect
A new empty log file is needed so the system can keep writing logs.
Which command compresses a file in a log rotation script?
✗ Incorrect
The gzip command compresses files to save space.
What happens if you don’t rotate logs regularly?
✗ Incorrect
Without rotation, logs grow and can fill disk space.
Which command renames a file in bash?
✗ Incorrect
The mv command renames or moves files.
Explain the steps involved in a simple log rotation script.
Think about how to keep logs organized and save space.
You got /3 concepts.
Why is log rotation important for system maintenance?
Consider what happens if logs grow without limit.
You got /3 concepts.