James Keeline wrote:
--- Marieke Thayer <[EMAIL PROTECTED]> wrote:

Hi all,

Can any of you tell me how to preserve the date on the new copy of a file when you use the cp command in bash?

Kubuntu 8.04

I tried

cp -p tmp.txt tmp2.txt
cp -a tmp.txt tmp2.txt
cp --preserve=timestamps tmp.txt tmp2.txt


I tried cutting and pasting from the man page the --preserve= equivalent of cp -p; cp --preserve=mode,ownership,timestamps

I am at wits end. Do I have something set up wrong in my system?

Marieke

Perhaps another approach would help with your application.  The tar command
seems to preserve dates with default options.  It can be piped in addition to
creating an intermediate archive file.

James

This was a general question not related to backing up. Suppose I want

cp -ip filename filename.old
vi filename

then test and see if something works. Suppose that I don't want to change the date on filename.old. I don't think that I should be have to use tar for that. I would like to figure out if there is a bug or if I am using cp wrong. I am using Kubuntu 8.04 .

Marieke
-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-newbie

Reply via email to