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

From: "Peter Moylan" <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: Sun, 12 Oct 2025 17:23:58 +1100
To: eCS ISP Mailing List <ecs-isp@2rosenthals.com>

On 10/10/25 01:18, Massimo S. wrote:
Hi all,

anyone have a good application or script to rotate files older than a
number of days and that create a zip file with the date in the
filename of the archive?

I don't find anything on hobbes.

The script
      http://www.pmoylan.org/pages/os2/waccess.html#movelog
does most of what you want. It adds the date to the filename and then
moves the log file to a subdirectory "Logs". I use the "schedule"
feature of DragText to run it once a day, but you could also schedule it
with something like cron.

As written, it archives the file called WEASEL.LOG, but it's obvious how
to change that in the script.

The feature that is missing is that it doesn't delete old archived
files. If you read the Rexx script, though, you'll find that it is very
simple code, and you could easily modify it to compare the file date
with the current date (these are very simple operations in Rexx), and
delete any file that is more than X days old.

--
Peter Moylan                  peter@pmoylan.org
http://www.pmoylan.org

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