Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #222115

Re: unexpected behavior of cp and mv

From Charles Curley <charlescurley@charlescurley.com>
Newsgroups linux.debian.user
Subject Re: unexpected behavior of cp and mv
Date 2020-04-29 21:20 +0200
Message-ID <A10pr-4LB-3@gated-at.bofh.it> (permalink)
References <A0YnE-3wp-13@gated-at.bofh.it>
Organization occasionally

Show all headers | View raw


On Wed, 29 Apr 2020 12:22:41 -0400
Alberto Sentieri <22t@tripolho.com> wrote:

> cp and mv are not preserving the file timestamps when copying from a 
> ext4 file system to a smb file system.

What I see is:

* mv does preserve the time of the file, regardless of copying to an
  SMB share or not.

* cp indeed does not preserve the time of the original file, regardless
  of copying to an SMB share or not.

mv simply moves a directory entry, including the inode, from here to
there. cp creates a new directory entry at the destination. So these
results make sense.

To have cp preserve the time (i.e. copy the original file's time to the
copy), use its -p option.

Also, check for aliases that might include options you don't want.

-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-29 19:10 +0200
  Re: unexpected behavior of cp and mv Roberto C. Sánchez <roberto@debian.org> - 2020-04-29 19:20 +0200
    Re: Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-29 20:50 +0200
    Re: Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-29 21:20 +0200
      Re: unexpected behavior of cp and mv David Wright <deblis@lionunicorn.co.uk> - 2020-04-30 03:50 +0200
        Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 06:20 +0200
  Re: unexpected behavior of cp and mv Charles Curley <charlescurley@charlescurley.com> - 2020-04-29 21:20 +0200
    Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-29 22:10 +0200
      Re: unexpected behavior of cp and mv "Thomas Schmitt" <scdbackup@gmx.net> - 2020-04-29 22:20 +0200
        Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-29 22:30 +0200
        Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-29 23:00 +0200
          Re: unexpected behavior of cp and mv "Thomas Schmitt" <scdbackup@gmx.net> - 2020-04-29 23:30 +0200
            Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 06:40 +0200
              Re: unexpected behavior of cp and mv "Thomas Schmitt" <scdbackup@gmx.net> - 2020-04-30 12:40 +0200
                Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 16:20 +0200
            Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 18:50 +0200
              Re: unexpected behavior of cp and mv "Thomas Schmitt" <scdbackup@gmx.net> - 2020-04-30 19:40 +0200
                Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 20:10 +0200
                Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 21:50 +0200
                Re: unexpected behavior of cp and mv The Wanderer <wanderer@fastmail.fm> - 2020-04-30 22:00 +0200
                Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 22:10 +0200
                Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 23:40 +0200
              Re: unexpected behavior of cp and mv David Wright <deblis@lionunicorn.co.uk> - 2020-04-30 20:00 +0200
          Re: unexpected behavior of cp and mv songbird <songbird@anthive.com> - 2020-04-30 00:00 +0200
            Re: unexpected behavior of cp and mv Alberto Sentieri <22t@tripolho.com> - 2020-04-30 06:10 +0200

csiph-web