使用redis提供可选密码保护和压缩的网络文件存储和检索

NetFetch的Python项目详细描述


具有可选密码保护和使用redis压缩的网络文件存储和检索。

文件以原始主机名的键和文件名的绝对路径存储。

文件可以用密码存储,在密码中对文件进行加密,并且必须使用相同的密码来检索数据。

存储

使用netfetchput存储文件。

Usage: netFetchPut (options) [absolute filename]

Stores a given file in NetFetch, optionally password-protecting it as well.

选项:

–password Prompt for password on storing this file

–password-file=fname Read password from a given filename instead of tty. Implies –password.

–no-preserve Do not store owner/group/mode information

–config=/path/x.txt Use provided config for redis. Default is to look in /etc/netfetch.cfg

–compress(=mode) Compress the file data for storage (and decompress after fetch).

Default compression mode is lzma.

Use just –compress for this default mode.

You can specify an alternate mode by appending =MODE after –compress.

Supported modes are: ‘lzma’ (aka xz) ‘gzip’ ‘bzip2’

提供的文件名被视为绝对路径。您可以使用相对路径,但它将被展开

to absolute for storage. Upon fetch, you can use the same relative path, so long as it resolves

to the same absolute location. It is safest to just specify an absolute path yourself.

示例:netfetchput/data/myfile.db

检索

使用netfetchget检索文件

Usage: netFetchGet (options) [hostname] [filename] [output filename]

Downloads a file uploaded from hostname, given an absolute filename.

If “output filename” is “–”, output will be to stdout.

Options:

–password Prompts for password. If file is encrypted, a password must be provided.

–password-file=fname Read password from a given filename instead of tty. Implies –password.

–no-preserve Do not apply stored attributes (owner/group/mode)

–config=/path/config.cfg Use provided config for redis. Default is to look in /etc/netfetch.cfg

提供的文件名被视为绝对路径。您可以使用相对路径,但它将被展开

to absolute for storage. Upon fetch, you can use the same relative path, so long as it resolves

to the same absolute location. It is safest to just specify an absolute path yourself.

示例:netfetchget filestore01/data/myfile.db

删除

使用netfetchdelete删除文件

Usage: netFetchDelete (options) [hostname] [filename]

Deletes a NetFetch file off of provided hostname.

Options:

–config=/path/config.cfg Use provided config for redis. Default is to look in ~/.netfetch.cfg then /etc/netfetch.cfg

提供的文件名被视为绝对路径。您可以使用相对路径,但它将被展开

to absolute for storage. Upon fetch, you can use the same relative path, so long as it resolves

to the same absolute location. It is safest to just specify an absolute path yourself.

示例:netfetchdelete filestore01/data/myfile.db

配置

要连接的redis服务器由配置文件指定。如果未提供–config=/path/to/netfetch.cfg,应用程序将首先检查$home/.netfetch.cfg,然后检查/etc/netfetch.cfg。

配置示例:

[redis]

host=127.0.0.1

port=6379

db=1

压缩

从3.0版开始,netfetch支持压缩。这在netfetchput期间由“–compress”标志提供。

默认的压缩模式是lzma(也称为“lz”)。要使用不同的压缩模式,请指定“–compress=mode”,其中mode是lzma/xz、gzip/gz、bzip2/bz2之一。

压缩只需要在输入时指定,get会自动检测到哪个模式并解压缩结果。

向后不兼容的更改

3.0版需要indexedredis>;5.0.0和<;7.0.0。如果必须使用低于5.0.0的版本,请使用版本2.0.3。

3.0使用的数据格式与2.0版数据格式兼容,但已放弃对1.x格式的支持。今后的一切都应该向前兼容所有未来的版本。

版本2.0将存储格式更新为更高效的形式(直接存储而不是base64编码/解码)。这使得一切变得更快,占用的空间更少,但与2.0之前的版本不兼容。要使用旧格式获取/放置文件,请对netfetchget/netfetchput使用“–old format”。

要迁移,请使用“–old format”获取任何文件,然后在没有该标志的情况下将其存储回。由于加密原因,没有自动实用程序。

版本2.0还依赖于至少版本2.9.0的IndexedRedis

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java的目标是从我的项目中删除不起作用的文件   java对for循环的理解   java我完成了在作业要求的位置查找字符的部分,但是如何从我找到的字符串中删除字符呢?   基于帧时的java动画   java请求无效。缺少XGoogUploadCommand标头   java如何在viewsource模式下使用openStream?   grpc grpc_ARG_KEEPALIVE_PERMIT_而不调用java服务器?   java如何通过Junit测试Web服务调用   如何在java中获取鼠标中键?   使用junit在spring测试中加载属性文件   Java中用于类的类修饰符   java多色文本图像   sql无法调试Java中的“连接到数据库失败”异常   java如何指定hibernate连接映射?   java Android工具栏不显示   java仿射转换不同的图形对象   使用终端的java问题   Java在tomcat上查找127.0.0.1失败