0

I'm running

save 600 1 

On my redis-cli to save every 10 minutes if at least 1 key has changed, however it's giving me:

(error) ERR wrong number of arguments for 'save' command 

I'm taking this example from redis's official website here: http://redis.io/topics/persistence

What am I doing wrong?

1 Answer 1

7

You are confusing, understandably, two types of saves.

save 600 1 is a Redis configuration directive - it can be specified in the .conf file or via the CONFIG SET command. This directive controls the automatic background snapshotting of data as explained.

On the other hand, Redis also offers the SAVE command (no arguments) that can be invoked via the cli or any client. This command causes Redis to save the dataset while blocking other operations.

Note: since SAVE is a blocking command you are advised against using it in production.

Sign up to request clarification or add additional context in comments.

4 Comments

Thank you for clearing that up! Appreciate it. Used CONFIG SET and everything is wrong fine. Is there a way I can use BGSAVE like SAVE in config file?
I assume you mean that everything is working fine - good. The save config directive, when triggered, in fact does a non-blocking BGSAVE.
Yes, that's what I mean, was tired...late at night. Awesome, good to know, thanks for your help again!
Note that if doing this on command line you have to quote the arguments e.g. config set save "600 1"

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.