Context
- 我正在使用redis。数据库小于 100 MB。
- 但是,我想进行每日备份。
- 我也在 Ubuntu Server 12.04 上运行
当输入:
redis-cli save
我不知道 dump.rdb 保存到哪里(因为 redis 作为服务启动,而不是在我的本地目录中)。
问题:
-
如何找到 redis 将 dump.rdb 保存到的位置?
-
有什么办法可以指定一个文件名来“保存”,所以我输入如下内容:
redis-cli保存~/db-2012-06-24.rdb
Thanks
更有帮助...如何查找或设置 redis 保存 dump.rdb 文件的位置(ubuntu 服务器):
首先找到你的 redis.conf 文件:在终端中运行:
ps -e aux | grep redis
我在以下位置找到了我的 redis.conf 文件:
var/etc/redis/
如果您的位置相同,则使用以下命令打开文件:
pico var/etc/redis/redis.conf
寻找:
# The filename where to dump the DB
dbfilename dump.rdb
# The working directory.
#
# The DB will be written inside this directory, with the filename specified
# above using the 'dbfilename' configuration directive.
#
# Also the Append Only File will be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
dir /var/lib/redis
根据您对“dbfilename”和“dir”的设置,您可以在其中找到 redis dump.rdb 文件。
Update:
要查看您的 redis 配置,只需运行:
redis-cli CONFIG GET *
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)