带加密的增量永久数据归档器
serac的Python项目详细描述
带加密的增量永久数据存档器。在
设计用于永久备份不经常更改的数据, 适用于只写存储,如亚马逊冰川。在
使用
必须始终以配置文件路径作为第一个参数运行Serac,然后 作为第二个参数执行的命令。在
运行serac:
/path/to/venv/bin/serac CONFIG COMMAND [OPTIONS]
从cron作业运行Serac是安全的;它不允许多个进程工作 同时使用相同的配置文件。在
命令
之后,它接受以下命令之一:
- test
- 测试配置文件
- init
- 通过创建数据库为新配置初始化索引
- archive
- 存档自上次存档以来的所有更改
- ls [--at=DATE][--pattern=PATTERN]
显示存档的状态。在
它遵循与ls -l大致相同的布局,如下所示 列:
- File permissions
- Owner (as it will be restored to on this system)
- Group (as it will be restored to on this system)
- Size (in kibi/mebib/gibibytes, or in bytes if not specified)
- Last modified date (this year if not specified)
- Last modified timestamp (for ease of use in calls to ^{tt6}$ and ^{tt7}$)
- Path (as it was on the originating system)
- restore DESTINATION [--at=DATE][--pattern=PATTERN]
还原部分或全部存档
如果存档的对象在冰川中,它将被标记为检索。在
参数
- DATE
这应该是以下格式之一的日期:
- epoch时间戳,例如1582165202
- YYYY-MM-DD,例如2020-02-20
- YYYY-MM-DD HH:MM:SS,例如2020-03-20 02:20:02
- YYYY-MM-DDTHH:MM:SS,例如2020-03-20T02:20:02
- PATTERN
这可以是文件的精确路径,也可以是指向 目录。在
还不支持Globs。在
配置
使用配置文件配置serac:
[source] # Define the source for the backups # List of paths to include and exclude (glob patterns) include = /path/to/source /path/somewhere/else exclude = /path/to/source/unprocessed /path/somewhere/else/*.jpg [archive] # Define where the backups are saved # Backup to a local path #storage = local #path = /path/to/backup # Backup to S3 storage = s3 key = 4p1_k3y secret = 53cr3t bucket = arn:aws:s3:::my_bucket_name path = path/within/bucket # Encrypt backups with this password password = l0ng_s3cr3t [index] # Define how indexed files are treated # Location for index database # This should then be backed up by another service, eg duplicity path = /path/to/index.sqlite
贡献
要使用serac,请将其安装在虚拟环境中:
mkdir serac cd serac git clone <path-to-repo> repo virtualenv --python=python3.7 venv . venv/bin/activate pip install pip-tools cd repo pip-sync
在开发过程中运行:
python -m serac CONFIG COMMAND [OPTIONS]
要运行测试:
cd serac/repo . ../venv/bin/activate pytest
变更日志
0.0.3,2019年10月12日
错误修复:
- 正确的入口点
0.0.2,2019年9月25日
特点:
- 添加进程锁定
0.0.1,2019年9月23日
特点:
- 初次发行
- 项目
标签: