使用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限制C++代码访问JNI中的某些类   Android上的java DateFormat:不可解析的日期   通过json进行java迭代,并为其他请求调用多个API   Netbeans中的java JavaFX项目引发异常“输入流不能为null”   多线程Java newFixedThreadPool解释   |在java字符串中无法识别。split()方法   Java中的原始包装器类是否被视为引用类型?   Java swing。如何在intellij idea GUI设计工具中重写组件方法   数组乘矩阵   java将30GB的XML文件分割成小块XML   java通过一棵树递归找到一个节点,并返回指向该节点的路径   java如何将可观察的<Observable<List<T>>转换为可观察的<List<T>>   使用java在web服务器上更改php文件中的字符串?   java希望开发像tomcat这样的servlet容器   java希望提高编程的数学技能