linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulli Horlacher <framstag@rus.uni-stuttgart.de>
To: linux-btrfs@vger.kernel.org
Subject: snaprotate
Date: Sat, 2 Dec 2017 13:53:56 +0100	[thread overview]
Message-ID: <20171202125356.GA1355@rus.uni-stuttgart.de> (raw)

Being a Netapp user for a long time, I have always missed btrfs snapshots
the way Netapp creates them.

I have now written snaprotate:

http://fex.belwue.de/snaprotate.html

snaprotate creates and manages btrfs readonly snapshots similar to Netapp.
Snapshots have names like hourly, daily, weekly, single and a date_time
prefix.

Snapshots are stored in a .snapshot/ directory in the subvolume root. 
Example: /local/home/.snapshot/2017-09-09_1200.hourly

You create a snapshot with:

snaprotate <class> <count> <subvol>

<class> is your snapshot name
<count> is the maximum number of snapshots for this class
<subvol> is the btrfs subvolume directory you want to snapshoot

If count is exceeded then the oldest snapshot will be deleted.

You can use snaprotate either as root or as normal user (for your own
subvolumes).

Example usages:

snaprotate single 3 /data             # create and rotate "single" snapshot
snaprotate test 0 /tmp                # delete all "test" snapshots
snaprotate daily 7 /home /local/share # create and rotate "daily" snapshot
snaprotate -l /home                   # list snapshots


-- 
Ullrich Horlacher              Server und Virtualisierung
Rechenzentrum TIK         
Universitaet Stuttgart         E-Mail: horlacher@tik.uni-stuttgart.de
Allmandring 30a                Tel:    ++49-711-68565868
70569 Stuttgart (Germany)      WWW:    http://www.tik.uni-stuttgart.de/
REF:<20171202125356.GA1355@rus.uni-stuttgart.de>

             reply	other threads:[~2017-12-02 13:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-02 12:53 Ulli Horlacher [this message]
2017-12-02 13:56 ` snaprotate Ulli Horlacher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171202125356.GA1355@rus.uni-stuttgart.de \
    --to=framstag@rus.uni-stuttgart.de \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).