How can I copy a file using SCP while preserving ctime (modification time)?
I have a folder on my Mac (OS 10.8), and the results of ls -l
and ls -lc
are the same.
$ ls -l
total 0
drwxr-xr-x 9 elliott staff 306 Mar 24 21:24 Day1b
$ ls -lc
total 0
drwxr-xr-x 9 elliott staff 306 Mar 24 21:24 Day1b
Then I copy it to a remote server (Linux), with -p
to preserve timestamps.
$ scp -pr Day1b/ [email protected]:/
Now on the remote server, the ctime is changed to the current date.
# ls -l
total 00
drwxr-xr-x 3 elliott elliott 4096 Mar 24 23:24 Day1b/
# ls -lc
total 0
drwxr-xr-x 3 elliott elliott 4096 Mar 28 14:08 Day1b/