2 个版本
0.1.1 | 2023 年 1 月 23 日 |
---|---|
0.1.0 | 2023 年 1 月 22 日 |
#7 in #glacier
27KB
669 行
sab
sab
是一个简单的备份工具,使用 AWS S3
- 简单界面上传/下载备份归档
- 多个配置文件
- 加密和压缩
STANDARD
和DEEP_ARCHIVE
(Glacier)存储类别- 在发生短暂故障的情况下,可以从上次上传的块恢复上传
安装
cargo安装 sab
用法
创建配置文件
$ sab init
S3 Access Key: MY-ACCESS-KEY
S3 Secret Key: MY-SECRET-KEY
S3 Region [us-east-1]:
Bucket Name: my-backups
Bucket Prefix for Backups []: laptop/
Enable Encryption? [true]:
上传文件
$ sab upload backup.tar.bz2 -s 50MB
[2023-01-22T05:09:24Z INFO sab::cli::cmd_upload] starting upload laptop/backup.tar.bz2
[2023-01-22T05:09:24Z INFO sab::cli::cmd_upload] creating new configuration
[2023-01-22T05:09:51Z INFO sab::cli::cmd_upload] uploaded chunk=1 orig-size=50000000 processed-size=50000040 progress=30.16%
[2023-01-22T05:10:17Z INFO sab::cli::cmd_upload] uploaded chunk=2 orig-size=50000000 processed-size=50000040 progress=60.31%
[2023-01-22T05:10:45Z INFO sab::cli::cmd_upload] uploaded chunk=3 orig-size=50000000 processed-size=50000040 progress=90.47%
[2023-01-22T05:10:53Z INFO sab::cli::cmd_upload] uploaded chunk=4 orig-size=15805568 processed-size=15805608 progress=100.00%
[2023-01-22T05:10:53Z INFO sab::cli::cmd_upload] upload completed
列出备份
$ sab list
* laptop/backup.tar.bz2
下载备份
$ sab download backup.tar.bz2
[2023-01-22T05:13:20Z INFO sab::cli::cmd_download] starting download
[2023-01-22T05:13:32Z INFO sab::cli::cmd_download] downloaded chunk=1 size=50000000 progress=30.16%
[2023-01-22T05:13:45Z INFO sab::cli::cmd_download] downloaded chunk=2 size=50000000 progress=60.31%
[2023-01-22T05:13:58Z INFO sab::cli::cmd_download] downloaded chunk=3 size=50000000 progress=90.47%
[2023-01-22T05:14:02Z INFO sab::cli::cmd_download] downloaded chunk=4 size=15805568 progress=100.00%
[2023-01-22T05:14:02Z INFO sab::cli::cmd_download] backup successfully downloaded
注意,如果在上传备份时使用了 DEEP_ARCHIVE
存储类别,则需要在 AWS 中将文件恢复,才能下载。
依赖项
~50MB
~862K SLoC