Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Ulli Horlacher <framstag@rus.uni-stuttgart.de>
To: linux-btrfs@vger.kernel.org
Subject: Re: snaprotate
Date: Sat, 25 Apr 2026 11:06:31 +0200	[thread overview]
Message-ID: <20260425090631.GA538432@tik.uni-stuttgart.de> (raw)
In-Reply-To: <20171202125356.GA1355@rus.uni-stuttgart.de>


For what and when do you need a backup?
In most cases it is an inadvertently deleted or overwritten file.
Catastrophic failures like a filesystem crash or a burned computer are 
more seldom.
For the first case one wants a QUICK and EASY way to restore the lost
file(s). btrfs snapshots comes to mind :-)

On Sat 2017-12-02 (13:53), Ulli Horlacher wrote:
> 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

Some time later...

I have extended snaprotate with the shell function ssd (snapshot directories).

With ssd one can interactivly select a snapshot directory for recovery.
Example: 

  framstag@fex:~/data: ssd
  Snapshots:
   #1) 2026-04-18_1100
   #2) 2026-04-18_1000
   #3) 2026-04-18_0900
   #4) 2026-04-18_0800
   #5) 2026-04-18_0700
   #6) 2026-04-18_0600
   #7) 2026-04-18_0500
   #8) 2026-04-18_0400
   #9) 2026-04-18_0300
  #10) 2026-04-18_0200
  #11) 2026-04-18_0100
  #12) 2026-04-18_0000
  #13) 2026-04-17_2300
  #14) 2026-04-17_0000
  #15) 2026-04-16_0000
  #16) 2026-04-13_0000
  Snapshot #3
  SS0=/home/framstag/data
  framstag@fex:/local/home/.snapshot/2026-04-18_0900.hourly/framstag/data:

The only thing I have had to enter was "3"
Then I am in the snapshot directory from 2026-04-18 09:00
The restore then can be done with any command, example:

  framstag@fex:/local/home/.snapshot/2026-04-18_0900.hourly/framstag/data: cp -av *.txt $SS0/
  framstag@fex:/local/home/.snapshot/2026-04-18_0900.hourly/framstag/data: cd -
  framstag@fex:~/data:


https://fex.belwue.de/linuxtools/snaprotate.html


-- 
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:    https://www.tik.uni-stuttgart.de/
REF:<20171202125356.GA1355@rus.uni-stuttgart.de>

      parent reply	other threads:[~2026-04-25  9:12 UTC|newest]

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

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=20260425090631.GA538432@tik.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