Create rExport.c

db set to '1'
connects to 127.0.0.1:6379

(pipe output to file)