Re: Fill a disk with more recent files
- In reply to: Lowell Gilbert : "Re: Fill a disk with more recent files"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 28 Apr 2022 20:19:07 UTC
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/ ---------------------------------------------------------------------------