Is there a remote file transfer command that preserves nanosecond timestamps?
Posted
by
Denver Gingerich
on Super User
See other posts from Super User
or by Denver Gingerich
Published on 2011-01-14T23:54:20Z
Indexed on
2011/01/15
0:55 UTC
Read the original article
Hit count: 470
I've tried transferring files using scp and rsync on Ubuntu 10.04, but neither of them preserves more than second precision. Here's an example:
$ touch test1
$ scp -p test1 localhost:test2
$ ls -l --full-time test*
-rw-r--r-- 1 user user 0 2011-01-14 18:46:06.579717282 -0500 test1
-rw-r--r-- 1 user user 0 2011-01-14 18:46:06.000000000 -0500 test2
$ cp -p test1 test2
$ ls -l --full-time test*
-rw-r--r-- 1 user user 0 2011-01-14 18:46:06.579717282 -0500 test1
-rw-r--r-- 1 user user 0 2011-01-14 18:46:06.579717282 -0500 test2
$
A straight copy works fine, but scp truncates the timestamp.
Are there any tools (preferably similar to scp or rsync in their usage) that do remote file transfers while preserving nanosecond timestamps? I could write a hacky script to do it, but I'd rather not.
© Super User or respective owner