All of lore.kernel.org
 help / color / mirror / Atom feed
From: Donald Pearson <donaldwhpearson@gmail.com>
To: sander@humilis.net
Cc: Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: Anyone tried out btrbk yet?
Date: Wed, 15 Jul 2015 09:42:28 -0500	[thread overview]
Message-ID: <CAC=t97CxDRoakqzoOAoHpN=1qS1jyvMEfOCe+RWvGTm6xSCqPQ@mail.gmail.com> (raw)
In-Reply-To: <20150715080057.GA15200@panda>

Implementation question about your scripts Marc..

I've set up some routines for different backup and retention intervals
and periods in cron but quickly ran in to stepping on my own toes by
the locking mechanism.  I could just disable the locking but I'm not
sure if that's the best approach and I don't know what it was
implemented to prevent in the first place.

Thoughts?

Thanks,
Donald

On Wed, Jul 15, 2015 at 3:00 AM, Sander <sander@humilis.net> wrote:
> Marc MERLIN wrote (ao):
>> On Wed, Jul 15, 2015 at 10:03:16AM +1000, Paul Harvey wrote:
>> > The way it works in snazzer (and btrbk and I think also btrfs-sxbackup
>> > as well), local snapshots continue to happen as normal (Eg. daily or
>> > hourly) and so when your backup media or backup server is finally
>> > available again, the size of each individual incremental is still the
>> > same as usual, it just has to perform more of them.
>>
>> Good point. My system is not as smart. Every night, it'll make a new
>> backup and only send one incremental and hope it gets there. It doesn't
>> make a bunch of incrementals and send multiple.
>>
>> The other options do a better job here.
>
> FWIW, I've written a bunch of scripts for making backups. The lot has
> grown over the past years to what is is now. Not very pretty to see, but
> reliable.
>
> The subvolumes backupadmin home root rootvolume and var are snapshotted
> every hour.
>
> Each subvolume has their own entry in crontab for the actual backup.
> For example rootvolume once a day, home and backupadmin every hour.
>
> The scripts uses tar to make a full backup every first backup of a
> subvolume that month, an incremental daily backup, and an incremental
> hourly backup if applicable.
>
> For a full backup the oldest available snapshot for that month is used,
> regardless of when the backup is started. This way the backup of each
> subvolume can be spread not to overload a system.
>
> Backups are running in the idle queue to not hinder other processes, are
> compressed with lbzip2 to utilize all cores, and are encrypted with gpg
> for obvious reasons. In my tests lbzip2 gives the best size/speed ratio
> compared to lzop, xz, bzip2, gzip, pxz and lz4(hc).
>
> The script outputs what files and directories are in the backup to the
> backupadmin subvolume. This data is compressed with lz4hc as lz4hc is
> the fastest to decompress (useful to determine which archive contains
> what you want restored).
>
> Archives get transfered to a remote server by ftp, as ftp is the leanest
> way of file transfer and supports resume. The initial connection is
> encrypted to hide username/password, but as the archive is already
> encrypted, the data channel is not. The ftp transfer is throttled to
> only use part of the available bandwith.
>
> A daily running script checks for archives which are not transfered yet
> due to remote server not available or failed connection or the like, and
> retransmits those archives.
>
> Snapshots and archives are pruned based on disk usage (yet another
> script).
>
> Restore can be done by hand from snapshots (obviously), or by a script
> from the locale archive if still available, or the remote archive.
>
> The restore script can search a specific date-time range, and checks
> both local and remote for the availability of an archive that contains
> the wanted.
>
> A bare metal restore can be done by fetching the archives from the
> remote host and pipe them directly into gpg/tar. No need for additional
> local storage and no delay. First the monthly full backup is restored,
> then every daily incremental since, and then every hourly since the
> youngest daily, if applicable. tar incremental restore is smart, and
> removes the files and directories that were removed between backups.
>
>         Sander
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2015-07-15 14:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-09 12:26 Anyone tried out btrbk yet? Martin Steigerwald
2015-07-09 17:12 ` Henri Valta
2015-07-09 17:17 ` Marc MERLIN
2015-07-10  1:35   ` Donald Pearson
2015-07-10  1:38     ` Donald Pearson
2015-07-10  4:02       ` Paul Harvey
2015-07-10 10:46 ` Axel Burri
2015-07-12  3:55   ` Marc MERLIN
2015-07-13  0:42     ` Marc MERLIN
2015-07-15  0:03       ` Paul Harvey
2015-07-15  3:14         ` Marc MERLIN
2015-07-15  8:00           ` Sander
2015-07-15 14:42             ` Donald Pearson [this message]
2015-07-15 18:02               ` Donald Pearson
2015-07-15 21:49                 ` Marc MERLIN
2015-07-20  5:15                   ` Donald Pearson
2015-07-20  8:28                     ` Duncan
2015-07-20 13:33                       ` Donald Pearson
2015-07-21  9:29                         ` Duncan
2015-07-22  1:29                           ` Donald Pearson
2015-07-25 13:27                             ` Donald Pearson
2015-07-26  5:39                               ` Duncan
2015-07-15 21:48               ` Marc MERLIN

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='CAC=t97CxDRoakqzoOAoHpN=1qS1jyvMEfOCe+RWvGTm6xSCqPQ@mail.gmail.com' \
    --to=donaldwhpearson@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=sander@humilis.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.