GithubHelp home page GithubHelp logo

jeansibelius / btrfs-snp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nachoparker/btrfs-snp

0.0 0.0 0.0 18 KB

Automatic BTRFS snapshots made simple

License: GNU General Public License v3.0

Shell 100.00%

btrfs-snp's Introduction

btrfs-snp

Create BTRFS snapshots, manually or from cron.

Usage

# btrfs-snp
Usage: btrfs-snp <dir> (<tag>) (<limit>) (<seconds>) (<destdir>)

  dir     │ create snapshot of <dir>
  tag     │ name the snapshot <tag>_<timestamp>
  limit   │ keep <limit> snapshots with this tag. 0 to disable
  seconds │ don't create snapshots before <seconds> have passed from last with this tag. 0 to disable
  destdir │ store snapshot in <destdir>, path absolute or relative to <dir>

Examples

Manual

Snapshot of home

# btrfs-snp /home

Tagged snapshot of root

# btrfs-snp / preupgrade

Tagged snapshot of root, but keep maximum 10

# btrfs-snp / preupgrade 10

Cron

Hourly snapshot for one day, daily for one week, weekly for one month, and monthly for one year.

# cat > /etc/cron.hourly/btrfs-snp <<EOF
#!/bin/bash
/usr/local/sbin/$BIN /home hourly  24 3600
/usr/local/sbin/$BIN /home daily    7 86400
/usr/local/sbin/$BIN /home weekly   4 604800
/usr/local/sbin/$BIN /     weekly   4 604800
/usr/local/sbin/$BIN /home monthly 12 2592000
EOF
chmod +x /etc/cron.hourly/btrfs-snp

Inspired by btrfs-snap by Birger Monsen

More at ownyourbits.com

btrfs-snp's People

Contributors

nachoparker avatar zachsmith 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.