Konfekt / backup2usb.sh

shell scripts to backup the home (and root) folder to a USB device via either rsync, borg, fsarchiver or system-tar-and-restore

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

These simple (POSIX compliant for UNIX based operating systems, such as Linux, Free BSD and MacOS) shell scripts

  • back up all files and folders inside the $HOME folder and root directory /
  • except those listed with --exclude

via rsync, borg, fsarchiver or system-tar-and-restore to a USB drive with an NTFS file system.

Installation

  1. Clone this repository, for example into ~/Downloads

    cd ~/Downloads/
    git clone https://github.com/konfekt/backup2usb.sh
  2. Copy borg2usb.sh sync2usb.sh, archive2usb.sh or system2usb.sh into a convenient folder, for example, ~/bin

    cp ~/Downloads/sync2usb.sh/sync2usb.sh ~/bin/

    For system2usb.sh, an additional config file BackupRoot2USB.conf is needed that is assumed to sit inside ~/.config/backups/usb/, therefore

    cp --recursive ~/Downloads/sync2usb.sh/backups/ ~/.config/
  3. Inside sync2usb.sh, archive2usb.sh or system2usb.sh, replace

    • KONFEKT by your user name to log in to the rsync server
    • USB_LABEL by the label of your NTFS drive, and
    • the files and folders excluded by --exclude ... by those that suit you!

Suggestions

The scripts assume that the backup files go into $HOSTNAME/{rsync,fsarchiver,system-tar-and-restore} on your USB drive (where $HOSTNAME is the name of the computer). If you prefer another path, then please adapt accordingly.

Place (some of) the scripts into /etc/cron.weekly/ for a weekly backup.

About

shell scripts to backup the home (and root) folder to a USB device via either rsync, borg, fsarchiver or system-tar-and-restore


Languages

Language:Shell 100.0%