Purpose of this page is to explain step by step how to use raspiBackup to create a backup imediately and how configure raspiBackup in 5 minutes to create a backup of your Raspberry on a regular base. This page describes for different platforms (Linux, Mac or Windows) how to restore the backup. After testing the backup and restore the next step should be to check which services have to be stopped before the backup starts. Finally cron should be configured to start raspiBackup on a regular base. Later on when you have some spare time read this page carefully to check which additional features of raspiBackup are useful for you and update the raspiBackup configuration accordingly. In any case it's strongly recommended to read the FAQ. The raspiBackup installer can be used to uninstall raspiBackup completely if for some reasons raspiBackup does not meet your requirements.
Please read first: Supported hard- and software
This page has a lot of usage and configuration examples and should be read before installing raspiBackup. That way you know how to configure raspiBackup during the installation step.
raspiBackup can be installed and configured similar to raspi-config. The installation script uses menus and selection lists. All primary options can be configured with the installer. All other options have to be configured manually in the configuration file /usr/local/etc/raspiBackup.conf. In addition primary options can be updated all the time by invoking raspiBackupInstallUI again. An update menu allows to update the installer and raspiBackup if new versions are available. If there are any issues please report the issue in a comment or even better - create in github an issue.
If you just want to install raspiBackup with a standard configuration without any individual configuration use options -i and -e (use -h for help). Then you have to configure raspiBackup manually by editing the corresponding configuration files. if you want to install raspiBackup manually visit this page. On Youtube there exists a video where raspiBackup is introduced and at the end a demo of the installation of raspiBackup is given.
Note: Users of putty should have remote character set UTF-8 selected in Window -> Transalation. Otherwise garbled characters are displayed as window borders by the installer.
raspiBackup installer and raspiBackup use the configured system language for messages as long as it's supported: Supported languages are English, German, Finnish and Chinese. All other system languages will be mapped to English. Any help to add support for other languages is greatly appreciated. For details please read this page.
The current installer can be downloaded, installed and started as follows in the commandline:
curl -L https://raspibackup.linux-tips-and-tricks.de/install | sudo bash
Now you can select the install menu which installs raspiBackup by using a standard configuration (see below). All primary configuration options now can be updated in the configuration menu. Finally you can enable the weekly backup run started by cron.
You can start the installer every time in the commandline with
sudo raspiBackupInstallUI.shto update the raspiBackup configuration or even to uninstall raspiBackup.
Note: raspiBackups cron configuration file is located in /etc/cron.d/raspiBackup. Use the installer to update cron settings in there. Be careful when updating the file manually. This may cause the installer to become unable to update the config file.
If there are any issues with the installer use
curl -L https://raspibackup.linux-tips-and-tricks.de/install | sudo bash -s -- -d
to create a debug log in the home directory of the current user for further problem analysis.
In particular you should test the restore immediately whenever you use raspiBackup to backup a new System which uses a different or newer operatingsystem version. Every operatingsystem change may change output formats and can cause the restore to fail.
If you plan to restore your backup from a copy of a rsync backupdirectory make sure all fileattributes are preserved when you copy the backupdirectory. Otherwise the restored image either will not boot or will be unusable because of wrong fileattributes.
Downloadlinks of raspiBackup and raspiBackupInstallUI
If you want to read the sourcecode of raspiBackup and/or the installer just download them via the following links.
When you finished raspiBackup installation and configuration create the standard mount point used by raspiBackup to save the backup with (assuming you use the default backup path)
sudo mkdir /backup
Now mount the external device (USB disk USB dongle, nfs drive ...) on this mountpoint. The following example uses an external USB disk or external USB dongle.
sudo mount /dev/sda1 /backup
Keep in mind the filesystem of the backup parition has some dependencies to the backup type. See here for details about the dependencies. In addition don't use the dd backup type if possible. For detaisl why you sholdn't t use dd see here.
Before starting the backup check that you mounted the right backup partition. Following commands will help on this:
sudo blkid -o list
mount | grep backup
or if you have labeled your partition
sudo blkid -o list | grep <label>
Now everything is ready to create a backup. Please note you have to configure raspiBackup to shutdown some services before backup later on when raspiBackup is used on a regular base. Read FAQ18 for details about this.
sudo raspiBackup -m detailed
When the backup finished successfully then it's strongly recommended to restore the backup (Link to restore documentation) on another SD card and test the restored image and to get familiar with the restore procedure.
1) Configurationfile /usr/local/etc/raspiBackup.conf
This file configures raspiBackup. Standardconfiguration see following table. The settings can be overwritten with the installer. All other settings have to be updated with an editor or have to be passed as an invocation option.
|Services to stop||none|
|services to start||none|
|Backup time||05:00 AM|
For details about the options see here.
2) Weekly backup configuration file /etc/cron.d/raspiBackup
This configuration file controls the weekly backup of raspiBackup. It's disabled in the standardconfiguration and can be turned on with the installer.
When you created your first backup successfully and also restored it successfully you should check all the available options of raspiBackup on this page and use them if they help you. One important option is -e <eMailAdress>. This eMailAddress is used by raspiBackup to send an eMail with all Messages when a backup run finshed - either successfully or failed. In addition you can exclude directories, reduce the size of dd backups and much more.
Every option can be defined in /usr/local/etc/raspiBackup.conf so you don't have to pass it when you call raspiBackup. There are some options which can be configured only via the config file. For details see users guide.
You can use the installer also to remove raspiBackup from your system. Either use the installer menu to uninstall raspiBackup or call
sudo raspiBackupInstallUI -u
If you just want to install raspiBackup with it's default configuration you can do this from the commandline with some options. Any changes of the configuration now can be done manually. Same applies for the weekly backup cron configuration. But you also then can use the installer with it's menus to configure the main options and the weekly backup. Just execute
curl https://raspibackup.linux-tips-and-tricks.de/install | sudo bash -s -- -i
Any further details for commandline options of the installer you will get with
curl https://raspibackup.linux-tips-and-tricks.de/install | sudo bash -s -- -h
1) Download raspiBackup
curl -sSLO https://www.linux-tips-and-tricks.de/raspiBackup.sh
2) Mount your backup partition on /backup or pass the backup partition as last parameter when invoking raspiBackup, e.g.
sudo bash ./raspiBackup.sh /media/pi
3) Create backup:
sudo bash ./raspiBackup.sh
4) If no dd backup should be created pass the backup type tar or rsync with option -t , e.g.
sudo bash ./raspiBackup.sh -t tar or
sudo bash ./raspiBackup.sh -t rsync
5) Help for all other options of raspiBackup is displayed with
bash ./raspiBackup.sh -h