GithubHelp home page GithubHelp logo

s-hamann / ansible-btrshot Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 8 KB

Ansible role to configure automatic periodic snapshots of btrfs filesystems

Shell 100.00%
ansible-role btrfs btrfs-snapshots

ansible-btrshot's Introduction

btrshot

This role configures automatic periodic snapshots of btrfs filesystems.

Requirements

This role requires Ansible 2.5 but has no further requirements on the controller.

Role Variables

  • btrshot_snapshot
    Subvolumes to set up automatic snapshots for. Structured as a dictionary where keys are devices and values are lists of subvolumes on the respective devices. Defaults to all btrfs subvolumes mounted at run time.
  • btrshot_no_snapshot
    Subvolumes not to set up automatic snapshots for. Structured as a dictionary where keys are devices and values are lists of subvolumes on the respective devices. Optional.
  • btrshot_snapshot_target
    The name of the target subvolume that stores snapshots. This can be an absolute path that identifies the subvolume on the root volume of the respective device or a relative path that is interpreted as relative to the subvolume(s) of which a snapshot is taken. Defaults to /snapshots.
  • btrshot_snapshot_frequency
    When to do periodic btrfs snapshots. This variable is a dictionary with keys that are used to group snapshots. Note that for the purpose of grouping snapshots the key is used only up to the first % while for the purpose of identifying cron jobs the full key is used. The values can be a time specification as understood by cron or the special keywords hourly, daily, weekly or monthly. The default consists of the aforementioned special keywords as keys and values.
  • btrshot_snapshot_keep
    How many old snapshots to keep when creating a new snapshot. This variable is a dictionary with the same keys (up to the first %) as btrshot_snapshot_frequency. The values are integers that specify the total number of snapshots to keep for the respective interval. Defaults to keeping 24 hourlies, 7 dailies, 4 weeklies and 3 monthlies.

Dependencies

This role creates cron jobs and therefore depends on a running cron daemon on the target system. While most Linux distributions come with some cron implementation pre-installed, it may occasionally require further setup using a separate role.

Example Configuration

The following is a short example for some of the configuration options this role provides:

btrshot_snapshot:
  /dev/sda1:
    - /root
    - /home
  /dev/sda2:
    - /var/log
btrshot_snapshot_frequency:
    hourly: '0 * * * *'
    daily: '0 0 * * *'
    daily%sunday_special: '0 1 * * sun'
    weekly: weekly

License

MIT

ansible-btrshot's People

Watchers

 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.