Coder Social home page Coder Social logo

recsds_borgbackup's Introduction

Deploy

Install packages

sudo yum install -y borgbackup

Create borg user

sudo useradd borg
sudo passwd borg
sudo usermod -aG libvirt borg

SSH Keys (under borg user)

ssh-keygen
ssh-copy-id <borg-repo-host>

Copy ceph.client.admin.keyring keyring to project

mkdir keys
sudo ceph auth get-or-create client.borg mgr 'allow r' mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=images, allow rwx pool=volumes, allow rwx pool=vms, allow rwx pool=ssd-root' -o keys/ceph.client.borg.keyring
sudo chown borg:borg keys/ceph.client.borg.keyring

Make scripts executable

git clone <github-repo>
cd RECSDS_borgbackup
chmod +x borgbackup.sh

Create log dir

sudo mkdir /var/log/recsds_borgbackup/
sudo chown borg:borg /var/log/recsds_borgbackup/

Install qemu agent on domain

Open domain xml, and add this to

<channel type='unix'>
  <source mode='bind' path='/var/lib/libvirt/qemu/org.qemu.guest_agent.0.<guest-name>.sock'/>
  <target type='virtio' name='org.qemu.guest_agent.0'/>
</channel>

On the domain install the guest-agent

sudo yum install qemu-guest-agent

Enable the agent

sudo systemctl start qemu-guest-agent
sudo systemctl enable qemu-guest-agent

Test the communication from the KVM Host

sudo virsh qemu-agent-command <guest-name> '{"execute":"guest-info"}'

Usage

Manual virsh domain backup

./borgbackup.sh [OPTIONS]... DOMAIN...

For more information run

./borgbackup.sh --help

Automation backup

Add script to crontab

crontab -e

And add this string

0 0 * * * path-to-borgbackup.sh [OPTIONS]... DOMAIN... >> /var/log/recsds_borgbackup/borgbackup.log 2>&1

recsds_borgbackup's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.