From nobody Thu May 01 18:58:42 2025 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZpNcR5CpTz5vZvm for ; Thu, 01 May 2025 18:58:31 +0000 (UTC) (envelope-from jguojun@gmail.com) Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZpNcP4mzZz3YvS for ; Thu, 01 May 2025 18:58:29 +0000 (UTC) (envelope-from jguojun@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=FDTVFYbQ; spf=pass (mx1.freebsd.org: domain of jguojun@gmail.com designates 2607:f8b0:4864:20::235 as permitted sender) smtp.mailfrom=jguojun@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-oi1-x235.google.com with SMTP id 5614622812f47-401c43671ecso716566b6e.0 for ; Thu, 01 May 2025 11:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746125908; x=1746730708; darn=freebsd.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=XT3jZGfMtOBNiuj8k/ULlVivd2/dKL7QwrJFDPOx/DA=; b=FDTVFYbQAfyZkMlKo26F9wc4l/rgZemd8Gt2LIx7k5nMWczHxldxt5pKpNqYaj0J/z 0kdFfTkyVxaSh/QuVcQzsMIjZOCxTMRIHodlSZr/0kEwHHstvJeh5qibF7MLqLOvDQRC xG+MffqFv5sRpwqO3v0QQZXKufe3/oGTI9xI6G6aOC7sNSXkSlQKNp1dDHtM9CS9Hesw EICkYkBqxU1L+E0PXgBqGfYevYnfDrcuQdRJ+163vNRZs8/aYmsK8PIt9q2LzEIMGGfK UN7RJ69b3gmYHuGqe4eMqachu5tHRD7ZlCU4c1FmYF+sQJbxRchk4Q569sl0L+2VEBfC nR+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746125908; x=1746730708; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XT3jZGfMtOBNiuj8k/ULlVivd2/dKL7QwrJFDPOx/DA=; b=ZAAR14UOddMObwsY5pt07jeiubAhE6j+hYCi6NxgxDjEq7i5mUqeIrX2knAw/HsWgJ POAEYlZvrRMtKXvpR1kWcapE438GymFWNMlM0JPFbkz6CT2FWwC/PBb8ZbuxqAt9ilQC WT3q9SVy39sRiquNMr+L3MbE2ryhhAV5SQsRjrs4FW49/d3+B7+Mx5Dc2cTlMsEpoABL X3oys9gOiQ4Xup7bu4PglfSof7kgn7Ix+BEkcLH2U8CH9ZIHc0YwODOzfDxlx/9bpfk/ UC5g+wSjAZR3CITz+/LsuACNfpGHJEtTMF9e0bOtRdaRIMNQABV2cLKyWeeenn6OXVGx Hvig== X-Gm-Message-State: AOJu0YxkEO739QI08Y1MSl9Y34+aFruLKNJC1cz0VVrnc9nsLc53S2X0 8tCy0kCmV4wUzQNPTNieVM4xI5Ch52Xdn3A9wg19uHjW0pLkt0xvbWt9 X-Gm-Gg: ASbGnctmsemK86MBYZV1y9TeT0ejbdKx1esGs7uZK+/srejRwVaGm95g3B8DZ//DBQU 9HKpaMoWnmD8qrJKe04PkuPI5vvuDcFzmq0RPMH1IdabBHCaJ3m1OXE33Xiaoz5HayDVaWr5iKN Y5XrLs2feIO7MmcyiWzGTkC6V7VUrs2f5PXPHf6q60s0vEPX+RAUFiHLWihO3KMpaBpSLdZTS5U 443GzL0BfyAd2cFFyHrSTnD/cY+HQjcpSO4DGFFJfFKJ2mzh36kzb+1qQvIHkCUevMuQDQXmqNs FEOnC4l3onMkfmM4lVQqaml9hw5TRAraGvaQIv21onWCEAr4w2p2VVmuyCE8W8TnO2S5zS19B0x iZVEi1zgTICw3KyDu X-Google-Smtp-Source: AGHT+IFB8XeRmp1woZE+BvjSGJkcspqYCpo8N4j+caG6u1FV2pxVrZmcRO24aZ7FU43IaRQvbXGM8g== X-Received: by 2002:a05:6808:6b8b:b0:3f6:ab0d:8d90 with SMTP id 5614622812f47-4034116668amr210122b6e.3.1746125908314; Thu, 01 May 2025 11:58:28 -0700 (PDT) Received: from [192.168.1.220] (76-218-103-166.lightspeed.sntcca.sbcglobal.net. [76.218.103.166]) by smtp.gmail.com with ESMTPSA id 5614622812f47-4033d7df83dsm233118b6e.0.2025.05.01.11.58.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 May 2025 11:58:28 -0700 (PDT) Message-ID: Date: Thu, 1 May 2025 11:58:42 -0700 List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-questions@freebsd.org Sender: owner-freebsd-questions@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: restoring a tar archive && modification time of directories To: freebsd-questions@freebsd.org References: <20250501111420347332352@bob.proulx.com> Content-Language: en-US From: "Jin Guojun[VFF]" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4ZpNcP4mzZz3YvS X-Spamd-Bar: / X-Spamd-Result: default: False [-0.02 / 15.00]; NEURAL_SPAM_LONG(1.00)[1.000]; NEURAL_HAM_SHORT(-0.95)[-0.952]; NEURAL_SPAM_MEDIUM(0.93)[0.929]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FREEMAIL_FROM(0.00)[gmail.com]; ARC_NA(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_ONE(0.00)[1]; DKIM_TRACE(0.00)[gmail.com:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::235:from]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[] On 5/1/25 11:33, Matthias Apitz wrote: > I can reproduce the problem with: > > $ rm -r d > $ mkdir d > $ touch -t 202504300101 d/file d > $ ls -ld d d/file > drwxr-xr-x 2 guru wheel 512 30 abr. 01:01 d > -rw-r--r-- 1 guru wheel 0 30 abr. 01:01 d/file > $ tar cf d.tar d > > (without deleting the directory 'd') > > $ tar xf d.tar > $ ls -ld d d/file > drwxr-xr-x 2 guru wheel 512 1 may. 20:25 d > -rw-r--r-- 1 guru wheel 0 30 abr. 01:01 d/file > > i.e. if the directories are existing (as it was in my original case > restoring into my HOME a backup), the modification time of the directory > will not be adjusted to the value in the tar archive. One could call > this a bug or a feature. Don't know. > > matthias This is the original "tar" behavior, which does not restore the existing directory timestamp. The "mv" command actually gradually changed behavior on restoring timestamp since 12-R, if my memory services correct. 11-R and earlier releases, mv directories to any other location, the directory timestamp is intact. "mv" in some 12-R does and some does not. In 13 and later releases, mv only restores the directory timestamp when mv made cross file systems; it moving is made within the same file system, the timestamp of the root directory is set to the moving date-time, which is kind annoying. -Jin