如何备份/ RESTOR蟒蛇的virtualenv?
问题描述:
一个Python的virtualenv充满符号链接:如何备份/ RESTOR蟒蛇的virtualenv?
$ virtualenv venv
Running virtualenv with interpreter /usr/bin/python2
New python executable in venv/bin/python2
Also creating executable in venv/bin/python
Installing setuptools, pip...done.
$ tree venv/lib/
venv/lib/
├── python2.7
│ ├── _abcoll.py -> /usr/lib/python2.7/_abcoll.py
│ ├── _abcoll.pyc
│ ├── abc.py -> /usr/lib/python2.7/abc.py
│ ├── abc.pyc
│ ├── codecs.py -> /usr/lib/python2.7/codecs.py
│ ├── codecs.pyc
│ ├── copy_reg.py -> /usr/lib/python2.7/copy_reg.py
│ ├── copy_reg.pyc
│ ├── distutils
│ │ ├── distutils.cfg
│ │ ├── __init__.py
│ │ └── __init__.pyc
│ ├── encodings -> /usr/lib/python2.7/encodings
│ ├── fnmatch.py -> /usr/lib/python2.7/fnmatch.py
│ ├── fnmatch.pyc
│ ├── genericpath.py -> /usr/lib/python2.7/genericpath.py
│ ├── genericpath.pyc
什么是推荐的方式来备份/ RESTOR呢?
我第一次尝试使用rdiff进行备份具有反引用的所有符号链接,当我RESTOR备份回来。
答
rdiff进行备份通常副本符号链接,因为它们并没有引用它们。你可能会添加--include-symlinks选项吗?
“CP -p” 或 “rsync的-a” 也将保留符号链接。
+0
ARG我使用:rdiff进行备份--no的ACL --exclude-特殊文件的源DEST – user3313834
为什么需要?它们非常轻便,只需根据需要重新创建。如果您安装了模块,请将它们保存到'requirements.txt'文件并将它们添加到'setup.py';这对分配也很有用。 – jonrsharpe