2

I am using redis-cli pipe for mass insertion data from file into redis. The output is as follow: All data transferred. Waiting for the last reply... Last reply received from server. errors: 0, replies: 8

MY problem is when redis throws error while processing a file i am only able to see error, not a line number. It is tedious to know which line number is causing the error.

Is there any way how can i know line number of a file or a way to modify the code.

Please help me on this.

Arti Negi
  • 81
  • 6
  • you can execute the commands one by one by doing something like `cat commands.txt | redis-cli`. This will be slower of course but you'll be able to stop when you want. Also, it should be trivial to write a python script to achieve that , and have much finer control. – Not_a_Golfer Dec 12 '16 at 14:54
  • As I have lots of data, executing command one by one will take longer time. I need to store data in some files so that data can be recovered at any time of failure. As redis-cli --pipe is very fast, it will be great to use that. – Arti Negi Dec 12 '16 at 17:46
  • using redis-cli like cat commands.txt | python gen_redis_proto.py | redis-cli and large amount data is transferred in very less time. I need solution with redis-cli pipe.... – Arti Negi Dec 12 '16 at 17:47
  • 1
    just write your own script in python using pipelines, it will take probably 10 lines of code – Not_a_Golfer Dec 12 '16 at 18:56
  • I already have created a script with python pipeline. Its working fine. Are redis-cli --pipe command and python redis pipeline(API) different or same. For me it seems different as they are taking different time to execute same piece of code. – Arti Negi Dec 13 '16 at 09:53

0 Answers0