Gus Wirth wrote:
Marieke Thayer 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?

What is the originating filesystem (ext3, fat32, etc)? What is the destination filesystem (ext3, fat32, etc)? Some filesystems don't have the ability to store a date or there is something else that blocks it.

Use the output of mount to tell what filesystems you are using.

Gus

When I say 'cp -ip file1 file2', I get slightly different results on different file systems. From ext3 to ext3, the date was not preserved. From vfat to vfat I got "cp: preserving times for 'file2': operation not permitted" before it didn't preserve the date.

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

Reply via email to