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.
-
Clone this repository, for example into
~/Downloads
cd ~/Downloads/ git clone https://github.com/konfekt/backup2usb.sh
-
Copy
borg2usb.sh
sync2usb.sh
,archive2usb.sh
orsystem2usb.sh
into a convenient folder, for example,~/bin
cp ~/Downloads/sync2usb.sh/sync2usb.sh ~/bin/
For
system2usb.sh
, an additional config fileBackupRoot2USB.conf
is needed that is assumed to sit inside~/.config/backups/usb/
, thereforecp --recursive ~/Downloads/sync2usb.sh/backups/ ~/.config/
-
Inside
sync2usb.sh
,archive2usb.sh
orsystem2usb.sh
, replaceKONFEKT
by your user name to log in to thersync
serverUSB_LABEL
by the label of yourNTFS
drive, and- the files and folders excluded by
--exclude ...
by those that suit you!
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.