From: "Massimo S." Received: from [192.168.100.201] (HELO mail.2rosenthals.com) by 2rosenthals.com (CommuniGate Pro SMTP 5.4.10) with ESMTP id 14422700 for ecs-isp@2rosenthals.com; Tue, 14 Oct 2025 03:31:39 -0400 Received: from [192.168.200.201] (port=58668 helo=mail2.2rosenthals.com) by mail.2rosenthals.com with esmtp (Exim 4.98.2) (envelope-from ) id 1v8ZVK-0000000029e-0zAT for ecs-isp@2rosenthals.com; Tue, 14 Oct 2025 03:31:32 -0400 Received: from mail2.quasarbbs.net ([80.86.52.115]:10162) by mail2.2rosenthals.com with esmtp (Exim 4.98.2) (envelope-from ) id 1v8ZVF-000000002xr-0CJx for ecs-isp@2rosenthals.com; Tue, 14 Oct 2025 03:31:25 -0400 X-SASI-Hits: BODYTEXTP_SIZE_3000_LESS 0.000000, BODY_SIZE_2000_2999 0.000000, BODY_SIZE_5000_LESS 0.000000, BODY_SIZE_7000_LESS 0.000000, CTE_8BIT 0.000000, DKIM_ALIGNS 0.000000, DKIM_SIGNATURE 0.000000, HTML_00_01 0.050000, HTML_00_10 0.050000, IN_REP_TO 0.000000, LEGITIMATE_SIGNS 0.000000, MSGID_SAMEAS_FROM_HEX_844412 0.100000, MSG_THREAD 0.000000, NO_CTA_URI_FOUND 0.000000, NO_URI_HTTPS 0.000000, REFERENCES 0.000000, REPLYTO_SAMEAS_FROM 0.000000, SENDER_NO_AUTH 0.000000, SUSP_DH_NEG 0.000000, TO_IN_SUBJECT 0.500000, USER_AGENT 0.000000, __ANY_URI 0.000000, __BODY_NO_MAILTO 0.000000, __BOUNCE_CHALLENGE_SUBJ 0.000000, __BOUNCE_NDR_SUBJ_EXEMPT 0.000000, __CT 0.000000, __CTE 0.000000, __CT_TEXT_PLAIN 0.000000, __DKIM_ALIGNS_1 0.000000, __DKIM_ALIGNS_2 0.000000, __DQ_NEG_DOMAIN 0.000000, __DQ_NEG_HEUR 0.000000, __DQ_NEG_IP 0.000000, __FORWARDED_MSG 0.000000, __FRAUD_COMMON 0.000000, __FRAUD_MONEY_CURRENCY 0.000000, __FRAUD_MONEY_CURRENCY_DOLLAR 0.000000, __FRAUD_PARTNERSHIP 0.000000, __FRAUD_REPLY 0.000000, __FROM_DOMAIN_NOT_IN_BODY 0.000000, __FROM_NAME_NOT_IN_ADDR 0.000000, __FROM_NAME_NOT_IN_BODY 0.000000, __FUR_HEADER 0.000000, __HAS_FROM 0.000000, __HAS_MSGID 0.000000, __HAS_REFERENCES 0.000000, __HAS_REPLYTO 0.000000, __HEADER_ORDER_FROM 0.000000, __IN_REP_TO 0.000000, __IOC_PHRASE 0.000000, __MAIL_CHAIN 0.000000, __MIME_BOUND_CHARSET 0.000000, __MIME_TEXT_ONLY 0.000000, __MIME_TEXT_P 0.000000, __MIME_TEXT_P1 0.000000, __MIME_VERSION 0.000000, __MOZILLA_USER_AGENT 0.000000, __MSGID_HEX_844412 0.000000, __NO_HTML_TAG_RAW 0.000000, __PHISH_SPEAR_SUBJ_SUBJECT 0.000000, __REFERENCES 0.000000, __REPLYTO_SAMEAS_FROM_ACC 0.000000, __REPLYTO_SAMEAS_FROM_ADDY 0.000000, __REPLYTO_SAMEAS_FROM_DOMAIN 0.000000, __SANE_MSGID 0.000000, __SCAN_D_NEG 0.000000, __SCAN_D_NEG2 0.000000, __SCAN_D_NEG_HEUR 0.000000, __SCAN_D_NEG_HEUR2 0.000000, __SUBJ_ALPHA_END 0.000000, __SUBJ_ALPHA_NEGATE 0.000000, __SUBJ_REPLY 0.000000, __TO_IN_SUBJECT 0.000000, __TO_MALFORMED_2 0.000000, __TO_NAME 0.000000, __TO_NAME_DIFF_FROM_ACC 0.000000, __TO_REAL_NAMES 0.000000, __URI_MAILTO 0.000000, __URI_NO_WWW 0.000000, __URI_NS 0.000000, __USER_AGENT 0.000000 X-SASI-Probability: 10% X-SASI-RCODE: 200 X-SASI-Version: Antispam-Engine: 5.1.4, AntispamData: 2025.10.14.65719 X-SASI-Hits: BODYTEXTP_SIZE_3000_LESS 0.000000, BODY_SIZE_2000_2999 0.000000, BODY_SIZE_5000_LESS 0.000000, BODY_SIZE_7000_LESS 0.000000, CTE_8BIT 0.000000, DKIM_ALIGNS 0.000000, DKIM_SIGNATURE 0.000000, HTML_00_01 0.050000, HTML_00_10 0.050000, IN_REP_TO 0.000000, LEGITIMATE_SIGNS 0.000000, MSGID_SAMEAS_FROM_HEX_844412 0.100000, MSG_THREAD 0.000000, NO_CTA_URI_FOUND 0.000000, NO_URI_HTTPS 0.000000, REFERENCES 0.000000, REPLYTO_SAMEAS_FROM 0.000000, SUSP_DH_NEG 0.000000, TO_IN_SUBJECT 0.500000, USER_AGENT 0.000000, __ANY_URI 0.000000, __AUTH_RES_PASS 0.000000, __BODY_NO_MAILTO 0.000000, __BOUNCE_CHALLENGE_SUBJ 0.000000, __BOUNCE_NDR_SUBJ_EXEMPT 0.000000, __CT 0.000000, __CTE 0.000000, __CT_TEXT_PLAIN 0.000000, __DKIM_ALIGNS_1 0.000000, __DKIM_ALIGNS_2 0.000000, __DQ_NEG_DOMAIN 0.000000, __DQ_NEG_HEUR 0.000000, __DQ_NEG_IP 0.000000, __FORWARDED_MSG 0.000000, __FRAUD_COMMON 0.000000, __FRAUD_MONEY_CURRENCY 0.000000, __FRAUD_MONEY_CURRENCY_DOLLAR 0.000000, __FRAUD_PARTNERSHIP 0.000000, __FRAUD_REPLY 0.000000, __FROM_DOMAIN_NOT_IN_BODY 0.000000, __FROM_NAME_NOT_IN_ADDR 0.000000, __FROM_NAME_NOT_IN_BODY 0.000000, __FUR_HEADER 0.000000, __HAS_FROM 0.000000, __HAS_MSGID 0.000000, __HAS_REFERENCES 0.000000, __HAS_REPLYTO 0.000000, __HEADER_ORDER_FROM 0.000000, __IN_REP_TO 0.000000, __IOC_PHRASE 0.000000, __MAIL_CHAIN 0.000000, __MIME_BOUND_CHARSET 0.000000, __MIME_TEXT_ONLY 0.000000, __MIME_TEXT_P 0.000000, __MIME_TEXT_P1 0.000000, __MIME_VERSION 0.000000, __MOZILLA_USER_AGENT 0.000000, __MSGID_HEX_844412 0.000000, __NO_HTML_TAG_RAW 0.000000, __PHISH_SPEAR_SUBJ_SUBJECT 0.000000, __REFERENCES 0.000000, __REPLYTO_SAMEAS_FROM_ACC 0.000000, __REPLYTO_SAMEAS_FROM_ADDY 0.000000, __REPLYTO_SAMEAS_FROM_DOMAIN 0.000000, __SANE_MSGID 0.000000, __SCAN_D_NEG 0.000000, __SCAN_D_NEG2 0.000000, __SCAN_D_NEG_HEUR 0.000000, __SCAN_D_NEG_HEUR2 0.000000, __SUBJ_ALPHA_END 0.000000, __SUBJ_ALPHA_NEGATE 0.000000, __SUBJ_REPLY 0.000000, __TO_IN_SUBJECT 0.000000, __TO_MALFORMED_2 0.000000, __TO_NAME 0.000000, __TO_NAME_DIFF_FROM_ACC 0.000000, __TO_REAL_NAMES 0.000000, __URI_MAILTO 0.000000, __URI_NO_WWW 0.000000, __URI_NS 0.000000, __USER_AGENT 0.000000 X-SASI-Probability: 10% X-SASI-RCODE: 200 X-SASI-Version: Antispam-Engine: 5.1.4, AntispamData: 2025.10.14.65719 DKIM-Signature: v=1; q=dns/txt; a=rsa-sha256; c=relaxed/relaxed; s=default; d=ecomstation.it; bh=T30qTRS0o/Hf44dcAuz1dhqcjJ68XiW7SwI62fkOcnQ=; h=Return-Path:From:To:Subject:Date:Message-ID; b=KHbbKd3fMMgUeZiOPOGe3bvXXRbSOP6Csy5dXOLsbwx0RPw+RljQoXsORt5YZn7fceL5/ bIvEE9yEAO0LDQImj8c7MVBza1QBHDJsE2giYyoIM0MeLqtOY8m2y688yxiqeo24JZ28rvs p2xZ7mTNOinpQzS3cOUe7c4vJ5pezrgZN0GQ3uOcTYMRu4DeQAOfgVk7OAgkx2e+SOqcU6x 2BLHev7b/YxYjm5TVd1gJEi59N9Ez+Wx6yYNg852jSUn7C4n5+12H3hQjkxieVjUC6dQ7FZ WFd+67/pWQ5ujpsdujuq0JrJZBifUAv3FdF7ZgrE253/rC6Pe1rLeESB/prg== Received: from [192.168.10.199] (dtp [192.168.10.199]) by srv2 (Weasel v3.08) for ; Tue, 14 Oct 2025 09:31:24 -0000 Reply-To: ml@ecomstation.it Subject: Re: [eCS-ISP] script to rotate logs, old mails etc. and create a dated zip To: eCS ISP Mailing List References: Organization: Massimo S. Message-ID: <4d39c3c5-a2f4-3ef1-f012-f3616870abe2@ecomstation.it> Date: Tue, 14 Oct 2025 09:31:19 +0200 User-Agent: Mozilla/5.0 (OS/2; U; Warp 4.5; it-IT; rv:1.7.13) Gecko/20060424 Thunderbird/1.0.8 Mnenhy/0.7.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: it Content-Transfer-Encoding: 8bit Il 14/10/2025 09:15, Peter Moylan ha scritto: > On 14/10/25 16:06, Steven Levine wrote: >> In , on 10/12/25 >>     at 10:30 PM, "Ian Manners" 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