BorgBackup是非常好用备份软件,尽管MAC下时光机器已经很好用了,但是考虑到自动化处理和开源,还是需要安装BorgBackup
安装BorgBackup
可以直接安装MAC下的安装包。
这里我们尝试使用pip来安装
pip安装BorgBackup
首先更新库
pip install -U pip setuptools wheel
安装pkgconfig
pip install pkgconfig
实战下来,还需要安装lz4和zstd
brew install lz4 zstd
在实践中安装zstd需要附加安装很多软件,速度很慢,还是直接用brew安装BorgBackup更方便。
pip安装BorgBackup
pip install borgbackup
使用brew安装BorgBackup
brew install borgbackup
事实证明在MAC下还是用brew安装方便。
调试
pip安装BorgBackup报错
File "/private/var/folders/tw/f916n7l569dbx1xqr67fx8x80000gp/T/pip-build-env-ghf9x5jp/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/tw/f916n7l569dbx1xqr67fx8x80000gp/T/pip-build-env-ghf9x5jp/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
self.run_setup()
File "/private/var/folders/tw/f916n7l569dbx1xqr67fx8x80000gp/T/pip-build-env-ghf9x5jp/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 313, in run_setup
exec(code, locals())
File "<string>", line 145, in <module>
File "<string>", line 125, in lib_ext_kwargs
Exception: Could not find lz4 lib/headers, please set BORG_LIBLZ4_PREFIX or ensure liblz4.pc is in PKG_CONFIG_PATH.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
仔细看,发现报错是:
Exception: Could not find lz4 lib/headers, please set BORG_LIBLZ4_PREFIX or ensure liblz4.pc is in PKG_CONFIG_PATH.
用brew安装lz4
brew install lz4
话说不得已还是用了brew,不过BorgBackup也是可以用brew来安装的,有点绕路了。
安装lz4之后又报错
报错:Exception: Could not find zstd lib/headers, please set BORG_LIBZSTD_PREFIX or ensure libzstd.pc is in PKG_CONFIG_PATH.
用brew安装zstd
brew install zstd
天啊,这个库的相关库真多,竟然openssl sqlite等都被装进来了
等等。。。怎么把python3.12都装上来了?
最终zstd需要的依赖太多,最后报错
brew安装zstd报错
==> Pouring python@3.12--3.12.4.monterey.bottle.tar.gz
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied @ dir_s_mkdir - /usr/local/Frameworks
Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks
暂时放弃,直接用brew安装BorgBackup 。