1. Engineering
  2. Computer Science
  3. i need to write a shell log rotation script the...

Question: i need to write a shell log rotation script the...

Question details

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-r—r—
  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.
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution