All Projects → masc3d → Btrfs Sxbackup

masc3d / Btrfs Sxbackup

Licence: gpl-2.0
Incremental btrfs snapshot backups with push/pull support via SSH

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Btrfs Sxbackup

adlibre-backup
High performance rsync backup utilising BTRFS / ZFS filesystem features
Stars: ✭ 35 (-66.67%)
Mutual labels:  backup, snapshot, btrfs
Btrbk
Tool for creating snapshots and remote backups of btrfs subvolumes
Stars: ✭ 605 (+476.19%)
Mutual labels:  btrfs, backup, snapshot
btrfs-backup
A simple, flexible script for versioned backups using btrfs and rsync
Stars: ✭ 59 (-43.81%)
Mutual labels:  backup, snapshot, btrfs
Zrepl
One-stop ZFS backup & replication solution
Stars: ✭ 327 (+211.43%)
Mutual labels:  incremental, backup, snapshot
Backintime
Back In Time - A simple backup tool for Linux
Stars: ✭ 1,066 (+915.24%)
Mutual labels:  incremental, backup, snapshot
BaNG
Backup Next Generation for Linux & Mac using rsync (support hardlinks and btrfs snapshots), Web-Frontend, Statistics, History-Merger)
Stars: ✭ 28 (-73.33%)
Mutual labels:  backup, snapshot, btrfs
dcs-tools
Tools for making remote Linux node management easy
Stars: ✭ 34 (-67.62%)
Mutual labels:  backup, btrfs
JFileSync3
File Syncing with encryption and compression (partly) compatible with encfs / boxcryptor (classic) volumes for local folders and WebDAV backends. Based on JFileSync - hence the name.
Stars: ✭ 20 (-80.95%)
Mutual labels:  backup, compression
PyFiSync
Python (+ rsync or rclone) based intelligent file sync with automatic backups and file move/delete tracking.
Stars: ✭ 88 (-16.19%)
Mutual labels:  ssh, backup
PHP-Backuper
A framework which will help you to make (incremental) backups of your site.
Stars: ✭ 16 (-84.76%)
Mutual labels:  backup, incremental
Docker Webserver
WebServer (MariaDB, PHP-FPM, Nginx) composed from several separate containers linked together
Stars: ✭ 290 (+176.19%)
Mutual labels:  backup, ssh
Bareos
Main repository with the code for the libraries and daemons
Stars: ✭ 651 (+520%)
Mutual labels:  backup, compression
snapbtrex
snapbtrex is a small utility that keeps snapshots of btrfs filesystems and optionally send them to a remote system or syncs them locally.
Stars: ✭ 29 (-72.38%)
Mutual labels:  backup, btrfs
aws-backup-lambda
A utility AWS lambda function to manage EBS and RDS snapshot backups.
Stars: ✭ 60 (-42.86%)
Mutual labels:  backup, snapshot
virtnbdbackup
Backup utiliy for Libvirt / qemu / kvm supporting incremental and differencial backups.
Stars: ✭ 62 (-40.95%)
Mutual labels:  backup, incremental
terraform-aws-efs-backup
Terraform module designed to easily backup EFS filesystems to S3 using DataPipeline
Stars: ✭ 40 (-61.9%)
Mutual labels:  backup, snapshot
Pgbackrest
Reliable PostgreSQL Backup & Restore
Stars: ✭ 766 (+629.52%)
Mutual labels:  incremental, backup
Borgmatic
Simple, configuration-driven backup software for servers and workstations
Stars: ✭ 902 (+759.05%)
Mutual labels:  backup, compression
Cv4pve Barc
Backup And Restore Ceph for Proxmox VE
Stars: ✭ 74 (-29.52%)
Mutual labels:  backup, snapshot
Scaleway Cli
Command Line Interface for Scaleway
Stars: ✭ 654 (+522.86%)
Mutual labels:  ssh, snapshot

btrfs-sxbackup ##############

Btrfs snapshot backup utility

  • Push/pull support via SSH
  • Retention
  • Email notifications
  • Compression of transferred data
  • Syslog logging

System dependencies

Required

The following packages have to be available on both source and destination

  • bash

  • btrfs-progs

The system executing btrfs-backup requires

  • python3

Optional

  • ssh (for remote push/pull, not required for local operation)

    • bash has to be set as the default remote shell for the user running the backup
  • lzop (for compression support if desired)

  • pv (provides progress indication if installed)

  • sendmail (for email notifications if desired)

Installation

.. code ::

pip3 install btrfs-sxbackup

Setup

  • when using ssh, public/private key authentication should be set up

Known limitations

  • the destination filesystem has to be mounted without the subvol option, otherwise an error will occur on btrfs receive prompting you to remount with fs tree

  • some commands (like update) may not be available for backup jobs created with older versions of btrfs-sxbackup. in this case backup jobs can be recreated using destroy and init. existing snapshots will be kept as long as destroy is not invoked with --purge.

Usage examples

Initialize

Initialize a backup job pulling snapshots of subvolume / on remote host myhost.org to local subvolume /backup/myhost

.. code ::

btrfs-sxbackup init ssh://[email protected]:port/ /backup/myhost

Initialize a backup job pushing snapshots of local subvolume / to remote subvolume /backup/myhost on host mybackupserver.org

.. code ::

btrfs-sxbackup init / ssh://[email protected]:port/backup/myhost

note that in the ssh:// URL, the username and port part are optional; if not specified, the defaults will be used.

Run

Run a backup job

.. code ::

btrfs-sxbackup run /backup/myhost

Cron

Cronjob performing a pull backup job

.. code ::

# /etc/cron.d/btrfs-sxbackup
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
30 2    * * *     root     btrfs-sxbackup run /backup/myhost

Synopsis and options

.. code ::

usage: btrfs-sxbackup [-h] [-q] [--version] [-v]
                      {init,destroy,update,run,info,transfer} ...

positional arguments:
  {init,destroy,update,run,info,transfer}
    init                initialize backup job
    destroy             destroy backup job
    update              update backup job
    run                 run backup job
    info                backup job info
    purge               purge backups according to retention expressions
    transfer            transfer snapshot

optional arguments:
  -h, --help            show this help message and exit
  -q, --quiet           do not log to stdout
  --version             show program's version number and exit
  -v                    can be specified multiple times to increase verbosity

init

.. code ::

usage: btrfs-sxbackup init [-h] [-sr SOURCE_RETENTION]
                           [-dr DESTINATION_RETENTION] [-c]
                           source-subvolume destination-subvolume

positional arguments:
  source-subvolume      source subvolume to backup. local path or ssh url
  destination-subvolume
                        destination subvolume receiving backup snapshots.
                        local path or ssh url

optional arguments:
  -h, --help            show this help message and exit
  -sr SOURCE_RETENTION, --source-retention SOURCE_RETENTION
                        expression defining which source snapshots to
                        retain/cleanup. can be a static number (of backups) or
                        more complex expression like "1d:4/d, 1w:daily,
                        2m:none" literally translating to: "1 day from now
                        keep 4 backups a day, 1 week from now keep daily
                        backups, 2 months from now keep none"
  -dr DESTINATION_RETENTION, --destination-retention DESTINATION_RETENTION
                        expression defining which destination snapshots to
                        retain/cleanup. can be a static number (of backups) or
                        more complex expression (see --source-retention
                        argument)
  -c, --compress        enables compression during transmission. Requires lzop
                        to be installed on both source and destination

run

.. code ::

usage: btrfs-sxbackup run [-h] [-m [MAIL]] [-li LOG_IDENT]
                          subvolume [subvolume ...]

positional arguments:
  subvolume             backup job source or destination subvolume. local path
                        or SSH url

optional arguments:
  -h, --help            show this help message and exit
  -m [MAIL], --mail [MAIL]
                        enables email notifications. If an email address is
                        given, it overrides the default email-recipient
                        setting in /etc/btrfs-sxbackup.conf
  -li LOG_IDENT, --log-ident LOG_IDENT
                        log ident used for syslog logging, defaults to script
                        name

update

.. code ::

usage: btrfs-sxbackup update [-h] [-sr SOURCE_RETENTION]
                             [-dr DESTINATION_RETENTION] [-c]
                             subvolume [subvolume ...]

positional arguments:
  subvolume             backup job source or destination subvolume. local path
                        or SSH url

optional arguments:
  -h, --help            show this help message and exit
  -sr SOURCE_RETENTION, --source-retention SOURCE_RETENTION
                        expression defining which source snapshots to
                        retain/cleanup. can be a static number (of backups) or
                        more complex expression like "1d:4/d, 1w:daily,
                        2m:none" literally translating to: "1 day from now
                        keep 4 backups a day, 1 week from now keep daily
                        backups, 2 months from now keep none"
  -dr DESTINATION_RETENTION, --destination-retention DESTINATION_RETENTION
                        expression defining which destination snapshots to
                        retain/cleanup. can be a static number (of backups) or
                        more complex expression (see --source-retention
                        argument)
  -c, --compress        enables compression during transmission. Requires lzop
                        to be installed on both source and destination
  -nc, --no-compress    disable compression during transmission

info

.. code ::

usage: btrfs-sxbackup info [-h] subvolume [subvolume ...]

positional arguments:
  subvolume   backup job source or destination subvolume. local path or SSH
              url

optional arguments:
  -h, --help  show this help message and exit

purge

.. code ::

usage: btrfs-sxbackup purge [-h] [-sr SOURCE_RETENTION]
                            [-dr DESTINATION_RETENTION]
                            subvolume [subvolume ...]

positional arguments:
  subvolume             backup job source or destination subvolume. local path
                        or SSH url

optional arguments:
  -h, --help            show this help message and exit
  -sr SOURCE_RETENTION, --source-retention SOURCE_RETENTION
                        Optionally override expression defining which source
                        snapshots to retain/cleanup. can be a static number
                        (of backups) or more complex expression like "1d:4/d,
                        1w:daily, 2m:none" literally translating to: "1 day
                        from now keep 4 backups a day, 1 week from now keep
                        daily backups, 2 months from now keep none"
  -dr DESTINATION_RETENTION, --destination-retention DESTINATION_RETENTION
                        Optionally override expression defining which
                        destination snapshots to retain/cleanup. can be a
                        static number (of backups) or more complex expression
                        (see --source-retention argument)

destroy

.. code ::

usage: btrfs-sxbackup destroy [-h] [--purge] subvolume [subvolume ...]

positional arguments:
  subvolume   backup job source or destination subvolume. local path or SSH
              url

optional arguments:
  -h, --help  show this help message and exit
  --purge     removes all backup snapshots from source and destination

transfer

.. code ::

usage: btrfs-sxbackup transfer [-h] [-c]
                               source-subvolume destination-subvolume

positional arguments:
  source-subvolume      source subvolume to transfer. local path or ssh url
  destination-subvolume
                        destination subvolume. local path or ssh url

optional arguments:
  -h, --help            show this help message and exit
  -c, --compress        enables compression during transmission. Requires lzop
                        to be installed on both source and destination
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].