You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: Copy custom metadata on objects #111
For object storage systems that support custom (user defined) metadata types, include a flag (-meta?) that will also copy custom metadata from source to destination. For example, if copying/migrating data from Amazon S3 to Swift, or from Swift to Swift, it would be very handy to be able to maintain any custom metadata set on the objects.
How to use GitHub
Please use the 👍 reaction to show that you are affected by the same issue.
Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
Subscribe to receive notifications on status change and new comments.
Reacted by Joe Tavin, Alfonso Montero López, Alexandros Solanos, Ben Zenker, Stéphanie, Colum McClay, Ivan Andreev, Yves H, Júlia Marczak Birkett, Yan Cheng Cheok and 27 more
Reacted by jamshid, Kevin Locke, Alfonso Montero López, Alexandros Solanos, Stéphanie, HeliXZz, Henri Devigne and PiSeeker
@ncw How about something like: If you invoked the -meta flag in your Rclone command, then it will head the object, read the custom metadata and then store it in a temporary json blob. Once the object has been transferred and the md5sum has been checked, the metadata stored in json will be applied through a post to the object in the destination container/bucket. ?? It might require a few extra operations, but it would only take a hit if you invoke the -meta flag, and the operations would (perhaps) not be ridiculously expensive.
Only an idea. I'm sure there might be better ways to do this, as I'm not much of a developer myself.
$ attr -l ./Package_98/Package_98_version_13
Attribute "user.content-md5" has a 16 byte value for ./Package_98/Package_98_version_13
Attribute "user.user-metadata.sha1" has a 3 byte value for ./Package_98/Package_98_version_13
Attribute "user.content-type" has a 19 byte value for ./Package_98/Package_98_version_13
Attribute "user.user-metadata.package" has a 10 byte value for ./Package_98/Package_98_version_13
Attribute "user.user-metadata.version" has a 2 byte value for ./Package_98/Package_98_version_13
the user.user-metadata are the custom metadata that are set on the object (in this case that would match the headers x-amz-meta-package, x-amz-meta-sha1,x-amz-meta-version that S3 would return)
@ncw Is there anything further pending from this ticket?
I believe backend-specific metadata implementations should have their own tickets as & when required and there is already a separate ticket for tracking folder metadata: #6685
Activity
ncw commentedon Aug 26, 2015
@mlanner nice idea - I've wanted exactly this before when moving stuff about in Swift. Not sure how I'd implement it - I'll have a think.
mlanner commentedon Aug 27, 2015
@ncw How about something like: If you invoked the
-metaflag in your Rclone command, then it will head the object, read the custom metadata and then store it in a temporary json blob. Once the object has been transferred and the md5sum has been checked, the metadata stored in json will be applied through a post to the object in the destination container/bucket. ?? It might require a few extra operations, but it would only take a hit if you invoke the-metaflag, and the operations would (perhaps) not be ridiculously expensive.Only an idea. I'm sure there might be better ways to do this, as I'm not much of a developer myself.
jamshid commentedon Dec 30, 2015
I wonder if metadata could be stored in file attributes (https://en.wikipedia.org/wiki/Extended_file_attributes), so we don't need a separate/temporary json file.
ncw commentedon Dec 30, 2015
@jamshid not a bad idea.. I wonder if it can be done in a cross platform way from go...
ncw commentedon Jul 22, 2016
An implementation idea - we pass the source object to the Put methods. Do a type assertion at that point to break out the metadata - not too tricky.
freedge commentedon Jul 29, 2016
@jamshid @ncw that's how it's done when using JClouds with the "filesystem" blob store implementation. For example:
the user.user-metadata are the custom metadata that are set on the object (in this case that would match the headers
x-amz-meta-package,x-amz-meta-sha1,x-amz-meta-versionthat S3 would return)\rclone#111 add support for custom metadata
erik78se commentedon Sep 16, 2017
philip-harvey commentedon Jun 14, 2018
53 remaining items
s3: fix --s3-no-head panic: reflect: Elem of invalid type s3.PutObjec…
s3: fix --s3-no-head panic: reflect: Elem of invalid type s3.PutObjec…
s3: fix --s3-no-head panic: reflect: Elem of invalid type s3.PutObjec…
upintheairsheep commentedon Dec 12, 2022
Should there be a separate object for comments and activity, or have them all in the same file
darthShadow commentedon Jul 4, 2023
@ncw Is there anything further pending from this ticket?
I believe backend-specific metadata implementations should have their own tickets as & when required and there is already a separate ticket for tracking folder metadata: #6685
ncw commentedon Jul 4, 2023
Yes I agree that this issue is done and that new issues for metadata support for individual backends should be opened as required.
I'll close this now.
fs: implement optional Metadata interface for Objects rclone#111
s3: implement reading and writing of metadata rclone#111
local: add Metadata support rclone#111
s3: fix --s3-no-head panic: reflect: Elem of invalid type s3.PutObjec…
s3: fix --s3-no-head panic: reflect: Elem of invalid type s3.PutObjec…
s3: when copying from s3 to s3, preserve metadata rclone#111