Here is our stable tool for such purposes: https://github.com/ceremcem/aktos-dcs-toolshttps://github.com/aktos-io/aktos-dcs-tools
This tool is written to make ssh
connections, make backup-root
, make mount-root
from remote places in mind at first, and then local sessions are added. So it supports local backups, direct remote backups, proxy remote backups. Backups are taken incrementally (only diffs are transferred) and backup directories are standalone (just pick a directory/version to restore, any directory has a full backup). Of course, you have versions (backup.last-0 is the newest one). You can interrupt backup process at anytime and continue later.
Here are the instructions for your specific problem:
ssh to-your-raspberry
cd /mnt/usb0/my-rpi-backups
git clone https://github.com/ceremcem/aktos-dcs-tools backup-tools
ln -s backup-tools/Makefile .
./backup-tools/configure # you do not need to make any settings for local sessions, just save the default
# just for the first time
make set-local-session # a flag file is created
make init # snapshots directory is created
# anytime you want to back up
make backup-root # backup with rsync
EDIT
Now there is a new target added: You can create a physical SD Card from your backups with one command:
make create-disk-from-last-backup
Follow the instructions, create your SD Card, boot RaspberryPi with this newly created SD Card.