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


Groups > comp.os.linux.misc > #58126

Re: Copy a file from local to network preserving timestamp

Subject Re: Copy a file from local to network preserving timestamp
Newsgroups comp.os.linux.misc
References <va50u0$3tav1$3@dont-email.me>
From "186282@ud0s4.net" <186283@ud0s4.net>
Organization vector apex
Date 2024-08-22 00:16 -0400
Message-ID <VaecncAcKPEmJlv7nZ2dnZfqnPGdnZ2d@earthlink.com> (permalink)

Show all headers | View raw


On 8/21/24 11:25 AM, ambaraba wrote:
> I would like to copy a file
> from srcdir [local HDD "UUID=5AAAA.. /mnt/srcdir  ntfs-3g" in fstab]
> to destdir [network share "//192.168.xx.xx /mnt/destdir ... cifs ..." in 
> fstab]
> preserving the original creation date.
> I've tried
>  > cp -p /mnt/srcdir/FILE.jpg /mnt/destdir/FILE.jpg
>  > rsync -vuart /mnt/srcdir      /mnt/destdir
>  > dd ... can't remember the options
> I've also tried with "freefilesync"
> Unfortunately the timestamp on the destination is not preserved :-(
> Is it there a way to
> copy a file (many files) from local to network share
> preserving timestamp ?
> I'm considering "timeshift" but honestly ...
> THANKS for any help


   "cp -p <whatever> <wherever>" ... preserves time and ownership.

   The '-a' "archive" mode can do the same. Experiment
   with where/when to add a trailing slash with that one.

   I've heard "touch -r" can actually do the same, but
   have never used it that way. Probably evokes 'cp -p'.

   If using some computer language's libraries to copy
   stuff you MAY have to do it in two or three steps -
   ie "get time/owner data", "do the copy", "set the
   dest file with the original info". I wrote a lot
   of backup programs - that oft stored compressed
   and/or encrypted copies - and you kinda HAD to
   do it this way just to be sure. Not HARD, but a
   couple extra steps nevertheless.

   Mosty this stuff is much easier with Linux/Unix than
   in Winders. TRY to interpret THOSE docs for the Win
   'C' library routines  :-)

Back to comp.os.linux.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Copy a file from local to network preserving timestamp ambaraba <ambaraba@none.nn> - 2024-08-21 17:25 +0200
  Re: Copy a file from local to network preserving timestamp The Natural Philosopher <tnp@invalid.invalid> - 2024-08-21 16:40 +0100
  Re: Copy a file from local to network preserving timestamp Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-08-21 16:05 +0000
    Re: Copy a file from local to network preserving timestamp ambaraba <ambaraba@none.nn> - 2024-08-21 19:04 +0200
  Re: Copy a file from local to network preserving timestamp "186282@ud0s4.net" <186283@ud0s4.net> - 2024-08-22 00:16 -0400
  Re: Copy a file from local to network preserving timestamp Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-08-22 05:32 +0000
    Re: Copy a file from local to network preserving timestamp vallor <vallor@cultnix.org> - 2024-08-22 07:09 +0000
  Re: Copy a file from local to network preserving timestamp "Carlos E.R." <robin_listas@es.invalid> - 2024-08-23 14:56 +0200

csiph-web