ambaraba
2024-08-21 08:13:55 UTC
I would like to cp a file created in 2002 (linux mint 21.2)
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 (2002)
cp -p /mnt/srcdir/FILE.jpg /mnt/destdir/FILE.jpg
Unfortunately the timestamp on the destination is not preserved (it is
TODAY !)
For sure I'm doing something wrong ... but cannot find where and what
THANKS for any help !
P.S.
<grr>
boring details :
source: ll /mnt/srcdir/FILE.jpg
-rwxrwxrwx 1 MYSELF MYSELF 262958 Jun 8 2002 /mnt/srcdir/FILE.jpg*
dest: ll /mnt/destdir/FILE.jpg
-rwxrwxrwx 1 MYSELF MYSELF 262958 Aug 21 08:44 /mnt/destdir/FILE.jpg*
and : stat /mnt/destdir/FILE.jpg
File: /mnt/destdir/FILE.jpg
Size: 262958 Blocks: 520 IO Block: 1048576 regular file
Device: 35h/53d Inode: 81137270 Links: 1
Access: (0777/-rwxrwxrwx) Uid: ( 1000/ MYSELF) Gid: ( 1000/
MYSELF)
Access: 2024-08-21 08:44:09.535219100 +0200
Modify: 2024-08-21 08:44:07.395050200 +0200
Change: 2024-08-21 08:44:07.395050200 +0200
Birth: 2024-08-21 08:44:06.375153700 +0200
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 (2002)
cp -p /mnt/srcdir/FILE.jpg /mnt/destdir/FILE.jpg
Unfortunately the timestamp on the destination is not preserved (it is
TODAY !)
For sure I'm doing something wrong ... but cannot find where and what
THANKS for any help !
P.S.
cp -p /mnt/srcdir/FILE.jpg /mnt/srcdir/FILE_COPIED.jpg
/mnt/srcdir/FILE_COPIED.jpg mantains the original timestamp<grr>
boring details :
source: ll /mnt/srcdir/FILE.jpg
-rwxrwxrwx 1 MYSELF MYSELF 262958 Jun 8 2002 /mnt/srcdir/FILE.jpg*
dest: ll /mnt/destdir/FILE.jpg
-rwxrwxrwx 1 MYSELF MYSELF 262958 Aug 21 08:44 /mnt/destdir/FILE.jpg*
and : stat /mnt/destdir/FILE.jpg
File: /mnt/destdir/FILE.jpg
Size: 262958 Blocks: 520 IO Block: 1048576 regular file
Device: 35h/53d Inode: 81137270 Links: 1
Access: (0777/-rwxrwxrwx) Uid: ( 1000/ MYSELF) Gid: ( 1000/
MYSELF)
Access: 2024-08-21 08:44:09.535219100 +0200
Modify: 2024-08-21 08:44:07.395050200 +0200
Change: 2024-08-21 08:44:07.395050200 +0200
Birth: 2024-08-21 08:44:06.375153700 +0200