@wuxh/backup-cli
v1.8.0
Published
> 备份你的配置文件和目录 [为什么重复创造轮子?](https://github.com/lra/mackup/issues/1849#issuecomment-1369963734),[lra/mackup#1969](https://github.com/lra/mackup/discussions/1969)。
Downloads
6
Readme
@wuxh/backup-cli
备份你的配置文件和目录 为什么重复创造轮子?,lra/mackup#1969。
简体中文 | English | Bilibili#BV1dL411D7kh
安装
npm i @wuxh/backup-cli -g
使用
备份
backup-cli
还原
backup-cli -r
支持的应用程序
backup-cli -l
查看配置
backup-cli -c
CLI 命令
使用 backup-cli -h
查看最新的使用说明:
npx @wuxh/backup-cli [options]
----------------------------------------
-l, --list: list all apps.
-f, --force: force to backup (overwrite files).
-c, --config: view config.
-r, --restore: restore backup.
-h, --help: show help.
-d, --debug: show debug info.
-v, --version: show version. vx.x.x
----------------------------------------
e.g. backup-cli -h
Config
默认使用
$HOME/.backuprc
作为配置文件,也可以通过设置BACKUP_CONFIG_FILE
环境变量自定义其他位置。
[storage]
; 备份路径, 默认: 执行命令当前目录
path = $PWD
; 备份目录, 默认: backup
directory = backup
; 同步的应用程序, 默认同步全部
[applications_to_sync]
zsh
; 忽略某一个应用程序, 默认为空
[applications_to_ignore]
git
自定义应用程序
定义
[application name].cfg
配置文件,并放在$HOME/.backup
根目录中,你可以通过设置BACKUP_CUSTOM_APP_DIR
环境变量自定义其他目录。
[application]
name = Git
; 要同步的目录或文件, 从 $HOME 开始拼接
[configuration_files]
.gitconfig_work
谁在使用
贡献&调试
- 克隆项目后使用
pnpm
安装依赖
git clone [email protected]:Wxh16144/backup-cli.git && cd backup-cli \
&& pnpm install
之后可以在 VSCode 中按下 F5
进行 debugger, launch.json