每一個人都會積累一套本身習慣使用的 App。若是平時習慣使用 Time Machine 備份,那麼在重裝系統時,直接用它還原卻是一個不錯的辦法,沒必要再手動安裝一個個 App。可是有些時候,咱們可能想要一個更加「乾淨」的新系統,此時就須要依次手動安裝。這顯然不是個高效、省心的方法,可能還須要一個個回憶以前用的 App。這時候,咱們每每但願有一份屬於本身的 App 清單,最好還能在重裝時一鍵安裝,省心省力。不管是Windows仍是macOS下咱們都但願實現一鍵裝機,而 homebrew-bundle 正是這樣一款 Mac 下的備份恢復利器。java
macOS 使用 homebrew-bundle 優雅的備份和恢復軟件列表
2018年11月07日 - 初稿node
閱讀原文 - https://wsgzao.github.io/post...python
擴展閱讀mysql
按期自動雲備份 macOS 軟件列表,維護一份屬於本身的必備 App 清單 - https://sspai.com/post/43265
狡兔三窟——雲備份軟件列表與相應配置,補充 Time Machine - https://sspai.com/post/43479git
macOS 自帶的 Time Machine 無疑是備份與還原的利器。不管是重裝系統,仍是新機配置,Time Machine 用起來都十分方便、省心。可是它存在如下不足:github
即便上述狀況對你來講都不是問題,多一種備份方式也是多一份安全和保障。sql
Bundler for non-Ruby dependencies from Homebrew
homebrew-bundle - https://github.com/Homebrew/h...shell
備份列表包含:express
# 執行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