redis dump.rdb/保存小文件 [英] redis dump.rdb / saving small files

查看:112
本文介绍了redis dump.rdb/保存小文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  • 我正在使用 redis.数据库是<100 MB.
  • 但是,我想每天进行备份.
  • 我也在 Ubuntu Server 12.04 上运行

输入时:

redis-cli 保存

我不知道 dump.rdb 保存到哪里(因为 redis 是作为服务启动的,而不是在我的本地目录中).

I don't know where dump.rdb is saved to (since redis is started as a service and not in my local directory).

  1. 如何找到 redis 将 dump.rdb 保存到的位置?

  1. How do I find where redis is saving my dump.rdb to?

有什么办法可以指定一个文件名来保存",所以我输入如下内容:

Is there someway that I can specify a filename to 'save', so I type in something like:

redis-cli 保存 ~/db-2012-06-24.rdb

redis-cli save ~/db-2012-06-24.rdb

谢谢

推荐答案

您可以在 redis.conf 文件(启动服务器时使用的)上设置文件位置查看服务器配置:

You can set the file location on the redis.conf file (which you start the server with) look at the server configuration for that:

# The filename where to dump the DB
dbfilename dump.rdb

找到当前保存文件的位置,这取决于你如何启动服务器——你有 redis-server 文件的位置——我想你可以用 ps -e aux | 找到它grep redisps -e |grep redis

finding the location of the currently saved file, it depends on how you start the server - where you have the redis-server file - i think you can find it with ps -e aux | grep redis or ps -e | grep redis

这篇关于redis dump.rdb/保存小文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆