[Bash] The simplest rsync wrapper for backup and restore Linux system. Support ArchLinux, Ubuntu, etc
Shell
Failed to load latest commit information.
bin v3.0.0 the simplest rsync wrapper Apr 27, 2015
examples/archlinux example-archlinux: update data May 7, 2015
libexec add database with options support Jun 16, 2016
misc bugfixes Oct 6, 2015
test add backup database support: rethinkdb Oct 6, 2015
.drone.yml
.gitignore add archlinux example Apr 29, 2015
LICENSE update readme Apr 27, 2015
README.md fix Oct 6, 2015
VERSION add VERSION May 10, 2015
__HACKING__ bugfixes Oct 6, 2015
ake add backup database support: rethinkdb Oct 6, 2015

README.md

gutbackup, the simplest rsync wrapper for backup Linux system

Homepage | Documentation | Issue Tracker | MIT License | Bountysource | by Guten Ye

Install
ArchLinux $ pacaur -S gutbackup; # pip install rethinkdb
Ubuntu ...; # pip install rethinkdb

Getting Started

Mount backup USB drive to /backup
$ mkdir -p /backup/conf/hello
$ vi /backup/conf/hello/default

    backup_options="-aP"
    files="
    /etc/fstab
    /etc/mtab
    "

$ gutbackup backup hello -- --dry-run
> rsync --files-from /tmp/files.gutbackup -aP --dry-run / /backup/hello/

That's it, as you can see, it just build a rsync command using options from /backup/conf/hello/default bash file.

Backup to another location

$ gutbackup backup hello -to /tmp/backup
> backup to /tmp/backup
> read conf from /tmp/backup/conf/hello/default

Backup to another location with another conf directory

$ gutbackup backup hello -to /tmp/backup -conf /etc/backup
> backup to /tmp/backup
> read conf from /etc/backup/hello/default

Configuration

You can provide options in four locations, later one override the previous. They are just plain bash files.

  • system-wide: /etc/gutbackup.conf
  • local-wide: $conf/<profile>.conf
  • local-wide: $conf/<profile>/<instance>
  • cmdline
# edit /etc/gutbackup.conf

  from="/"
  to="/backup"
  conf="$to/conf"

# edit /backup/conf/hello.conf

  backup_options="-aP"

# edit /backup/conf/hello/default

  files="/etc/fstab"

# edit /backup/conf/hello/data

  files="/root"

# cmdline

  $ gutbackup backup <profile> [instance] [options] -- [rsync-options]
  $ gutbackup backup hello     # if you omit the instance, it's "default".
  $ gutbackup backup hello data -from / -to /backup -conf /backup/conf -- --dry-run

Read more at Archlinux Example, Tutorial, and Documentation

Schedule Backup

# sytemctl enable gutbackup@hello.timer
By default, it runs daily, you can change it by
# systemctl edit gutbackup@hello.timer
  [Timer]
  OnCalendar=weekly
Read more at $ man systemd.timer

I Also Use These Backup Apps

Copyright

The MIT License (MIT)

Copyright (c) 2013-2015 Guten Ye

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.