google-drive-ocamlfuse icon indicating copy to clipboard operation
google-drive-ocamlfuse copied to clipboard

How to make rsync preserve timestamps (modification time)?

Open jandermoreira opened this issue 3 years ago • 0 comments

When I use rsync to update a directory, all new files are created using the current time and not it's original timestamp. It's not the case for directories, which preserve modification times.

Here's the command:

rsync -av /source ~/mounted/

I tried adding --times (I know it's included in -a, but...), --atimes and even --inplace (to avoid the temp file). Nothing worked for me.

If I use Nautilus, the file is created with current time, but the timestamps is updated when the transfer ends.

Info:

$ rsync --version
rsync  version 3.2.3  protocol version 31
Copyright (C) 1996-2020 by Andrew Tridgell, Wayne Davison, and others.
Web site: https://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, hardlink-specials, symlinks, IPv6, atimes,
    batchfiles, inplace, append, ACLs, xattrs, optional protect-args, iconv,
    symtimes, prealloc, stop-at, no crtimes
Optimizations:
    SIMD, no asm, openssl-crypto
Checksum list:
    xxh128 xxh3 xxh64 (xxhash) md5 md4 none
Compress list:
    zstd lz4 zlibx zlib none

Ubuntu 21.04

jandermoreira avatar Feb 10 '22 14:02 jandermoreira