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)]
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 2 (text/html, inline)]
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 7 years and 231 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.