I'm trying to copy only changed files using 'cp -pu' under Linux (Red Hat 6.1, source/destination FS are GlusterFS mounted partitions) but I found that it still tries to copy file seemingly old and unchanged. In fact, just running the same command again would skip to the next file. I can reproduce the problem in the test shown below. Notice that in the test, I hit control-C to stop the interactive cp command the each time it asks. The second run would skip the file asked in the first run. Why does this happen? And is there a better, fast standard tool to copy locally mounted directories? (I could probably try rsync but I don't need to be super accurate since the data are only for testing and I'm concerned about its speed.)
[root@flex 6b42]# for d in *.story; do echo trying $d; ls -al $d
/data/staging/./storage01/42/6b/6b42/$d; cp --parent -rpu -v -i $d
/data/staging/./storage01/42/6b/6b42/; done trying
0a65b244-f342-a120-9a47-62d0c6aa4a26.story
0a65b244-f342-a120-9a47-62d0c6aa4a26.story: total 228 drwxrwx--- 2
somebody somebody 53 Jan 8 02:23 . drwxrwx--- 1280 somebody
somebody 147456 Apr 30 11:07 ..
-rw-r--r-- 1 somebody somebody 2821 Nov 28 2011 data
-rw-r--r-- 1 somebody somebody 0 Nov 28 2011 images
-rw-r----- 1 somebody somebody 17 Nov 28 2011 .timestamp
/data/staging/./storage01/42/6b/6b42/0a65b244-f342-a120-9a47-62d0c6aa4a26.story:
total 228 drwxrwx--- 2 somebody somebody 53 Jan 8 02:23 .
drwxrwx--- 1363 somebody somebody 155648 Apr 30 11:07 ..
-rw-r--r-- 1 somebody somebody 2821 Nov 28 2011 data
-rw-r--r-- 1 somebody somebody 0 Nov 28 2011 images
-rw-r----- 1 somebody somebody 17 Nov 28 2011 .timestamp cp: overwrite
`/data/staging/./storage01/42/6b/6b42/0a65b244-f342-a120-9a47-2d0c6aa4a26.story/.timestamp'?
^C [root@flex 6b42]# for d in *.story; do echo trying $d; ls -al $d
/data/staging/./storage01/42/6b/6b42/$d; cp --parent -rpu -v -i $d
/data/staging/./storage01/42/6b/6b42/; done trying
0a65b244-f342-a120-9a47-62d0c6aa4a26.story
0a65b244-f342-a120-9a47-62d0c6aa4a26.story: total 228 drwxrwx--- 2
somebody somebody 53 Jan 8 02:23 . drwxrwx--- 1286 somebody
somebody 147456 Apr 30 11:07 ..
-rw-r--r-- 1 somebody somebody 2821 Nov 28 2011 data
-rw-r--r-- 1 somebody somebody 0 Nov 28 2011 images
-rw-r----- 1 somebody somebody 17 Nov 28 2011 .timestamp
/data/staging/./storage01/42/6b/6b42/0a65b244-f342-a120-9a47-62d0c6aa4a26.story:
total 228 drwxrwx--- 2 somebody somebody 53 Jan 8 02:23 .
drwxrwx--- 1363 somebody somebody 155648 Apr 30 11:07 ..
-rw-r--r-- 1 somebody somebody 2821 Nov 28 2011 data
-rw-r--r-- 1 somebody somebody 0 Nov 28 2011 images
-rw-r----- 1 somebody somebody 17 Nov 28 2011 .timestamp trying 0aee088d-af48-1236-bcae-6d2033a2acb7.story
0aee088d-af48-1236-bcae-6d2033a2acb7.story: total 232 drwxrwx--- 2
somebody somebody 53 Jan 7 09:39 . drwxrwx--- 1286 somebody
somebody 147456 Apr 30 11:07 ..
-rw-r--r-- 1 somebody somebody 5952 Dec 19 12:40 data
-rw-r--r-- 1 somebody somebody 0 Dec 19 12:40 images
-rw-r----- 1 somebody somebody 17 Dec 19 12:40 .timestamp
/data/staging/./storage01/42/6b/6b42/0aee088d-af48-1236-bcae-6d2033a2acb7.story:
total 232 drwxrwx--- 2 somebody somebody 53 Jan 7 09:39 .
drwxrwx--- 1363 somebody somebody 155648 Apr 30 11:07 ..
-rw-r--r-- 1 somebody somebody 5952 Dec 19 12:40 data
-rw-r--r-- 1 somebody somebody 0 Dec 19 12:40 images
-rw-r----- 1 somebody somebody 17 Dec 19 12:40 .timestamp cp: overwrite
`/data/staging/./storage01/42/6b/6b42/0aee088d-af48-1236-bcae-6d2033a2acb7.story/.timestamp'?
^C