dust icon indicating copy to clipboard operation
dust copied to clipboard

Filter by file age

Open MolbioUnige opened this issue 2 years ago • 1 comments

I am looking for a way to take in account only files that are older then a given value. Would that be possible to implement?

In my institue, people are making experiments that weight a few terabytes each. People are required to remove their data once their treatment is completed, but some tend to forget. So, I'd like to find a way to find who is sitting on old stuff and thus preventing other users to use the servers.

MolbioUnige avatar Oct 31 '23 06:10 MolbioUnige

That is an interesting idea,

It should be possible to implement. I'll leave this issue open

bootandy avatar Nov 06 '23 22:11 bootandy

Hi, As I've last checked with the master branch. This hasn't been implemented yet and I'm interested in helping out if that's OK. I'm fairly new to Rust and so I apologize beforehand but I've got a couple of questions.

  • Should this filtering happen in file walking stage? (like in ignore_file which takes some filtering (e.g. regex) into account)

  • Or is it better to apply it when extracting DisplayNode from Nodes?

I think the latter might be more beneficial since It can also address #385 by building the heap based on age instead of size.

smf8 avatar May 10 '24 08:05 smf8

That's a good question.

In this case with a hard limit I would say: this filtering happen in file walking stage (probably).

However it might be fun to try it both ways.

For https://github.com/bootandy/dust/issues/385 however it would probably come from when: extracting DisplayNode from Nodes. Even thought the tasks sound similar they might not be in code.

I'm not sure of the above myself yet though, so I may well change my mind!

bootandy avatar May 11 '24 09:05 bootandy

Hello, I'm fairly new to Rust and so I apologize beforehand but I've got a couple of questions. I am trying to deal with this problem, but I encountered a problem

  • how to filter according to the time corresponding to the input, is it to filter the files of those days according to the sign of the input integer value like Linux find, or is it to input What about a format like --mtime '+2023-10-04 05:34:00'? Or what about epoch-based time like --mtime +1695276503?

In other words, is it better to use relative time, absolute time, or epoch-based time as input?

wugeer avatar May 16 '24 01:05 wugeer

Hey, I had an idea,

Consider supporting suffix-parsing for the duration for example:

  • 30s for 30 seconds
  • 5m for 5 minutes
  • 2h for 2 hours
  • and maybe even 2day4hours

This way it will be much more intuitive and powerful.

codeswhite avatar May 26 '24 22:05 codeswhite