CERN Accelerating science

Using xrdcp and http to write extended attributes


I’m creating files with various bits of metadata, and I’d like to write in the extended metadata too, as fetched from the method in a previous conversation here.

Looking into the EOS source code, it appears that I can pass along eos.xattr as a field, but I can’t figure out the particular format for this value.

How does one format this string such that it’ll work with an xrdcp root://mgm/path/file?eos.xattr=... sequence?

Hi David,

I had a quick look at this but I’m afraid there is a bug which makes this functionality unusable for the moment. I’ve pushed this fix and things work file now:

For example:
xrdcp -f -d 1 /etc/passwd root://localhost//eos/dev/replica/david1.dat?eos.xattr=user.acl=u:esindril:rwx

Looks like this on the MGM side:

EOS Console [root://localhost] |/eos/dev/replica/> attr ls david1.dat

Unfortunately, this will require a new release and update of the MGM unless you can build it yourself …
A new release will probably happen next week.


1 Like

Thank you @esindril. For some reason I never saw an email about this reply, apologies for my delay in getting back to you.

How does one then use to set multiple metadata fields? Specify eos.xattr as a parameter for each extended attribute, so that it reads “?eos.xattr=my.attribute=foo&eos.xattr=your.attribute=baz” ?

Hi David,

No worries. Well now, looking at the functionality to add multiple xattrs in one command this can not work since it assumes the “&” is the separator. But the “&” is the default separator for the opaque tokens.
I’ve pushed another fix to use “#” as separator between multiple xattr values. This will be available in 4.5.3:

Now, you should be able to set multiple xattrs in one go like this:

sudo xrdcp -f -d 1 /etc/passwd "root://localhost//eos/dev/replica/davida1.dat?eos.xattr=user.acl=u:esindril:rwx#user.mask=700"                                                                                                                           

EOS Console [root://localhost] |/eos/dev/replica/> attr ls davida1.dat