Giter VIP home page Giter VIP logo

btrfs-simple-snapshots's Introduction

Btrfs simple snapshots

Take snapshots of your btrfs subvolumes and apply a retention policy in order to keep your snapshot directory somewhat clean and small.

The retention policy, defined bellow, is hardcoded for now but it should be enought for the average use case. I may adjust it, or provide a way to change it at runtime if needed.

  • Hourly snapshots are kept for 24 hours
  • Daily snapshots are kept for 4 weeks
  • Weekly snapshots are kept for 12 weeks
  • Monthly snapshots are kept for a year
  • yearly snapshots are kept for 10 years

Every subvolume that should be snapshoted must be given as argument to the script. For example if you want to snapshot every home directory created as subvolumes and your /etc and /srv directory you would do

btrfs-simple-snapshots /home/* /etc /srv

Once done, you will find a new subvolume named .snapshots inside the snapshoted subvolume with a name formated as %Y-%m-%d-%H%M%S

Installation

Install from pip using pip install btrfs-simple-snapshots. Then you can run it as root or with a user able to manage btrfs subvolumes. It is probably a good thing to run it automatically with a cron job. Depending on you need you may run it once per day (at 2 a.m.) to snapshot every home folder (created as subvolumes) with this kind of job definition.

0 2 * * * python -m btrfs_simple_snapshots /home/*

btrfs-simple-snapshots's People

Contributors

arnaudlevaufre avatar

Stargazers

Irfan Latif avatar  avatar

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.