
每个人都会积累一套自己习惯使用的 App。如果平时习惯使用 Time Machine 备份,那么在重装系统时,直接用它还原倒是一个不错的办法,不必再手动安装一个个 App。但是有些时候,我们可能想要一个更加「干净」的新系统,此时就需要依次手动安装。这显然不是个高效、省心的方法,可能还需要一个个回忆之前用的 App。这时候,我们往往希望有一份属于己的 App 清单,最好还能在重装时一键安装,省心省力。无论是 Windows 还是 macOS 下我们都希望实现一键装机,而 homebrew-bundle 正是这样一款 Mac 下的备份恢复利器。
macOS 使用 homebrew-bundle 优雅的备份和恢复软件列表
2018 年 11 月 07 日 - 初稿
阅读原文 - https://wsgzao.github.io/post/homebrew-bundle/
扩展阅读
定期自动云备份 macOS 软件列表,维护一份属于自己的必备 App 清单 - https://sspai.com/post/43265
狡兔三窟云备份软件列表与相应配置,补充 Time Machine - https://sspai.com/post/43479
macOS 自带的 Time Machine 无疑是备份与还原的利器。无论是重装系统,还是新机配置,Time Machine 用起来都十分方便、省心。但是它存在以下不足:
即使上述情况对你来说都不是问题,多一种备份方式也是多一份安全和保障。
Bundler for non-Ruby dependencies from Homebrew
homebrew-bundle - https://github.com/Homebrew/homebrew-bundle
备份列表包含:
# 执行 brew bundle dump 备份命令 brew bundle dump --describe --force --file="~/Desktop/Brewfile" # 参数说明 --describe:为列表中的命令行工具加上说明性文字。 --force:直接覆盖之前生成的 Brewfile 文件。如果没有该参数,则询问你是否覆盖。 --file="~/Desktop/Brewfile":在指定位置生成文件。如果没有该参数,则在当前目录生成 Brewfile 文件。 # 该命令会在桌面上生成 Brewfile 文件,双击打开查看,其内容类似于 ## 该部分是 brew 中的 tap,相当于一个个软件库 tap "homebrew/bundle" tap "homebrew/cask" ## 该部分是 brew 安装的命令行工具 # Mac App Store command-line interface brew "mas" # UNIX shell (command interpreter) brew "zsh" # Fish shell like syntax highlighting for zsh brew "zsh-syntax-highlighting" ## 该部分是 brew cask 安装的 app cask "mounty" cask "dteoh/sqa/slowquitapps" ## 该部分是 Mac App Store 安装的 app mas "ting_en", id: 734383760 mas "Xcode", id: 497799835 通过备份的软件列表文件批量安装软件
# 安装 Homebrew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" # 安装 mas brew install mas # 批量安装软件 brew bundle --file="~/Desktop/Brewfile" # 这里分享一份自己的真实备份文件 wangao@wangao-MAC ~/Desktop # cat Brewfile tap "buo/cask-upgrade" tap "dteoh/sqa" tap "homebrew/bundle" tap "homebrew/cask" tap "homebrew/core" tap "homebrew/services" # GNU compiler collection brew "gcc" # Distributed revision control system brew "git", link: false # Improved top (interactive process viewer) brew "htop" # Mac App Store command-line interface brew "mas" # MySQL database connector for C applications brew "mysql-connector-c" # Platform built on V8 to build network applications brew "node" # Perl compatible regular expressions library brew "pcre" # Password generator brew "pwgen" # Interpreted, interactive, object-oriented programming language brew "python" # Interpreted, interactive, object-oriented programming language brew "python@2" brew "sshpass" # User interface to the TELNET protocol (built from macOS Sierra sources) brew "telnet" # Display directories as trees (with optional color/HTML output) brew "tree" # Internet file retriever brew "wget" # UNIX shell (command interpreter) brew "zsh" # Fish shell like syntax highlighting for zsh brew "zsh-syntax-highlighting" cask "java" cask "mounty" cask "xquartz" cask "dteoh/sqa/slowquitapps" mas "GarageBand", id: 682658836 mas "iMovie", id: 408981434 mas "Keynote", id: 409183694 mas "Microsoft Remote Desktop", id: 1295203466 mas "Numbers", id: 409203825 mas "Pages", id: 409201541 mas "ting_en", id: 734383760 mas "Xcode", id: 497799835 1 lululau 2018-11-07 19:43:57 +08:00 via iPhone |
2 cocofe0 2018-11-07 19:46:34 +08:00 mark |
3 Eagleyes 2018-11-09 08:13:22 +08:00 搞那么复杂干嘛,Time machine 了解下 |
4 Aixtuz 2018-11-09 09:12:40 +08:00 狡兔三窟中作者已经提到方案选择的原因了。 愿意接受复杂方案,自然是因为对于一部分人,有比复杂更无法接受的因素。 |