redis-move.rst (Источник)

.. tags: python, redis, script
.. title:

Скрипт для переноса ключей между базами redis

.. listing:: python

Пример использования:

.. code-block:: console

   eking@eking:~$ time python 
   Usage: [options] keymask 

   Script for move keys via redis DB

    -h, --help  show this help message and exit
    --fh=FH     from host; default
    --fp=FP     from port; default
    --th=TH     to host; default
    --tp=TP     to port; default 6379
    --fd=FD     from DB; default 0
    --td=TD     to DB; default 0
    -t T        timeout for MIGRATE command; default 1000
    -p P        number of processes; default 32

   eking@eking:~$ time python --fh='' --th='' "*000000"

   Found 3 keys, migrating...

   real 0m0.989s
   user 0m0.032s
   sys  0m0.024s