Solved

Need help with Perl log file rotator

Posted on 2008-10-28
1
724 Views
Last Modified: 2011-12-20
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.


0
Comment
Question by:l1nuxxx
1 Comment
 
LVL 39

Accepted Solution

by:
Adam314 earned 500 total points
ID: 22822757
This sounds like a homework assignment.  Experts are not allowed to do your homework for you, but we can help.

What do you have so far?  
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now