Skip to content

Instantly share code, notes, and snippets.

@abperiasamy
Last active June 22, 2020 02:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abperiasamy/5b9f766d8cb5bc7c3b1990f9933ad989 to your computer and use it in GitHub Desktop.
Save abperiasamy/5b9f766d8cb5bc7c3b1990f9933ad989 to your computer and use it in GitHub Desktop.
MinIO Client - Time Machine

REWIND

Implement rewind as a global flag for all mc sub-commands.

  • List all objects at this prefix as of 4 days 2 hours 10 mins ago.

    mc ls PREFIX --rewind 4d2h10m

  • List all objects at this prefix exatly on at this time (RFC3339 format).

    mc ls TARGET --rewind 2011.11.16T22:30

  • List all objects and its versions as of 10 horus 20 mins ago.

    mc ls TARGET --rewind 10h30m --versions

  • Copy all objects as of 10 days ago from SOURCE.

    mc cp SOURCE TARGET --rewind 10d

SNAPSHOT

Create a snapshot of all the objects and its versions at a given point in time (now or past). Snapshot appear as its own self-contained virtual site.

  • Create a snapshot of this prefix as of now.

    mc snap create my-snap play/testbucket/prefix

  • Create a snapshot of this prefix as of 24 hours before.

    mc snap create my-snap play/testbucket/prefix --rewind 24h

  • List all snapshots.

    mc snap list

  • Explore contents of a snapshot.

    mc snap list my-snap

  • Explore contents of snapshot export file.

    mc snap list -f my-snap.snap

  • Remove a snapshot.

    mc snap remove my-snap

  • Export / import snapshots to share.

    mc snap export my-snap > mybackup.snap
    mc snap import my-snap < mybackup.snap
    
  • Copy from a snapshot.

    mc cp my-snap play/newbucket/prefix

  • Mirror from a snapshot.

    mc mirror my-snap play/newbucket/prefix

  • Error case.

    mc rm snapshotname/ (errors out, says use mc snap rm)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment