Giter VIP home page Giter VIP logo

btrfs-snap's Introduction

btrfs-snap

btrfs-snap creates and maintains the history of snapshots of btrfs filesystems.

Features:

  • can snapshot inside of the filesystem or rooted in a base directory
  • can purge old snapshots when too many exist
  • can keep multiple snapshot schedules for the same filesystem

btrfs-snap is designed to be called from cron on a regular schedule.

Usage

btrfs-snap [-r] [-b basedir] mountpoint prefix count

  • mountpoint is the filesystem to snapshot (must be found in the output of 'mount -t btrfs')
  • prefix is the prefix, which usually corresponds to a schedule (e.g. 1m, 5m, 3h, 1d, 1w, 3mo)
  • count is the number of snapshots with the same prefix to keep
  • -r makes the snapshot readonly (requires btrfs-tools v0.20)
  • -b basedir places the snapshot in a like-named directory rooted in the basedir. Without -b, snapshots are placed in a directory called .snapshot at the top of the mountpoint

Examples

*/5   *   *   *   *   btrfs-snap -r / 5m 12
0     0   *   *   *   btrfs-snap -r -b /snapshots /home 1d 7

The above cronjob would

  1. create a snapshot of / every 5 minutes, keeping 12 generations in /.snapshot
  2. create a snapshot of / every day, keeping 7 generations in /snapshots/home

OS Support

Tested on

  • Ubuntu 12.04 with the raring kernel
  • Ubuntu 13.04

Anything else, YMMV. Reports of successful use on other operating systems is welcome

License

This program is distributed under the GNU General Public License

http://www.gnu.org/licenses/gpl.txt

Authors

Originally by Birger Monsen [email protected]

Readonly and basedir additions by James FitzGibbon [email protected]

VFS snapshot naming support by gitmopp (https://github.com/gitmopp)

btrfs-snap's People

Contributors

gitmopp avatar jf647 avatar

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.