From: "Lewis G Rosenthal" Received: from [50.73.8.217] (account lgrosenthal@2rosenthals.com HELO [192.168.200.18]) by 2rosenthals.com (CommuniGate Pro SMTP 5.4.10) with ESMTPSA id 3750168 for ecs-isp@2rosenthals.com; Wed, 25 May 2022 10:10:58 -0400 Subject: Re: [eCS-ISP] rotating old files with rsync To: eCS ISP Mailing List References: Organization: Rosenthal & Rosenthal, LLC Message-ID: <628E38F2.3030802@2rosenthals.com> Date: Wed, 25 May 2022 10:10:58 -0400 User-Agent: Mozilla/5.0 (OS/2; Warp 4.5; rv:38.0) Gecko/20100101 Firefox/38.0 SeaMonkey/2.35 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit On 05/25/22 07:39 am, Massimo S. wrote: > Hi all, > > is there a way to rotate files older than 365 days (1 year) with rsync? > > i've found this on the internet > > find /home/nkumar/eur/ -type f -mtime +7 -printf %P\\0 | rsync > --files-from=- --from0 /home/nkumar/eur/ /home/nkumar/chk/ > --remove-sent-files > > but i guess it will not work on eCS/AOS > Why not? > any idea? > > at the moment i'm using a rexx that moves files older than 1year to a 2nd > partition > but when this server will be moved inside a VM i can't use anymore this > procedure > since i don't want the VM size to grow too much > > what i'd need is to use rsync from another server (on bare metal) that > moves older > than 1 year files to a removable drive > If you run the above from sh (assuming sh is symlinked or otherwise pointed to dash), I don't see a particular reason why the above wouldn't work, or the suggestion here: https://unix.stackexchange.com/questions/543313/rsync-combined-with-find-and-mtime Our findutils find supports mtime, so unless there is a specific error being returned on the command line (for rsync, try the dry-run option to test), I don't see what would not work. -- Lewis ------------------------------------------------------------- Lewis G Rosenthal, CNA, CLP, CLE, CWTS, EA Rosenthal & Rosenthal, LLC www.2rosenthals.com visit my IT blog www.2rosenthals.net/wordpress -------------------------------------------------------------