-1

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!

2
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by DemonixXV2
0

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.

0

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.

0

Yep I managed to get one working , thxz for your effort anyways; thxz.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.