cp -u copies old files that already exist in the destination directory
I am using CentOS 5.8 x86_64. I have 2 hard disks, one containing the / paritition and all user files, and a 2nd one
which I use as a backup disk. I normally do a backup by using "cp -a -u" so only new files created since the last
backup need to be copied to the backup disk. I have been doing this for a number of years without any problems.
Recently, however, I noticed that the "cp -a -u" commands keeps trying to copy certain old files that already exist
on the backup disk (my cp command is aliased to "cp -i", so I get prompted whenever it tries to overwrite an existing
file). It only does this for a small number of old files, but it keeps doing it to the same old files every time I
execute "cp -a -u". I checked the time stamps of the files both on my home directory and the backup disk and they are
exactly the same (as they should be). I even tried to do a' touch' on the old files on the backup disk, so they end
up having a newer time stamp than the files on the home directory - to no avail: "cp -a -u" still tries to copy them.
Does anyone have an explanation for this strange behaviour, and how to fix it?
Thanks in advance,