GNU bug report logs -
#28657
Random sort-order in du
Previous Next
Reported by: Holger Klene <h.klene <at> gmx.de>
Date: Sat, 30 Sep 2017 20:47:02 UTC
Severity: normal
Tags: notabug
Done: Assaf Gordon <assafgordon <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Sat, 30 Sep 2017 15:45:49 -0600
with message-id <44b57345-aae0-3be3-49e1-649334ff92da <at> gmail.com>
and subject line Re: bug#28657: Random sort-order in du
has caused the debbugs.gnu.org bug report #28657,
regarding Random sort-order in du
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
28657: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=28657
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
Hello!
I'm using Back-In-Time for backups. Out of curiosity, I wanted to know, how big the snapshots
are and came across the FAQ:
https://github.com/bit-team/backintime/wiki/FAQ#how-can-i-check-if-my-snapshots-are-incremental-using-hard-links
They recommend:
du -hd1 /media/<USER>/backintime/<HOST>/<USER>/1/
Say I have a subdirectory structure in that folder like this:
+ 2015
I + FileA 1GB Inode 123
+ 2016
I + FileA 1GB Inode 123
+ 2017
+ FileA 1GB Inode 123
Now du returns something like:
1G 2016
0G 2015
0G 2017
1G .
So the hardlinked FileA is reported only once (this is actually the desired feature, to not report it
thrice).
But now the order determines, which folder the size is reported against. But I had to learn, that
the order of items in the filesystem is unpredictable:
https://serverfault.com/questions/406229/ensuring-a-repeatable-directory-ordering-in-linux#answer-675748
I'd like to suggest to add some sort-controlling options known from ls --sort
The desired behavior in this case would be either alphabetical or reverse-alphabetical to
attribute the FileA to the first or last appearance in the tree respectively.
Thanxs
Holger
PS: coreutils 8.25 with ext4 file-system
--
|_|/ MfG
| |\ Holger Klene
PGP Key ID: 0x22FFE57E
[Message part 4 (text/html, inline)]
[signature.asc (application/pgp-signature, inline)]
[Message part 6 (message/rfc822, inline)]
tag 28657 notabug
stop
Hello,
On 2017-09-30 03:41 PM, Holger Klene wrote:
> * Assaf Gordon <assafgordon <at> gmail.com> [30.09.17 15:08]:
>> But if you use shell-globbing, the shell will automatically
>> order the directory alphabetically:
>
>> $ du -c -hd1 data/*
>
>
> Who would have thought of passing multiple directories ...
>
> This is the solution to my problem, though I better write it down to not
> forget, as I'm quite sure, I'll not remember it in a month :-)
>
Thank you for confirming.
I'm thus marking this bug report as "done", but discussion can continue
by replying to this thread.
regards,
- assaf
This bug report was last modified 7 years and 230 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.