Logfile rotation sciprt using perl.

Reply

Join Date: Aug 2009
Posts: 9
Reputation: DemonixXV2 is an unknown quantity at this point 
Solved Threads: 0
DemonixXV2 DemonixXV2 is offline Offline
Newbie Poster

Logfile rotation sciprt using perl.

 
-1
  #1
Aug 23rd, 2009
I'm trying to find or create a Perl script that:
Checks for and creates these files:

notes
notes.1
notes.2
notes.3
notes.4

The first represents the current log file and the others are older versions. Each time the script runs it would check for the existence of notes.3 and, if it exists, move it to notes.4. Then is should check for notes.2 and move it to notes.3 and so on, until notes is moved to notes.1.

I've looked on the net already, but they're just too complex and try to do too much compared to my requirements.

Does anyone know of a script that does this, or do you have any code that could be adapted easily?

Thanks!
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 898
Reputation: KevinADC has a spectacular aura about KevinADC has a spectacular aura about 
Solved Threads: 67
KevinADC's Avatar
KevinADC KevinADC is offline Offline
Practically a Posting Shark

Re: Logfile rotation sciprt using perl.

 
0
  #2
Aug 23rd, 2009
You should just append a date to the end of the log file then you don't need to rename all the other files every time the script runs.
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 9
Reputation: DemonixXV2 is an unknown quantity at this point 
Solved Threads: 0
DemonixXV2 DemonixXV2 is offline Offline
Newbie Poster

Re: Logfile rotation sciprt using perl.

 
0
  #3
Aug 24th, 2009
Yeah, but I need a script, since I'll be needing it multiple times with different files. Since I'll be creating a library file with the code.
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 898
Reputation: KevinADC has a spectacular aura about KevinADC has a spectacular aura about 
Solved Threads: 67
KevinADC's Avatar
KevinADC KevinADC is offline Offline
Practically a Posting Shark

Re: Logfile rotation sciprt using perl.

 
0
  #4
Aug 24th, 2009
You already got a script on another forum so I will drop out of this thread
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 9
Reputation: DemonixXV2 is an unknown quantity at this point 
Solved Threads: 0
DemonixXV2 DemonixXV2 is offline Offline
Newbie Poster

Re: Logfile rotation sciprt using perl.

 
0
  #5
Aug 24th, 2009
Yep I managed to get one working , thxz for your effort anyways; thxz.
Last edited by DemonixXV2; Aug 24th, 2009 at 3:13 pm.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC