Archivovaná správa #1241 diskusnej skupiny ecs-isp@2rosenthals.com

Od: "Steven Levine" <ecs-isp@2rosenthals.com> Celá hlavi?ka
Nedekódovaná správa
Hlavi?ka: Re: [eCS-ISP] script to rotate logs, old mails etc. and create a dated zip
Dátum: Mon, 13 Oct 2025 21:06:46 -0800
Komu: "eCS ISP Mailing List" <ecs-isp@2rosenthals.com>

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.

Steven

--
----------------------------------------------------------------------
"Steven Levine" <steve53@earthlink.net>  Warp/DIY/BlueLion etc.
www.scoug.com www.arcanoae.com www.warpcave.com
----------------------------------------------------------------------


Prihlási?: Nap??a?, Súhrn, Index.
Odhlási?
Mail na ListMastera