Need help with Perl log file rotator
Posted on 2008-10-28
Need help with the following task.
In this objective we will create a log file rotator. First, create a fake log file in your home directory on the hottub called messages. This will be used to simulate the real /var/log/messages. Write a script called obj14-1.pl that checks for and creates these files:
The first represents the current log file and the others are older versions. Each time the script runs it should check for the existence of messages.3 and, if it exists, move it to messages.4. Then is should check for messages.2 and move it to messages.3 and so on, until messages is moved to messages.1.