Subject: bug#28657: closed (Re: bug#28657: Random sort-order in du)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 30 Sep 2017 21:46:03 +0000

Your bug report

#28657: Random sort-order in du

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
28657: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=28657
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#28657: Random sort-order in du
From: Assaf Gordon <[email-masked]>
To: Holger Klene <[email-masked]>
Cc: [email-masked]
Date: Sat, 30 Sep 2017 15:45:49 -0600
List-Id: <debbugs-submit.debbugs.gnu.org>

tag 28657 notabug
stop

Hello,

On 2017-09-30 03:41 PM, Holger Klene wrote:
> * Assaf Gordon <[email-masked]> [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

Subject: Random sort-order in du
From: Holger Klene <[email-masked]>
To: [email-masked]
Date: Sat, 30 Sep 2017 22:45:24 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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