this is a problem specifically related to running redis cli inside the cron job.
Pieter hacked about this issue recently, so I'll lave the reply to him ;)
Thanks for reporting.
Cheers,
Salvatore
> --
> 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.
>
--
Salvatore 'antirez' Sanfilippo
http://invece.org
"We are what we repeatedly do. Excellence, therefore, is not an act,
but a habit." -- Aristotele
Yes, this makes sense and should be done indeed...
Cheers,
Salvatore
There were numerous issues with redis-cli and reading from STDIN. The
initial idea to make it as unix-intuitive as possible (e.g. reading
from a pipe when there is a pipe). Unfortunately, this appeared to
have unexpected consequences when run from scripts (or cron for that
matter), where redis-cli would block waiting for data from a pipe,
when there was none. To circumvent this, we've (re-)added a flag to
redis-cli that tells it to read the last argument from STDIN. Now,
adding the -x option will read from STDIN instead of it being
automatically (thus sometimes falsely) detected.
Example:
2.0.0: "echo /proc/cpuinfo | redis-cli set cpuinfo" would detect the
pipe when run from a tty, but otherwise it would block.
2.0.1: "echo /proc/cpuinfo | redis-cli -x set cpuinfo" will never
block because you must supply the -x flag.
So, earlier, you had to "echo BGREWRITEAOF | redis-cli", because it
was trying to read from STDIN in the cron. Now, reading from STDIN
requires an extra flag, so you can simply issue "redis-cli
BGREWRITEAOF".
Cheers,
Pieter
> So, earlier, you had to "echo BGREWRITEAOF | redis-cli", because it
> was trying to read from STDIN in the cron. Now, reading from STDIN
> requires an extra flag, so you can simply issue "redis-cli
> BGREWRITEAOF".
Thank you Pieter.
This was my idea as well. Julien can you please confirm that you were
using not the latest version?
Cheers,
Salvatore
--
Salvatore 'antirez' Sanfilippo