I'm trying to find or create a Perl script 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 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?


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.

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.

You already got a script on another forum so I will drop out of this thread

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