Skip to content

Commit

Permalink
docs: 补充文档
Browse files Browse the repository at this point in the history
  • Loading branch information
Wxh16144 committed Sep 6, 2024
1 parent 3333d3b commit 76dc09b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.en_US.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,27 @@ name = Git
; Directories or files to be synchronized, concatenated from $HOME
[configuration_files]
.gitconfig_work

; XDG configuration file, concatenated from $XDG_CONFIG_HOME
; see: https://specifications.freedesktop.org/basedir-spec/latest
[xdg_configuration_files]
git/config
```

## Advanced

### Forced Restore

When using `backup-cli -r` to restore backups, the `--force` option does not bypass confirmation prompts even when set to force overwriting files. This is due to security and data integrity considerations; by default, backups are not overwritten without user consent.

- **Tip**: You can enforce a restore operation by setting the environment variable `BACKUP_FORCE_RESTORE = true`. However, it's important to note that this still requires using the `--force` argument in your command.

### Restoring Another's Backup

When attempting to restore files from backup directories into your `$HOME` directory, the issue might arise because their `$HOME` directories may differ from yours. Direct restoration would fail due to these differences.

- **Tip**: To successfully restore another person's backups, you can set the environment variable `BACKUP_UPSTREAM_HOME={theirs HOME directory}` in your command. This specifies where each file should be placed upon restoration, ensuring they are correctly located on your system.

## Who is Using

- [Wxh16144's Dotfiles](https://github.com/Wxh16144/dotfiles)
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,27 @@ name = Git
; 要同步的目录或文件, 从 $HOME 开始拼接
[configuration_files]
.gitconfig_work

; XDG 配置文件, 从 $XDG_CONFIG_HOME 开始拼接;
; see: https://specifications.freedesktop.org/basedir-spec/latest
[xdg_configuration_files]
git/config
```

## 高级用法

### 强制还原

`backup-cli -r` 还原备份时使用 `--force` 无法强制覆盖文件(还是会进行二次确认)。因为数据是宝贵的,所以默认不会覆盖。

- **tips**: 你可以通过设置 `BACKUP_FORCE_RESTORE = true` 环境变量来强制还原。(还是需要加上 `--force` 参数)

### 还原他人的备份

还原备份目录中的文件到 `$HOME` 目录,但是他人的 `$HOME` 目录可能和你的不一样,所以不能直接还原。

- **tips**: 你可以通过设置 `BACKUP_UPSTREAM_HOME={别人的HOME目录}` 环境变量来还原他人的备份。

## 谁在使用

- [Wxh16144's Dotfiles](https://github.com/Wxh16144/dotfiles)
Expand Down

0 comments on commit 76dc09b

Please sign in to comment.