GNU bug report logs - #49428
RFE: for --time have option to only include contents, not dir itself.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: coreutils; Severity: wishlist; Reported by: L A Walsh <coreutils@HIDDEN>; dated Tue, 6 Jul 2021 05:21:02 UTC; Maintainer for coreutils is bug-coreutils@HIDDEN.
Severity set to 'wishlist' from 'normal' Request was from Paul Eggert <eggert@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 49428 <at> debbugs.gnu.org:


Received: (at 49428) by debbugs.gnu.org; 6 Jul 2021 06:57:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 06 02:57:41 2021
Received: from localhost ([127.0.0.1]:47137 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m0f1Z-0004aW-Qe
	for submit <at> debbugs.gnu.org; Tue, 06 Jul 2021 02:57:41 -0400
Received: from ishtar.tlinx.org ([173.164.175.65]:54796
 helo=Ishtar.sc.tlinx.org) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <coreutils@HIDDEN>) id 1m0f1X-0004aO-Vr
 for 49428 <at> debbugs.gnu.org; Tue, 06 Jul 2021 02:57:40 -0400
Received: from [192.168.3.12] (Athenae [192.168.3.12])
 by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id
 1666vAbB085115; Mon, 5 Jul 2021 23:57:14 -0700
Message-ID: <60E3FEA5.9010309@HIDDEN>
Date: Mon, 05 Jul 2021 23:56:37 -0700
From: L A Walsh <coreutils@HIDDEN>
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version: 1.0
To: 49428 <at> debbugs.gnu.org, Coreutils <bug-coreutils@HIDDEN>
Subject: Re: bug#49428: RFE: for --time have option to only include contents, 
 not dir itself.
References: <60E3E7A6.7090906@HIDDEN>
In-Reply-To: <60E3E7A6.7090906@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 49428
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

First stab at a script is really slow...

find dirs, then find all files in the dir:

There's gotta be a faster way...ug!

lastt=1
shopt -s lastpipe

find "$1" -depth -type d |
  while read dr;do
    t=$(find "$dr" -xdev -maxdepth 1 -mindepth 1 ! -name . -a ! -name .. 
-printf "%T@\n" |
        cut -d. -f1|sort -rn|head -1)
    if [[ ! $t ]]; then
      t=$lastt
    fi
    if [[ ! $t ]]; then
      echo "dir=$dr"; exit 1; fi
    #echo "touch -d \"@$t\" \"$dr\""
    touch -d "@$t" "$dr"
    lastt=$t
  done






Information forwarded to bug-coreutils@HIDDEN:
bug#49428; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 6 Jul 2021 06:57:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 06 02:57:45 2021
Received: from localhost ([127.0.0.1]:47140 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m0f1c-0004ao-W4
	for submit <at> debbugs.gnu.org; Tue, 06 Jul 2021 02:57:45 -0400
Received: from lists.gnu.org ([209.51.188.17]:53078)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <coreutils@HIDDEN>) id 1m0f1b-0004ag-ON
 for submit <at> debbugs.gnu.org; Tue, 06 Jul 2021 02:57:43 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:35928)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <coreutils@HIDDEN>)
 id 1m0f1b-0000wf-FP
 for bug-coreutils@HIDDEN; Tue, 06 Jul 2021 02:57:43 -0400
Received: from ishtar.tlinx.org ([173.164.175.65]:35058
 helo=Ishtar.sc.tlinx.org)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <coreutils@HIDDEN>)
 id 1m0f1Z-0002zt-Pr
 for bug-coreutils@HIDDEN; Tue, 06 Jul 2021 02:57:43 -0400
Received: from [192.168.3.12] (Athenae [192.168.3.12])
 by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id
 1666vAbB085115; Mon, 5 Jul 2021 23:57:14 -0700
Message-ID: <60E3FEA5.9010309@HIDDEN>
Date: Mon, 05 Jul 2021 23:56:37 -0700
From: L A Walsh <coreutils@HIDDEN>
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version: 1.0
To: 49428 <at> debbugs.gnu.org, Coreutils <bug-coreutils@HIDDEN>
Subject: Re: bug#49428: RFE: for --time have option to only include contents, 
 not dir itself.
References: <60E3E7A6.7090906@HIDDEN>
In-Reply-To: <60E3E7A6.7090906@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=173.164.175.65; envelope-from=coreutils@HIDDEN;
 helo=Ishtar.sc.tlinx.org
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

First stab at a script is really slow...

find dirs, then find all files in the dir:

There's gotta be a faster way...ug!

lastt=1
shopt -s lastpipe

find "$1" -depth -type d |
  while read dr;do
    t=$(find "$dr" -xdev -maxdepth 1 -mindepth 1 ! -name . -a ! -name .. 
-printf "%T@\n" |
        cut -d. -f1|sort -rn|head -1)
    if [[ ! $t ]]; then
      t=$lastt
    fi
    if [[ ! $t ]]; then
      echo "dir=$dr"; exit 1; fi
    #echo "touch -d \"@$t\" \"$dr\""
    touch -d "@$t" "$dr"
    lastt=$t
  done






Information forwarded to bug-coreutils@HIDDEN:
bug#49428; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 6 Jul 2021 05:20:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 06 01:20:30 2021
Received: from localhost ([127.0.0.1]:47069 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m0dVW-000286-N7
	for submit <at> debbugs.gnu.org; Tue, 06 Jul 2021 01:20:30 -0400
Received: from lists.gnu.org ([209.51.188.17]:58766)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <coreutils@HIDDEN>) id 1m0dVU-00027y-J9
 for submit <at> debbugs.gnu.org; Tue, 06 Jul 2021 01:20:28 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:52238)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <coreutils@HIDDEN>)
 id 1m0dVU-0005sE-C1
 for bug-coreutils@HIDDEN; Tue, 06 Jul 2021 01:20:28 -0400
Received: from ishtar.tlinx.org ([173.164.175.65]:59040
 helo=Ishtar.sc.tlinx.org)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <coreutils@HIDDEN>)
 id 1m0dVS-0002Je-2Q
 for bug-coreutils@HIDDEN; Tue, 06 Jul 2021 01:20:27 -0400
Received: from [192.168.3.12] (Athenae [192.168.3.12])
 by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id
 1665JwXK077016
 for <bug-coreutils@HIDDEN>; Mon, 5 Jul 2021 22:20:00 -0700
Message-ID: <60E3E7A6.7090906@HIDDEN>
Date: Mon, 05 Jul 2021 22:18:30 -0700
From: L A Walsh <coreutils@HIDDEN>
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version: 1.0
To: Coreutils <bug-coreutils@HIDDEN>
Subject: RFE: for --time have option to only include contents, not dir itself.
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=173.164.175.65; envelope-from=coreutils@HIDDEN;
 helo=Ishtar.sc.tlinx.org
X-Spam_score_int: 0
X-Spam_score: -0.0
X-Spam_bar: /
X-Spam_report: (-0.0 / 5.0 requ) BAYES_20=-0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

I did a re-install-in-place on windows that reset the
dirtimes on all the dirs to the date I did the re-inst.

As a partial recovery, I want to be able to reset the date
to the time of the last modified file in the dir.

I thought to use:

   du -s --time DIR

but it's not just showing (from manpage):

       --time show time of the last modification of any file in the 
directory,
              or any of its subdirectories

instead it is showing the above & the time on the dir itself.
Some people may want to include the dir time, but that's usually
obvious by the time on the directory.

Nevertheless, perhaps a "--contents" flag to not include
the size of the directory-inode itself might be useful?

Sadly --separate-dirs doesn't really separate out all
the dir-sizes either, but only subdirs.

*sigh*
tnx!





Acknowledgement sent to L A Walsh <coreutils@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to bug-coreutils@HIDDEN:
bug#49428; Package coreutils. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 21 Feb 2022 10:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.