Skip to content

ACD: store modified date (modtime) in object metadata #371

Closed

Description

@left1000

it seems at least by default rclone/amazon's own products will result in every file on the cloud drive having it's date modified data set to the date uploaded.

This is basically useless for sorting anything, since the date I choose to sync is pretty arbitrary but the date I create/edit my local files often has important meaning in terms of the order I want things stored.

is this something rclone has control over? or something entirely the doing of ACD?

If I do a restore from ACD to my computer for example my date created will end up being the date I did the download from ACD and date modified will be the date I uploaded to ACD in the first place... neither will be the date I originally created/edited the original file before uploading it. If I'm going to use ACD as another harddrive it'd be nice if it treated my files like my real harddrives do, and not edit the metadata when I re-organize things.

Activity

  1. ncw commented on Feb 25, 2016

    @ncw
    Member

    As far as I know it isn't possible to set the modified date via the public API. Some storage systems can and some can't - see the table here

    http://rclone.org/overview/

    Here is a thread on the developers forum about setting modified date

    https://forums.developer.amazon.com/forums/thread.jspa?threadID=8762&tstart=0

    As you can see there is a possibility of setting the date in additional metadata on the object. This wouldn't show in the ACD web interface but would enable rclone to save and restore the modified date.

    I'll mark this ticket as an enhancement to implement that feature.

  2. changed the title [-]is there anyway to make rclone store my computer's file's original date modified data for ACD?[/-] [+]ACD: store modified date in object metadata[/+] on Feb 25, 2016
  3. left1000 commented on Feb 25, 2016

    @left1000
    Author

    thanks for the quick response!

  4. added this to the milestone on Jul 15, 2016
  5. lsching17 commented on Sep 14, 2016

    @lsching17

    There is a pulling request on acd_cli on implementing modification time support, and the modification time is stored in xattr, will this help?

    yadayada/acd_cli@db9f9b0

  6. changed the title [-]ACD: store modified date in object metadata[/-] [+]ACD: store modified date (modtime) in object metadata[/+] on Dec 16, 2016
  7. ncw commented on Dec 16, 2016

    @ncw
    Member

    @felixbuenemann do you fancy working out how the official client manages to store the modification time? There isn't a documented API for it... To be most useful to rclone you'd need to be able to set the modification time (patch an existing object).

    The next best idea I can think of is to use a label - say "Date: " which can be uploaded and patched.

  8. felixbuenemann commented on Dec 16, 2016

    @felixbuenemann
    Contributor

    @ncw Do you have any concrete data that the official client does store modification time? I noticed that the node metadata contains both a createdDate and modifiedDate in ISO 8601 format, however I think these mark the time a node was created or modified in the ACD node database.

    If I use the automatic folder sync of the current mac client neither original file modification times are stored during upload nor is the creation or modification date from the node's metadata restored on download.

    I did try and delete (aka "move-to-trash" a node) and then restore it and that caused the node's modifiedDate to be updated.

    However looking at the docs for the REST API list the field contentDate inside the contentProperties hash of a node's metadata, which is listed as:

    date extracted from media types (images and videos) (ISO8601 date with timezone offset), # over-writable

    Given the comment overwritable this could likely be abused to store the modification time.

    I tried to create a node with custom contendDate inside the metadata and this worked, however the contentProperties of existing files can not be modified using a PATCH request.

    If you want to be able to change the stored file modification time of existing nodes your best bet is probably to use app specific properties, which can be specified both during node creation and patched later.

    Example:

    curl -si -X PATCH 'https://cdws.eu-west-1.amazonaws.com/drive/v1/nodes/TpLVXlr5Ng2rE-KNkiZd4g' \
      -H "Authorization: Bearer $TOKEN" \
      --data '{"properties":{"rclone-A37JWH9HBFO862":{"date": "2016-12-16T17:51:38.046Z"}}}'
    

    This will however be application specific, because the key in the properties hash is the appid and you cannot modify another apps properties.

    If you want the data to be interoperable between different clients like acd_cli and rclone than using a label like "DATE:2016-12-16T17:51:38.046Z" would work, as you suggested above.

  9. pedrosimao commented on Jan 6, 2017

    @pedrosimao

    @felixbuenemann So is it now possible to preserve the timestamps? I am using the last version of rclone and it is still deleting all the original timestamps...

  10. felixbuenemann commented on Jan 11, 2017

    @felixbuenemann
    Contributor

    @pedrosimao No, I just wrote how it could be implemented.

  11. pedrosimao commented on Jan 12, 2017

    @pedrosimao

    @felixbuenemann So, any idea why it is still not implemented?

  12. ajkis commented on Jan 15, 2017

    @ajkis

    Hopefully soon :)

  13. modified the milestones: v1.37, on Mar 4, 2017
  14. modified the milestones: Soon, v1.37 on Jun 28, 2017
  15. ncw commented on Jan 14, 2020

    @ncw
    Member

    I'm going to close this since rclone no longer has any ACD keys and Amazon aren't issuing new ones.

  16. modified the milestones: Soon, Help Wanted on Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions