script for creating backups, preferrably complete system backups
Find a file
2020-11-01 13:16:34 +01:00
ubuntu add install script for *buntu distributions 2020-11-01 13:16:13 +01:00
.gitignore 20180915.1 2018-09-15 11:59:42 +02:00
actions add some new actions 2020-10-31 22:53:51 +01:00
PKGBUILD sync in background while showing result message 2020-06-19 20:08:14 +02:00
rc.skel exclude ./sys 2020-06-08 20:58:44 +02:00
README.md add README.md 2020-11-01 13:16:34 +01:00
rsbackup change numerical comparisons from [[ ]] to (( )) 2020-08-14 19:36:43 +02:00

rsbackup

A script to simplify complete system backups

1 key features

  • uses tar to create backup archives
  • archive gets compressed with zstd
  • on smt machines, uses all of your physical cpus for compression
  • configurable via environment variables
  • directories of your choice can be excluded from backup
  • respects extended file attributes and acls

2 installation

2.1 prepare

Clone this repository:
git clone https://git.tuxomat.eu/automat/rsbackup.git

2.2 install

2.2.1 arch users

  • cd rsbackup
  • makepkg -sic

2.2.2 *buntu users

  • cd rsbackup/ubuntu
  • ./install_xbuntu.sh

2.2.3 users of other distros

  • cd rsbackup
  • sudo install rsbackup /usr/local/bin
  • verify that zstd, tar and zenity are installed

2.3 configure

rsbackup is configured via environment variables. The variables along with their default values can be seen in rc.skel. If a variable isn't set, rsbackp uses the default value.

Make shure the variables are set with your preferred values, e.g. via ~/.bashrc or ~/.bashrc.local

The variables and their meanings are (defaults in square brackets):

  • MOUNTDIR: The base directory where your backup medium is mounted on [/media]
  • MOUNTNAME: The name of the directory your backup medium is mounted on $MOUNTDIR [backup]. The complete path to your backup medium is "$MOUNTIDR/$MOUNTNAME"
  • BASEDIR: The root directory where your backup will start
  • BACKUPDIRS: A string containing space seperated directories that will be backuped.
    Use relative paths, e.g. '. ./boot ./media/myprojects'
    Note that rsbackup will not cross file system boundaries (option --one-file-system to tar)
  • EXCLUDEFILE: Directories containing a file with this name will be backed up, but not their contents (only $EXCLUDEFILE is saved)[.no_backup]. This way you can exclude cache directories and the like from your backups.
  • TAROPTS: You probably never change this. Ensures, that extended attributes and acls are saved, too [-S --acls --xattrs --exclude=./sys].

3 usage

For a complete system backup, just give rsbackup.

If an optional paramter is passed, that will be the name of a single directory to backup.

4 restoring

Let's say you have a new hard disk where you want to restore your backup to. If this disk is mounted at /mnt/mynewdrive, give

cd /mnt/mynewdrive
sudo tar xf --xattrs-include='*' --acls /path/to/backup.tar.zst