Re: Fill a disk with more recent files

2022-04-28 Thread Peter Beckman
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

Re: Fill a disk with more recent files

2022-04-28 Thread Lowell Gilbert
Peter Beckman 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.

Re: Fill a disk with more recent files

2022-04-27 Thread Peter Beckman
I feel like `ls` or `find` and some creative sorting after the fact would do it. ls -laRrt sort of works, but it doesn't output subdirectory files in order. find doesn't have any sorting. You could use the `ls` flag `-D format`: When printing in the long (-l) format, use format to form

Re: Fill a disk with more recent files

2022-04-27 Thread Sysadmin Lists
o remove leading paths on target done There are advantages and disadvantages to each. > > From: Andrea Venturoli > Sent: Wed Apr 27 09:47:40 CEST 2022 > To: > Subject: Fill a disk with more recent files > > > > Hello. > > Supp

Re: Fill a disk with more recent files

2022-04-27 Thread Andrea Venturoli
On 4/27/22 18:29, Guido Falsi wrote: net/unison has options to check same named files and keep the most recent one Thanks, but this is not what I need. I mean, unless I understood wrong, unison will intelligently copy everything, as rsync does. I only need a partial copy (up to a space full

Re: Fill a disk with more recent files

2022-04-27 Thread Andrea Venturoli
On 4/27/22 17:11, Chris wrote: On 2022-04-27 00:47, Andrea Venturoli wrote: Hello. Suppose I have a large storage of files and a smaller disk (backup). I need to copy as much as I can from source to target and I want the most recent files. Before I start scripting and reinvent the wheel, i

Re: Fill a disk with more recent files

2022-04-27 Thread Chris
On 2022-04-27 00:47, Andrea Venturoli wrote: Hello. Suppose I have a large storage of files and a smaller disk (backup). I need to copy as much as I can from source to target and I want the most recent files. Before I start scripting and reinvent the wheel, is there some tool already? If I'm

Re: Fill a disk with more recent files

2022-04-27 Thread Andrea Venturoli
On 4/27/22 11:50, Tomek CEDRO wrote: If you want to enforce particular sort order you will have to call rsync from another tool. Probably ls / find, sort, then rsync, maybe a dedicated Python script. Sure, this was what I was thinking. I just wanted to avoid doing this if it already existed.

Re: Fill a disk with more recent files

2022-04-27 Thread Tomek CEDRO
On Wed, Apr 27, 2022 at 10:09 AM Andrea Venturoli wrote: > On 4/27/22 09:51, Tomek CEDRO wrote: > > On Wed, Apr 27, 2022 at 9:48 AM Andrea Venturoli wrote: > >> Hello. > >> Suppose I have a large storage of files and a smaller disk (backup). > >> I need to copy as much as I can from source to tar

Re: Fill a disk with more recent files

2022-04-27 Thread Andrea Venturoli
On 4/27/22 09:51, Tomek CEDRO wrote: On Wed, Apr 27, 2022 at 9:48 AM Andrea Venturoli wrote: Hello. Suppose I have a large storage of files and a smaller disk (backup). I need to copy as much as I can from source to target and I want the most recent files. Before I start scripting and reinven

Re: Fill a disk with more recent files

2022-04-27 Thread Tomek CEDRO
On Wed, Apr 27, 2022 at 9:48 AM Andrea Venturoli wrote: > Hello. > Suppose I have a large storage of files and a smaller disk (backup). > I need to copy as much as I can from source to target and I want the > most recent files. > Before I start scripting and reinvent the wheel, is there some tool

Fill a disk with more recent files

2022-04-27 Thread Andrea Venturoli
Hello. Suppose I have a large storage of files and a smaller disk (backup). I need to copy as much as I can from source to target and I want the most recent files. Before I start scripting and reinvent the wheel, is there some tool already? bye & Thanks av.