GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - git-hulk/rdbtools: rdb parser tools for redis, implemented in C, use lua to format key-value.

This repository was archived by the owner on May 9, 2022. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

116 Commits
116 Commits

Folders and files

NameName
Last commit message
Last commit date
deps/lua
deps/lua
 
 
scripts
scripts
 
 
snapshot
snapshot
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 

Repository files navigation

rdbtools Build Status

A tool use c to analyze redis rdb file, and use lua to handle.

Notice: This tools was tested on 2.2 , 2.4 , 2.6, 2.8

bugs in other versions? open issues, I will fix it, thanks~

1. What about this tool to do?

use lua to parse rdb file to user's format data, like aof file, json etc.

2. How to use?

$ cd rdbtools/src
$ make
$ ./rdbtools -f ../tests/dump2.4.rdb -s ../scripts/example.lua

NOTE: Compile error with readline.h is not found, just use yum or apt-get to install readline and readline-devel

3. Options

USAGE: ./rdbtools [-f file] -V -h
    -V --version 
    -h --help show usage 
    -f --file specify which rdb file would be parsed.
    -s --file specify which lua script, default is ../scripts/example.lua

If you want to handle key-value in rdb file, you can use -s your_script.lua, and lua function handle will be callbacked.

Example can be found in scripts/example.lua, and it just print the key-value.

Json format example

cat scripts/json_exapmle.lua

local cjson = require "cjson"

function handle(item)
     print(cjson.encode(item))
end     

And result is below: image

4. Params in handle function

function handle(item)
 --item.type, value may be string, set, zset, list, or hash.
 --item.expire_time, key expire time .
 --item.value, may be string or list or hash, it depends on item.type
end

5. Environment

If you what to know rdb version and which db is selcted.

print(env.version)
print(env.db_num)

6. Contact me?

Sina Weibo: @改名hulk

Gmail: [email protected]

Blog: www.hulkdev.com

any bugs? send mail, and I will appreciate your help.

About

rdb parser tools for redis, implemented in C, use lua to format key-value.

Resources

Readme
MIT license
Activity

Stars

44 stars

Watchers

1 watching

Forks

14 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.