Mailing List ecs-isp@2rosenthals.com Archived Message #1244

From: "Massimo S." <ecs-isp@2rosenthals.com> Full Headers
Undecoded message
Subject: Re: [eCS-ISP] script to rotate logs, old mails etc. and create a dated zip
Date: Tue, 14 Oct 2025 09:31:19 +0200
To: eCS ISP Mailing List <ecs-isp@2rosenthals.com>



Il 14/10/2025 09:15, Peter Moylan ha scritto:
On 14/10/25 16:06, Steven Levine wrote:
In <list-14421040@2rosenthals.com>, on 10/12/25
    at 10:30 PM, "Ian Manners" <ecs-isp@2rosenthals.com> said:

Hi all,

thanks, but i guess this script can't help me

What makes you say this?  Have you tried to edit the script as suggested?

It will, you simply have to modify it to your needs.

I agree.  As written, the script or a modified version will handle any log
file that is closed when the script runs.

There's a small window of time when the script will fail bacause because
weasel is appending weasel.$$$ to weasel.log.  A bit of error checking and
a retry should handle this.

Currently, the script is not capable of moving apache logs which are kept
open.

This requires a script that knows how to shut down and restart apache so
that the move can succeed.

I use the same script to archive *.log files for both weasel and
FTPServer, then delete the logs after. All you need to do is change
.'log'  to .'msg', the date part is already in the script, and becomes
part of the  archived filename.

I suspect Massimo wants to run the script for multiple .msg files.  This
will require simple modifications to the script so that the script does a
SysFileTree collect the names of the files to rename and wraps the rename
and move logic in a do loop.

Actually, what he wants is simpler than that. All that he needs is a
      "zip zipfile *.msg"
plus a rename of the zipfile to include a timestamp in the name. No loops needed.

A point worth making here is that Rexx is a very easy language to learn
and understand. Unless you're trying to do something complicated, you
don't need any great programming skills. Anyone who doesn't know Rexx
will find it worth the small effort needed to work out how to modify Rexx scripts.

I write my utility scripts in Rexx precisely because I know that people
are likely to have slightly different requirements from what the
original script does. Thus, I need something that's easy to modify. Rexx
is good for that.

Hi,

i do some simple rexx script, but i'm not so good..
I'm able to write a script that zip with the currentdate in the file name and zip all *.msg

but i need to do with files older that a number of days and also the original files
in the source dir must be deleted after the operation

i've a moveold.cmd script to move .msg older than 365 days to an offline dir
but i also need after to zip them and delete them in the offline dir

let me know if you are interested i can send you "moveold.cmd"

massimo


Subscribe: Feed, Digest, Index.
Unsubscribe
Mail to ListMaster