Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need to write a shell log rotation script. The requirements are below. The script must be a single file. Script must rotate /var/log/messages Archived
I need to write a shell log rotation script. The requirements are below.
- The script must be a single file.
- Script must rotate /var/log/messages
- Archived log files should be date+timestamped and compressed in a .tar.gz
- Rotation should occur every hour on the hour.
- Files older than 7 hours should be deleted.
- Permissions for the archived files should be root rw-rr
- The group should be root:nobody
- Every command in the script should be explained in a comment.
- Cannot use the logrotate command, logrotated, or any log rotation software.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started