GNU bug report logs -
#8370
RFC: cp --no-preserve=contents
Previous Next
Reported by: Eric Blake <eblake <at> redhat.com>
Date: Mon, 28 Mar 2011 21:06:01 UTC
Severity: normal
Done: Eric Blake <eblake <at> redhat.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
On 04/12/2012 01:41 AM, Pádraig Brady wrote:
> On 03/28/2011 10:56 PM, Pádraig Brady wrote:
>> On 28/03/11 21:55, Eric Blake wrote:
>>> cp --attributes-only is great for preserving all metadata attributes
>>> without corrupting contents, but what if I want to preserve only some of
>>> the metadata (for example, copying SELinux context but _not_ timestamps
>>> or content)? It seems like --attributes-only would be a great synonym
>>> for '--preserve=all --no-preserve=contents', and that by adding the
>>> 'contents' category to --preserve (and defaulting it to on unless turned
>>> off explicitly), that you expose finer-grained tuning to what metadata
>>> gets copied.
>>
>> --attr and --preserve can be combined already. Is that enough?
>> Here are the info docs:
>>
>> `--attributes-only'
>> Preserve the specified attributes of the original files in the
>> copy, but do not copy any data. See the `--preserve' option for
>> controlling which attributes to copy.
>
> Cross referencing a related bug report:
> https://bugzilla.redhat.com/show_bug.cgi?id=811746#c1
So thinking a bit more about this,
and given the confusion expressed in the above bug report,
perhaps it's best to change --attributes-only to
_not_ truncate existing files?
I think scripts relying on the truncation behavior
of this relative new feature would be very rare,
and the non truncating behavior is more generally useful.
Patch to implement this change is attached.
cheers,
Pádraig.
[cp-attr-existing.diff (text/plain, attachment)]
This bug report was last modified 13 years and 105 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.