Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Apr 2022 16:19:07 -0400
From:      Peter Beckman <beckman@angryox.com>
To:        Lowell Gilbert <freebsd-ports-local@be-well.ilk.org>
Cc:        Andrea Venturoli <ml@netfence.it>, freebsd-ports@freebsd.org
Subject:   Re: Fill a disk with more recent files
Message-ID:  <6af4e90-f1f4-23de-51f5-7e6c8b71363@angryox.com>
In-Reply-To: <444k2dyy9u.fsf@be-well.ilk.org>
References:  <b92d3ed6-0ea4-ff05-b53c-4427c6234eeb@netfence.it> <c54145c-ab5-9739-a75-e313776b4c7e@angryox.com> <444k2dyy9u.fsf@be-well.ilk.org>

next in thread | previous in thread | raw e-mail | index | archive | help
True, but it doesn't sort by date, which is what the OP wanted: to copy the
files from newest to oldest, not just all the files newer than a date,
until the disk was full.

A combo of `ls` and `sort` to get the files on disk sorted by date
(created/modified/accessed, your choice) into a file, then passing that
file full of file paths to another app to copy, such as `xargs -n 50`
combined with `rsync` or even just `cp` or `scp` should get the ball
rolling.

Beckman

On Thu, 28 Apr 2022, Lowell Gilbert wrote:

> Peter Beckman <beckman@angryox.com> writes:
>
>> find doesn't have any sorting.
>
> Maybe not, but find does have "-newer", which do what the OP actually
> wants with the assistance of an appropriate timestamp file.
>
>

---------------------------------------------------------------------------
Peter Beckman                                                  Internet Guy
beckman@angryox.com                                https://www.angryox.com/
---------------------------------------------------------------------------



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6af4e90-f1f4-23de-51f5-7e6c8b71363>