Link to home
Start Free TrialLog in
Avatar of l1nuxxx
l1nuxxx

asked on

Need help with Perl log file rotator

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:

messages
messages.1
messages.2
messages.3
messages.4

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.


ASKER CERTIFIED SOLUTION
Avatar of Adam314
Adam314

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial