Executing batches of commands using redis cli
Using heredoc works well here, if you don’t want to use echo or explicitly add \n or create a new file
redis-cli <<EOF
set foo bar
get foo
EOFOK
"bar"Backup
redis-cli CONFIG get dir1) "dir"
2) "/var/lib/redis"redis-cli SAVEOKThis will create a dump.rdb file in Redis directory (/var/lib/redis).
Restore
Move dump.rdb into Redis directory and start the server