Giter VIP home page Giter VIP logo

lxdbackup's Introduction

LXD Backup script

This small Bash script will backup your LXC container with help of the Rclone Cloud backuptool.

What does it do:

  • This scripts creates a backup image from a snaphot from your LXC container that is managed with LXD.
  • The script will upload your image to a cloudstore with Rclone.
  • Online backup of your LXC container
  • Creates an easy and ready to use LXC image to import with the LXC import command.

What it does not cover:

  • Create a constant database backup, this does not work with backups.
  • Handle your data retention

Installation instructions

You can run the script from the commandline, or place it in your cron.

Prerequisites:

Install it by cloning this repostory on your LXC host:

git clone https://github.com/cloudrkt/lxdbackup 

Then copy the lxdbackup to your $path:

cd lxdbackup && cp lxdbackup /usr/bin/

Don't forget to make it executable:

chmod +x /usr/bin/lxbackup

Then test it with:

lxdbackup container-name

How do I set it automatically?

Use a cronjob like this to backup your container every day of the week on 01:10:

10 1 * * * flock -n /tmp/lxdbackup.lock lxdbackup container-name

How do I restore a container?

Download your container image from your cloudstorage and import it with LXC or even import it directly if your cloudstorage provides a HTTP(S) download for your image.

lxc image import <file> --alias <name>

Import from HTTPS directly:

lxc image import https://cloudrkt.com/lxdbackup --alias restored-image

lxdbackup's People

Contributors

oliverbienert avatar rosconap avatar pokrface avatar

Watchers

James Cloos avatar  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.