{"id":21471838,"url":"https://github.com/brianredbeard/memcache-tools","last_synced_at":"2025-07-15T08:31:30.335Z","repository":{"id":15801388,"uuid":"18540831","full_name":"brianredbeard/memcache-tools","owner":"brianredbeard","description":"A set of tools for dumping and restoring memcached data","archived":false,"fork":false,"pushed_at":"2014-04-08T04:46:12.000Z","size":124,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T00:41:31.401Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brianredbeard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-08T01:28:02.000Z","updated_at":"2023-05-21T13:58:53.000Z","dependencies_parsed_at":"2022-09-14T13:01:21.270Z","dependency_job_id":null,"html_url":"https://github.com/brianredbeard/memcache-tools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brianredbeard/memcache-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianredbeard%2Fmemcache-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianredbeard%2Fmemcache-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianredbeard%2Fmemcache-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianredbeard%2Fmemcache-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianredbeard","download_url":"https://codeload.github.com/brianredbeard/memcache-tools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianredbeard%2Fmemcache-tools/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265419694,"owners_count":23761858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T09:45:55.994Z","updated_at":"2025-07-15T08:31:30.105Z","avatar_url":"https://github.com/brianredbeard.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Memcached Tools\n## About\nThis is a utility container designed to perform dump and restore of memcached\ndata.  \n\n\n## Usage\n\nThis cointainer takes (at a minimum) one environment variable, \n`MEMCACHED_SERVERS`.  This value should be a string of the form \"host:port\"\n\nAdditionally, this container can make use of the **link** feature of Docker\nleveraging a destination value of `MC`.  Examples are shown below.  There are\nthree primitives available to the container:\n- dump - Dump all data in the remote memcached server to /tmp/memcache\n- load - Load all data from the path /tmp/memcache to the remote memcached server\n- sample - Generate 899 sample keys of the form mykeyXXX and add them to the server\n\n```\n$ mkdir /tmp/test\n$ docker run --rm -e MEMCACHED_SERVERS=192.168.1.101:11211 -v /tmp/test:/tmp/memcache brianredbeard/memcache-tools dump\n```\n\n## Examples\n\nIn this example we will create a memcached container, load it with sample data,\nverify we can see the values, flush the cache, reload our data, and finally\nverify that the values match.\n\n### Install the memcached server:\n\n```\n$ docker run -p 11211 -d --name memcached jacksoncage/memcache\n```\n\n### Load sample data into the container, utilizing a docker link\n\n```\n$ mkdir /tmp/test\n$ docker run --rm --link memcached:mc -v /tmp/test:/tmp/memcache brianredbeard/memcache-tools sample\n```\n\n### Verify that the data is there\n\n```\n$ docker ps \nCONTAINER ID        IMAGE                         COMMAND             CREATED             STATUS              PORTS                      NAMES\nf053e93d69e2        jacksoncage/memcache:latest   bash start.sh       44 seconds ago      Up 41 seconds       0.0.0.0:49154-\u003e11211/tcp   memcache  \n$ telnet 127.0.0.1 49154\nTrying ::1...\nConnected to localhost.\nEscape character is '^]'.\nstats items\nSTAT items:3:number 899\nSTAT items:3:age 10\nSTAT items:3:evicted 0\nSTAT items:3:evicted_nonzero 0\nSTAT items:3:evicted_time 0\nSTAT items:3:outofmemory 0\nSTAT items:3:tailrepairs 0\nSTAT items:3:reclaimed 0\nSTAT items:3:expired_unfetched 0\nSTAT items:3:evicted_unfetched 0\nEND\nget mykey600\nVALUE mykey600 1 49\n(dp1\nS'lang'\np2\nS'python'\np3\nsS'value'\np4\nI448\ns.\nEND\n```\nHere we see that on slab 3 we have 899 values in the cache and that the key\n**mykey600** has the integer value *448* stored inside it's object.\n\n### Dump the contents of the cache\n\n```\n$ docker run --rm --link memcached:mc -v /tmp/test:/tmp/memcache brianredbeard/memcache-tools dump\n```\n\nYou will find that in /tmp/test there will be 899 files, each with the name of\na key.  The contents of each file correlate to the respective key on the \nmemcached server.\n\n### Flushing the memcached cache\n\n```\n$ telnet 127.0.0.1 49154\nTrying ::1...\nConnected to localhost.\nEscape character is '^]'.\nflush_all 1\nOK\nget mykey600\nEND\n```\n\nThis sets all values to immediately have a one second TTL, effectively expiring\nthe entire cache.  Attempting to retrieve the value of **mykey600** results in \nno data returned.\n\n### Reload our sample data\n\n```\n$ docker run --rm --link memcached:mc -v /tmp/test:/tmp/memcache brianredbeard/memcache-tools load\n```\n\nAt this point our data should be reloaded.\n\n### Verification of data\n```\n$ telnet 127.0.0.1 49154\nTrying ::1...\nConnected to localhost.\nEscape character is '^]'.\nget mykey600\nVALUE mykey600 1 49\n(dp1\nS'lang'\np2\nS'python'\np3\nsS'value'\np4\nI448\ns.\nEND\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianredbeard%2Fmemcache-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianredbeard%2Fmemcache-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianredbeard%2Fmemcache-tools/lists"}