I'd like to know, which files/directories have been created in a certain time frame (e.g. the last 7 days) that have contributed significantly to an increase in disk usage.
Output similar to
du /root -ah --max-depth 2 --time
would be sufficient, e.g.
$ show-disk-usage /root --since 2020-12-01 --till now --max-depth 2 1,1M 2020-12-01 03:41 /root/dir1/sub1 2,0M 2020-12-12 05:46 /root/dir1/sub2 3,2M 2020-12-09 17:01 /root/dir1/file 6,3M 2020-12-12 05:46 /root/dir1 1,1M 2020-12-01 03:41 /root/dir2/sub1 2,0M 2020-12-10 21:30 /root/dir2/sub2 3,2M 2020-12-09 17:01 /root/dir2/file 6,3M 2020-12-10 21:30 /root/dir2 12,6M 2020-12-12 05:46 /root
with the 3 columns
disk-usage-sum-of-modified-files last-modification-time file-or-directory-path
du only the files in the given time frame should be shown and added to the sum of their directory.
E.g. a file
/root/dir1/file2 modified on
2020-08-01 12:01 of size
9,8M should not change the output of the example given above.
Bonus: An option
du --threshold 1M would be great to get only files that contributed significantly to an increase in disk usage. However, this option should not change the sum of the directory, since smaller files may accumulate to consume a large amount of disk space.
Bonus 2: Instead of modification time it may be better to use creation time of files, since a small change of a large file may not be what you are looking for. Options
--modified-till would be an improvement.
Note: The solution does not have to be a command line application.