redis-cli command with argument for redis which needs authentication

10,155 views
Skip to first unread message

Sonali Palkar

unread,
Nov 9, 2011, 2:30:25 AM11/9/11
to redi...@googlegroups.com
Hi All:

I am using redis 2.4.1 server and I have set requirespass setting in redis.conf for authenticating any command sent to redis.

I want to run BGREWRITEOF command from my shell script. I use it as follows.

redis-cli -p 9736 BGREWRITEOF

But this command fails and I get error like 'Operation not permitted'. I know that the cause is a password. As I am not sending password it is not accepting this command.  But I do not know how to pass password in the above command where redis-cli command is getting executed with arguments.

If I run redis-cli without any argument it opens client console and then I can execute AUTH command first and then execute BGWRITEOF. But in my scenario where I want to execute BGWRITEOF via a script I am not able to find the way to authenticate redis.

Please help how this can be achieved.

Thank you.

--Sonali



Tian Fengjun

unread,
Nov 9, 2011, 3:04:33 AM11/9/11
to redi...@googlegroups.com
# redis-cli --help
.......
-a <password>    Password to use when connecting to the server
.......
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To post to this group, send email to redi...@googlegroups.com.
To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.
Reply all
Reply to author
Forward
0 new messages