From 138d2b7632800abe2303712b43ca0375951e193e Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Mon, 8 Jul 2024 08:32:28 -0400 Subject: [PATCH] new version tested by using pypi to install! modified: .gitignore modified: README.md modified: setup.py --- .gitignore | 2 ++ README.md | 34 +++++++++++++++++++++++++++++++++- setup.py | 44 +++++++++++++++++++++++--------------------- 3 files changed, 58 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index ee77078..29f0f73 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ venv +venv2 +build virt_back.egg-info *.tar diff --git a/README.md b/README.md index 7b67b61..19d8ca2 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,39 @@ Options: --create-all attempt to start ALL guests ``` -How to backup zfs snapshot all KVM instances on a TrueNAS Scale, + +## Dependencies + +Before installing `virt-back`, you need to ensure that the necessary development libraries for `libvirt` are installed on your system. These libraries are required for the `libvirt-python` package, which `virt-back` depends on. + +### Fedora/RedHat + +On Fedora or RedHat-based systems, you can install the `libvirt-devel` package using `dnf`: + +```bash +sudo dnf install libvirt-devel +``` + +### Ubuntu/Debian + +On Ubuntu or Debian-based systems, you can install the `libvirt-dev` package using `apt-get`: + +```bash +sudo apt-get install libvirt-dev +``` + +### Installing `virt-back` + +Once the necessary development libraries are installed, you can install `virt-back` using `pip`: + +```bash +pip install virt-back +``` + +This will install `virt-back` along with its dependencies, including `libvirt-python`. + + +## How to backup zfs snapshot all KVM instances on a TrueNAS Scale, ``` root@guile[/mnt/downloads/virt-back]# ./virt-back -u "qemu+unix:///system?socket=/run/truenas_libvirt/libvirt-sock" --backup-all --path /mnt/personal/backup/virt-back --no-gzip --retention 5 diff --git a/setup.py b/setup.py index 3922509..afa323e 100644 --- a/setup.py +++ b/setup.py @@ -1,23 +1,17 @@ -# installation: -# * pip install virt-back -# * easy_install virt-back from setuptools import setup +import os -DESCRIPTION = """A backup utility for QEMU, KVM, XEN, and Virtualbox guests. -Virt-back is a python application that uses the libvirt api to safely -shutdown, gzip, and restart guests. The backup process logs to syslog -for auditing and virt-back works great with cron for scheduling outages. -Virt-back has been placed in the public domain and -the latest version may be downloaded here: -https://git.unturf.com/python/virt-back -""" +# Read the contents of your README file +with open(os.path.join(os.path.dirname(__file__), "README.md"), encoding="utf-8") as f: + long_description = f.read() setup( name="virt-back", - version="0.2.1", + version="0.2.2", description="virt-back: A backup utility for QEMU, KVM, XEN, and Virtualbox guests", keywords="backup virtual hypervisor QEMU KVM XEN Virtualbox", - long_description=DESCRIPTION, + long_description=long_description, + long_description_content_type="text/markdown", author="Russell Ballestrini", author_email="russell@ballestrini.net", url="https://git.unturf.com/python/virt-back", @@ -26,20 +20,28 @@ setup( py_modules=["virtback"], include_package_data=True, scripts=["virt-back"], + install_requires=[ + "libvirt-python", + ], ) """ setup() keyword args: http://peak.telecommunity.com/DevCenter/setuptools -configure pypi username and password in ~/.pypirc:: +# built and uploaded to pypi with this: - [pypi] - username: - password: +python setup.py sdist +twine upload dist/* - -build and upload to pypi with this:: - - python setup.py sdist bdist_egg register upload """ + +# Installation Instructions: +# To install virt-back, you can use pip: +# * pip install virt-back +# +# Note: You need to have the libvirt development libraries installed. +# On Fedora/RedHat, you can install it with: +# * sudo dnf install libvirt-devel +# On Ubuntu, you can install it with: +# * sudo apt-get install libvirt-dev