All Projects → 3coma3 → btrfs-backup

3coma3 / btrfs-backup

Licence: GPL-3.0 license
A simple, flexible script for versioned backups using btrfs and rsync

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to btrfs-backup

adlibre-backup
High performance rsync backup utilising BTRFS / ZFS filesystem features
Stars: ✭ 35 (-40.68%)
Mutual labels:  backup, rsync, snapshot, btrfs
BaNG
Backup Next Generation for Linux & Mac using rsync (support hardlinks and btrfs snapshots), Web-Frontend, Statistics, History-Merger)
Stars: ✭ 28 (-52.54%)
Mutual labels:  backup, rsync, snapshot, btrfs
Btrbk
Tool for creating snapshots and remote backups of btrfs subvolumes
Stars: ✭ 605 (+925.42%)
Mutual labels:  backup, snapshot, btrfs
rbackup
Shell script for encrypted backups with rsync and GnuPG
Stars: ✭ 22 (-62.71%)
Mutual labels:  backup, rsync, bash-script
Backintime
Back In Time - A simple backup tool for Linux
Stars: ✭ 1,066 (+1706.78%)
Mutual labels:  backup, rsync, snapshot
aws-tag-sched-ops
Retired, please see https://github.com/sqlxpert/lights-off-aws
Stars: ✭ 24 (-59.32%)
Mutual labels:  backup, cron, snapshot
Automation-using-Shell-Scripts
Development Automation using Shell Scripting.
Stars: ✭ 41 (-30.51%)
Mutual labels:  backup, cron, bash-script
Btrfs Sxbackup
Incremental btrfs snapshot backups with push/pull support via SSH
Stars: ✭ 105 (+77.97%)
Mutual labels:  backup, snapshot, btrfs
backup-suite
Backup database, static files and config to AWS S3 with Cronjob
Stars: ✭ 32 (-45.76%)
Mutual labels:  backup, bash-script
Rsync Time Backup
Time Machine style backup with rsync.
Stars: ✭ 2,572 (+4259.32%)
Mutual labels:  backup, rsync
Elkarbackup
Open source backup solution for your network
Stars: ✭ 247 (+318.64%)
Mutual labels:  backup, rsync
Rsnapshot
a tool for backing up your data using rsync (if you want to get help, use https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss)
Stars: ✭ 2,335 (+3857.63%)
Mutual labels:  backup, rsync
System Tar And Restore
Backup and Restore your system using tar or Transfer it with rsync
Stars: ✭ 170 (+188.14%)
Mutual labels:  backup, rsync
Backup And Recovery Howtos
Guides to setting up a media storage system, backing it up, and recovering from failures
Stars: ✭ 235 (+298.31%)
Mutual labels:  backup, btrfs
Knoxite
A data storage & backup system
Stars: ✭ 165 (+179.66%)
Mutual labels:  backup, snapshot
sicksync
Don’t accept the available as the preferable. Go the extra mile with extra speed.
Stars: ✭ 67 (+13.56%)
Mutual labels:  backup, rsync
planb
PlanB - automating remote backups and snapshots with zfs/rsync
Stars: ✭ 24 (-59.32%)
Mutual labels:  backup, rsync
Rsync Incremental Backup
Configurable bash script to send incremental backups of your data to a local or remote target
Stars: ✭ 150 (+154.24%)
Mutual labels:  backup, rsync
virt-backup
Fully backup your KVM Virtual Machines
Stars: ✭ 27 (-54.24%)
Mutual labels:  backup, snapshot
butdr
Backup to Cloud( Google Drive, Dropbox ... ) use rclone
Stars: ✭ 49 (-16.95%)
Mutual labels:  backup, cron

Image

btrfs-backup

YES, there are already a million btrfs/rsync scripts out there, I know. I checked them out. It happened that every tool I tested was either:

  • made to manage snapshots for native btrfs filesystems (based on btrfs-send)
  • having too many impositions/assumptions about how you should structure your backups: you must name or initialize your destinations in some specific way, or cron the executions in another way
  • too restrictive in the granularity and retention of snapshots, for example: you can have only N yearly backups, or X monthly, etc
  • dependent on things like a database in which to store metadata, or some extra language interpreter to understand, or yet another config file syntax to learn

I wanted something lean and mean, that does the job and gets out of the way, with minimal dependencies. I needed a snapshot structure that was easy to work with, and I also wanted a retention / rotation scheme. I wanted ease of use and above everything, ease of understanding.

So I wrote this little piece and I've been pretty happy with the results:

  • instead of new languages, the native syntax and features of rsync, bash and sed/grep regular expressions are exposed through the script, simplifying adoption and leveraging documentation and implementation already there
  • the only state is the backup store itself, which holds the only metadata used so far: the timestamp for each backup, that is also nicely encoding the navigational structure. In other words: the database is the filesystem. If more metadata support is added in the future, it will be done through extended attributes, so if you want indexes or caches, you can add them as you need with any of the many external tools available
  • internally, liberal use of stream operations allows for a high degree of code reutilization, rendering the code clean and making easy to modify and extend it

Update

The recent commits include bugfixes and improvements (upgrading is recommended). Your help with testing and reporting back any issues observed, as well as any other feedback or request, is very appreciated.

The code has grown beyond the original count from ~50 lines. It's still small for what it packs, but not so as when it was created. Feel free to check the earlier versions, I might add tags to the best ones to aid in their use should that be needed. Note that prior versions might present bugs as no backporting (or even versioning) is in place for old patches.

Features

  • Plain bash. No DSL, no complex parameters, no nothing
  • ~350 lines of code omitting config, comments and blank lines
  • No impositions. It may be used as needed, manually or via cron. It does its job and gets out of the way.
  • Does Incremental, in place, COW powered snapshots out of any file system Rsync can read, courtesy of Btrfs
  • Custom GFS-style rotation algorithm to maintain arbitrary copies at the snapshot, day, week, month and year levels
  • Compact data source specification in extended bash "glob" pattern syntax
  • Compact per-data-source filter specification in rsync's own pattern syntax
  • Queued operations
  • Dry-run mode
  • Global defaults / config file / command line option overrides
  • Configuration file helpers (showcfg/editcfg/dumpcfg)
  • Selectable options for rsync progress report
  • Pipeable standard output: non-essential messages are directed to standard error
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].