Skip to content

[Bash] The simplest rsync wrapper for backup and restore Linux system. Support ArchLinux, Ubuntu, etc

License

Notifications You must be signed in to change notification settings

gutenye/gutbackup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gutbackup, the simplest rsync wrapper for backup Linux system

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

Install
ArchLinux $ pacaur -S gutbackup
Manually $ git clone [email protected]/gutenye/gutbackup.git

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 [email protected]
By default, it runs daily, you can change it by
# systemctl edit [email protected]
  [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.

About

[Bash] The simplest rsync wrapper for backup and restore Linux system. Support ArchLinux, Ubuntu, etc

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages