antirez/redis — Issue #341: aof & rdb directories
Author: burns
Created: 2012-02-19 05:31:54+00:00
State: open

I'd like to see configuration options for separately setting the base directories for `dbfilename` and `appendfilename`, as opposed to both of these using the working directory set by `dir`.

My purpose for this is to be able to perform a BGSAVE and have the dump.rdb created on a separate physical volume from the aof file.
I can set `dbfilename` to an absolute path, however the temp file used for this is using the working dir, which defeats my purpose to an extent :) (The same is true for an aof rewrite.)

Looking at this, it seems the best solution would be to have a `aof-dir` and `rdb-dir` option in the config, which would simply default to `dir` if not set. Then, `rdbSave`, `rdbRemoveTempFile`, etc... as well as `rewriteAppendOnlyFile[Background]`, `aofRemoveTempFile`, etc... could all use a `server.[rdb,aof]_dir` variable. Then these file operations could be done using full paths instead of relying on paths relative to the working directory.