Raspberry Pi Backup
RaspiBackup Tool
Backing up data is important. Large files and storages might be hard to back up and maintain, but something as small as a raspberry pi should not be an issue.
So I started using a tool for backing up the whole RPi, which can be easily restored if needed.
The tool is called
raspiBackup. It's very easy to use.
Just install the tool, and run the command
sudo installation/install.sh
from the tool's root directory.
Configure regular backups there. I stored my backups in an external SSD connected to the Pi.
The command to restore a RPi image to a usb drive is:
sudo dd bs=1M if=path/to/image/fileserver-dd-backup-20240219-231054.img of=/dev/sdb status=progress
Own method
Let's say the above tool stops working. There is a simple way to automate the dd backup by yourself.
Just download this
script, and edit the in and out paths as required. You can use crontab to automate the script as you want.
Don't forget to give executable rights by using
sudo chmod +x backup.sh
, and add the following line to crontab:
0 3 * * 1 /path/to/backup.sh
This line runs the script every Monday at 3:00 AM.
I also made a tool called
backupie, to maually run backup and restore.