Question: 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.

  1. The script must be a single file.
  2. Script must rotate /var/log/messages
  3. Archived log files should be date+timestamped and compressed in a .tar.gz
  4. Rotation should occur every hour on the hour.
  5. Files older than 7 hours should be deleted.
  6. Permissions for the archived files should be root rw-rr
  7. The group should be root:nobody
  8. Every command in the script should be explained in a comment.
  9. Cannot use the logrotate command, logrotated, or any log rotation software.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!