raspiBackup allows to create backups of a running Raspberry. No shutdown and manual intervention is required. Instead important services have to be stopped just before starting the backup and when the backup has finished they have to be started again. Any device which can be mounted on Linux can store the backup (USB disk, USB stick, nfs, samba, sshfs, ...). The common Linux backup tools dd, tar and rsync using hardlinks can be used to create the backup. Backups can be restored on any SD card. An external rootpartition will be included in the backup. NOOBS images are supported.




  • Click this link to read news and background information in English about raspiBackup on Facebook. There is no Facebook account required.
  • News about raspiBackup are announced on Twitter #raspiBackup
  • If there are any questions or issues to report use the comment function at the end of the page.


Where to go next?

raspiBackup has a lot of features because a lot of raspiBackup users asked for addition features. That's why there exist a lot of documentation of all the different options. If you want to get a quick overview about the capabilities of raspiBackup just read the summary. If you want to know about all features and supported environments in detail continue with the feature chapter. If you want to install raspiBackup just follow the installation description. Don't forget to read the FAQ page.  All invocation options of raspiBackup are listed alphabetically and theme sorted. How to restore a backup is described on this page

If you want to extend raspiBackup read the extensability section. If you get error messages from raspiBackup read this section. For pros and cons of the backup methods klick here and for details about the two backup modes of raspiBackup read here. A list of bugfixes and enhancements in the old and new version is available here. If you want to use a Synology for your backups read this page. Development of raspiBackup is and will be driven by users of raspiBackup.

For other topics see the following index.



  1. Summary
  2. Features
  3. High level overview
  4. Installation
  5. Invocationsyntax and -options (alphabetically sorted)
  6. Invocationsyntax and -options (theme sorted)
  7. Extensabilitiy
  8. Restore
  9. Errormessages and troubleshooting
  10. Backup types
  11. Backupspace directory structure
  12. Disclaimer
  13. Updatestrategy
  14. Versionhistory
  15. Use Synology as backupspace
  16. Additional pages about raspiBackup
  17. FAQ
  18. Useful links related to backup
  19. git Changelog
  20. Credits



raspiBackup helps to create a backup of a Raspberry Pi on a periodic base. The backup is created by the Raspberry itself and stored on an external storage device like an usb stick, an usb disk, nfs server, smbfs/cifs/samba drive, sshfs, davfs/webdav (Cloud)davfs/webdav (Cloud) etc. (See also How to access external data via smb, nfs, ssh, ftp and dafvs on Raspberry). A synology can also get the backups.

Of course restore of the backup is also handled by raspiBackup.

All running services should be stopped before the backup is started and restarted when the backup finished to get a consistent backup. Commands to start and stop the services can be passed to raspiBackup either via options or a sample wrapper script can be used, which allows to execute much more program controlled activities before and after the backup. Automount and unmount of the backup space is already coded in the sample wrapper script.

There exist two backup modes: The normal backupmode will save both SD card partitions mmcblk0p1 and mmcblk0p2. If the root partition was moved to an external partition (USB stick, USB disk, ...) this external root partition will be saved instead of mmcblk0p2. The second backup mode (partitionoriented mode) will save all or a configurable number of partitions of the SD card. That way it's possible to save NOOBs images and SD cards with more than two partitions.

The maximum number of backups is configurable and only the latest backups are kept. Possible backup methods are dd backup, tar backup, (both can be zipped also) and rsync backup .

Activation of raspiBackup is simple. Test the backup and finally add the script call in your crontab of your Raspberry Pi. Now you get an eMail every time a backup was created and will be informed about the backup result. Messages written by raspiBackup are in English and German.


  • Unattended backup of a running Raspberry PI (Pi backups itself)
  • Other similar SoCs are supported (Banana Pi, Ondroid, Beagle Board, Cubieboard, ...)
  • The partitionoriented backupmode backups a variable number of partitions of the SD card and thus can save NOOBs images and images with more than 2 partitions
  • Backup and restore is independent of the operating system (Linux, Windows or Mac) used to access the Raspberry Pi
  • Windows or Mac user just use the Raspberry to restore their backup
  • Windows user can restore dd backups with win32diskimager
  • Linux user can use their Linux system or the Raspberry to restore the backup
  • Extensionpoints allow to extend the script capabilities with custom code
  • Various backup targets, for example
    • External USB stick
    • External USB disk
    • Synology drives
    • cifs/samba mounted network drive
    • nfs mounted network drive
    • sshfs mounted network drive
    • webdav network drive
    • Mounted ftp server
    • In general every device which can be mounted on LInux
  • Simple restore of the backup
  • An external root filesystem on disk or USB stick will be saved with in the normal backup mode if tar or rsync backup is used
  • Can be used to clone Raspberry Pi
  • Simple installation. A configuration wizzard helps to configure the most important parameters.
  • Messages in English and German
  • Lots of invocation parameters to customize the backup process
  • dd, tar and rsync backup possible (-t option). rsync requires an ext3/ext4 partition for hardlinks
  • dd and tar can be zipped also to reduce the backup size (-z option)
  • dd backup can be enabled to save only the space used by the partitions. That way a 32GB SD card with a 8GB partition will only need 8GB for backup  (Available with version
  • Boot partition backups are saved with hardlinks to save backup space if enabled with an option. (Available with version )
  • Different backup types can be mixed per system (e.g. day backup uses rsync, weekly backup uses dd)
  • Automatic stop and start of running services before and after the backup (-a and -o option)
  • A Sample script helps to easily add additional activities to be executed before and after the backup. E.g. mount and unmount of the backup device
  • Number of backups to keep is configurable (-k option)
  • If the target SD card is smaller or larger than the original SD card the second root partition will be adjusted accordingly (Available with version
  • eMail is sent to report the backup progress and result (-e option)
  • rsync uses hardlinks to reduce the backup size
  • Supported eMail programs: mailx/mail, sendEmail and ssmtp (-s option)
  • Unsupported eMail clients can be used via the eMailExtension
  • Automatic notification if there is a newer version of raspiBackup available (-n option)
  • Simple update of raspiBackup to the latest version (-U option)
  • Simple restore of a previous version of raspiBackup (-V option)
  • Arbitrary directories and files can be excluded from the backup (-u option)
  • Multiple Raspberries can save their backup at the same place


High level overviewraspiBackupOverview


The current version of raspiBackup is An already existing configuration file of raspiBackup (/usr/local/etc/raspiBackup.conf) and an already existing version of the raspiBackup script (/usr/local/bin/raspiBackup.sh) will be saved in the corresponding directories by the installation script. Don't forget to read the FAQ page

Login as user pi on Raspberry

  1. Execute one of the following commands on your Raspberry to download and install raspiBackup. Upgrade from any version to the actual version is also possible. Backup copies of the script and the config file are created. But an update to the actual raspiBackup version is much easier by just using option -U. Don't forget to read the FAQ page.
    1. raspiBackup.sh will be installed in /usr/local/bin and a configuration wizzard is used for the most important configuration parameters and /usr/local/etc/raspiBackup.conf will be updated accordingly. Now raspiBackup can be started just by passing the backupDirectory.
      curl -s -L -O https://www.linux-tips-and-tricks.de/raspiBackupInstall.sh && sudo bash raspiBackupInstall.sh
    2. raspiBackup.sh will be installed in /usr/local/bin. In addition a standardconfigurationfile will be installed in /usr/local/etc/raspiBackup.conf. Comments are written in the configured system language of the Raspberry. The config file has to be updated manually.
      curl -s -L -O https://www.linux-tips-and-tricks.de/raspiBackupInstall.sh && sudo bash raspiBackupInstall.sh -c
    3. raspiBackup.sh will be installed in /usr/local/bin. In addition a standardconfigurationfile will be installed in /usr/local/etc/raspiBackup.conf. Comments are written in English. The config file has to be updated manually.
      curl -s -L -O https://www.linux-tips-and-tricks.de/raspiBackupInstall.sh && sudo bash raspiBackupInstall.sh -c -l EN
  2. raspiBackup can also be manually downloaded from following location with your browser or by executing following commands. raspiBackup.sh should be copied into /usr/local/bin and raspiBackup.conf should be copied into /usr/local/etc. The config file has to be updated manually.
    curl -s -L -O https://www.linux-tips-and-tricks.de/raspiBackup.sh
    curl -s -L https://www.linux-tips-and-tricks.de/downloads/raspibackup-en-conf/download > raspiBackup.conf
  3. Add the following line
    00 22  * * 0  /usr/local/bin/raspiBackup.sh -p /backup -t tar -k 4 -e This email address is being protected from spambots. You need JavaScript enabled to view it.  
    sudo crontab -e
    in crontab and then every Sunday at 20 pm a tar backup will be created in directory /backup and a notification eMail will be sent to This email address is being protected from spambots. You need JavaScript enabled to view it..

    Note: If the file /etc/crontab is changed directly the following line has to be added:
    00 22  * * 0 root /usr/local/bin/raspiBackup.sh -t tar -k 4 -e This email address is being protected from spambots. You need JavaScript enabled to view it.  /backup
  4. Finally a restore of the backup should be practiced and tested to get familiar with the procedure and to test the backup. It's very uggly if you need the backup and detect it's corrupt or data is missing.


Uninstall raspiBackup, all configurationfiles and the installationscript with

raspiBackupInstall.sh -u



As soon as the first backup was created successfully start testing the restore also. In addition make sure the restore of the system you backed is tested on a regular base and the restored system still works. It's too late when you detect the backup is crap if you need it to restore your system.

Invocationsyntax and -options

raspiBackup has to be invoked as user root or with sudo. The invocation syntax is

raspiBackup.sh Option1 Option2 Option3 ... backupdirectory 
There are a lot of options available to customize the backup process. The most important parameters are marked in red. Some options require addition parameters as -k 3 or -m 1.

All default options can be overwritten in a configuration file /usr/local/etc/raspiBackup.conf. A sample configuration file which has the standard options defined can be downloaded here.


Alphabetical sorted

Parameter Function Default Parameter in der Konfigdatei

Commands to start services stopped before the backup. Example "service xbmc start" (Attention: There are leading and trailing double quotes). This option is mandatory together with option -o.

Multiple commands have to be separated by && . As an alternative use a wrapperscript (See below). The commands should have the inverse sequence as the commands used for the  -o parameter.

If there are no services to stop use a colon ":" as parameter.

See also FAQ#1 and FAQ#18




Send ExtensionsCustomizationthe log in the notification email as attachement no




-b Blocksize used in the dd command 1MB




 -D Addition invocation parameters for dd command (e.G.. "conv=notrunc,noerror,sync")  None




 -e email address which will get a notification eMail  None




Optional additional parameters which are passed in the eMail call. For sendEmail use "-f sender.mail@senderdomain -s smtp-server:587 -xu username -xp password".

Attention: The parameters for -E have to have a leading and trailing double quote ". It's  useful to use parameter -F to speed up the test of the email notification function

Attention: If option -l 1 is used the password will be logged in the log file. Masquerade the password before sending the log to somebody.





-F Fake backup. This option is useful when raspiBackup is initially tested. The time consuming backup is not started but all the parameters are checked and an email is sent. No  
-G Define language of messages. Possible messages are DE (German) and EN (English). Volunteers to translate the messages into another languages are welcome.  Please contact me for details.

System language

If the system language is not supported EN (English) is used.



 -h  Help  No  
 -k Number of recent backups to keep  3




Log level defines whether a debug log will be created:

- off  -> No debug log

- debug -> Create debug log

Attention:  Logfile may contain sensitive data in some situations (E.g. external static IP addresses, eMailAddresses, passwords for mount commands or eMail server ...)






Location for the runtime log

- syslog -> /var/log/syslog

- varlog -> /var/log/raspiBackup/<hostname>.log

- backup -> <backupPath>

- current -> ./raspiBackup.log

syslog for backup

current for restore (fixed)





Message details:

- minimal -> Write important messages only

- detailed -> Write a lot of messages to show the progress





-M Starting with version this option allows to modify the backup directoryname. That way it's possibe to create backups in addition to the regular backups and give the backups meaningful names.    
-n Notify if there is a newer version of raspiBackup available Yes




-N Activation of custom extensions to activate custom code. See this page for details which also offers two sample extensions which report the CPU temperature and the memory utilization before and after the backup run. None




Commands to stop services before the backup. Example "service smb stop" (Attention: There are leading and trailing double quotes). This option is mandatory together with option -a.

Multiple commands have to be separated by && . As an alternative use a wrapperscript (See below). The commands should have the inverse sequences as the commands used for the  -a parameter

If there are no services to stop use a colon ":" as parameter.

See also FAQ#1 and FAQ#18 




-P Enables the partitionoriented backup mode which saves all partitions or a selected number of partitions of the SD card. This mode has to be used with NOOBs images and for images which have more than 2 partitions. See also parameter -T (Available with Version 0.6). Note: If this option is used an external root partition cannot be saved.





email program to use to sent the notification eMail  {mail|sendEmail|ssmtp}. Use mail also for mailx. For sendEmail use also parameter -E to pass mandatory parameters (See parameter -E description for details)

Other eMailClients will be used via the eMailExtension. Then mailext has to passed as the parameter. See this page for details about the eMailExtension.





Backup type which can be dd, tar or rsync. rsync requires an ext3/ext4 partition for Hardlinks. See details of the backuptypes. An external root filesystem will be saved if tar or rsync backup is used and option -P is not selected. Parameter -z can be used in addition to zip the backups to reduce the backup size.

Note: dd backup can be controlled by configuration parameter DEFAULT_DD_BACKUP_SAVE_USED_PARTITIONS_ONLY which saves backuptime and -space. For details of the parameter see bottom of table.





If the partitionoriented backupmode is selected with option -P this parameter can be used to define which partitions should be saved. Example: -T "1 2 5" saves the first two partitions and the fifth partition. * saves all partitions. (Available with Release 0.6)






Extension of the excludelist for a backup to exlude special files and directories.

Attention: Parameters have to follow the syntax of the backuptool used. Otherwise the backup will fail. Example for rsync or tar:

"--exclude=/backup/* --exclude=/rsnapshot/* --exclude=/www-data*/*".

Additional information about the syntax is available on the man pages of the backup tools used.

Following directories are not saved:
Backuppath used in invocation, /proc/* , /lost+found/* , /sys/* , /dev/* , /tmp/*, /boot/*, /run/* , /proc/* , /lost+found/* , /sys/* , /dev/* , /tmp/* , /boot/* , /run/*
In addition all mounted directories from external devices which are not mounted on / are not saved. It's only the boot parition /dev/mmcblk0p1 and the root partition /dev/mmcblk0p2 or the external root filesystem on /dev/sda1 which is saved.
Note for partitionoriented backup mode:
If option -P is used the directories mentioned above are exluded in all partition backups.
   */directory/* - Excludes directory on all partitions
   mmcblk0p2/verzeichnis/* - Excludes directory on partition mmcblk0p2
   directory/* - Excludes directory on all partitions





Upgrades the current raspiBackup version with the latest available version. The previous one will be saved as raspiBackup.sh.n.m where n and m are the versionnumbers of raspiBackup.

Attention: Read this page and understand which changes and new functions will become available before upgrading.

-v Verbose mode of the backup tools No



-V Presents a list of existing previous version and allows to select one of the version to restore. The actual version will be saved and can be restored later on. See also parameter -U. (Available with Release 0.6) No  
-y This option starts the deployment of the actual script to hosts which are defined in the configuration file. Access has to be possible without password and requires the keys to be copied into authorized_keys . That way you can quickly deploy a new script version on multiple hosts. No




-z Use gzip with dd or tar backup to reduce the backup size No





Starting with Version eMail will be sent only in case of backup failure Note: If raspiBackup crashes because of unexpected reasons it may happen there is no eMail send even the backup failed.

You use this option on your own risk.








Starting with Version Backupoptions used by rsync backup.

You use this option on your own risk.






  Starting with Version Backupoptions used by tarbackup. You use this option on your own risk. -cpi






Starting with Version Additional backupoptions used by rsync backup.

You use this option on your own risk.








Starting with Version Additional backupoptions used by rsync backup.

You use this option on your own risk.







  Starting with Version Bootpartition backups use hardlinks to minimze the backupspace because bootpartitions don't change often. Note: Ssupport of hardlinks on the backupspace required (ext3/ext4 filesystem) No





Starting with Version dd backup only saves the space used by defined partitions. That way a backup of a 32 GB SD card with a 8GB partition only needs 8GB. The root partition in general uses the the whole SD card and has to be resized with gparted or resize2fs first appropriately.

See also FAQ#16





Note: Options in the config file which are set to yes or no have to be set as 0 for no and 1 for yes.
All options for the restore of a backup are described here.

Themed sorted

  • Options, which configure the backup
    • -k : number of backups to keep
    • -t : Type of backup (dd, tar, rsync)
    • -P : Partitionorientierted backup mode
    • -z: Compression of backup for dd or tar
    • -u: Add additional pathes to explude from backup
    • -T: Define the partitions to backup for partition oriented mode
  • Options, which configure  the messages and logs
    • -m: Details of messages
    • -L: Location to store the execution log
    • -l: Enable debug mode
    • -G: Message language  (English or German)
    • -A: Send the execution log in the notification email
    • -v: Log all messages from backup tools used to create the backup
  • Options, which configure the notification email
    • -e: eMailAdress which receives the notification email
    • -s: eMailClientProgram which is used to send the notification email
    • -E: Optional parameters for emailClientprograms
    • -F: Simulates a backup run. useful to quickly test the eMail notification
  • Options,  which update, restore and distribute raspiBackup
    • -U: Update of raspiBackup with the lates version and saves the current version
    • -n: Enable notification when a new raspiBackup version is available
    • -V: Restore a previous raspiBackup version
    • -y: Distribute current raspiBackup on local hosts via scp
  • Options, which start and stop services and run extensions before and after backup processing
    • -o: Commands which stop services before the backup
    • -a: Commands which start services after the backup
    • -N: Defines extensions to invoke before and after backup processing
  • Miscellaneous options
    • -b: Blocksize which will be used for dd backup
    • -D: Additional optional dd options


Following options exist to extend the backup script with custom code:

1) Call a custom script which then calls the backup script and executes code before and after the backup

Following sample script is available and can be used and customized accoringly. Code which mounts and unmounts the backup partition is already included. Download of the sample script.

Prerequisite is to have the mountpoint already defined in /etc/fstab and copy the script in the following directory.

sudo mv raspiBackupWrapper.sh /usr/local/bin
sudo chmod +x /usr/local/bin/raspiBackupWrapper.sh

Now call raspiBackupWrapper.sh instead of raspiBackup.sh. Wrapper script source code is available on github and can be extended with a pull request.

2) Usage of extensionpoints to plug in your custom code

For details see here



To restore backups of type tar and rsync you need a Linux system. You oly need a Raspberry which runs Raspbian and an external SD Cardreader. A dd backup can also be restored with Windowstools. Follow these instructions to restore the backup


Errormessages and troubleshooting

It's possible raspiBackup.sh doesn't work as expected ans writes some messages. 90% of the time it's some misconfiguration or incorrect parameters. Read the error messages carefully. If you don't get why something gos wrong:
1) Start the script on the commandline and don't start it in the corntab
2) Use parameter -l 1 (lowercase L) when invoking the script and check the logfile written by raspiBackup for wrror messages. (Parameter -L deifines the location of the log file. See also the parameterdescription for -L. In addition para-eter -v can help to get further informations if errors occur in the backup tools.
3) If it's still not possible to locate the root cause of the issue post a commant on this page and describe your issue in detail

Backup types

Every backup method has it's pros and cons. See the following list to decide which backup method is the right one for you to use. It's even possible to combine different backup types.

dd Backup creates a consistent binary backup of the SD card. The whole SD card will be read and saved. But this includes also data which didn't change compared to the last backup. In addition the SD card for restore has to have at least the size as the original SD card. There is not any partition resized accordingly. This backup method stresses the SD card and is huge. Every dd backup can be restored with win32diskimager on Windows.
ddz Backup backups the whole SD card but compresses the final image. This method stresses the Pi CPU. There is no restore possible with windisk32manager on Windows.
tar Backup backups the whole SD card but only saves only the existing data and therefore the backup is usually much smaller than the whole SD card. Therfore the backup can be restored on a smaller SD card as long it's capable to keep the saved data.
tgz Backup backups the whole SD card but only saves only the existing data and therefore the backup is usually much smaller than the whole SD card. Therfore the backup can be restored on a smaller SD card as long it's capable to keep the saved data. This method stresses the Pi CPU.
rsync Backup backups data which was changed to the last backup only. Hardlinks of the ext3/ext4 filesystem guarantees there exists a consistent backup. There is no data compression. But this allows to restore files very easy by just copying the files. First backup takes a long time but all subsequent backups are created very fast.
  Full backup Backuptime Backupsize
Datacompression CPU stressed
Karte stressed Single file restore Filesystem
dd  yes high big no medium high no everything, fat32 max 4GB
ddz yes high medium yes high high no everything, fat32 max 4GB
 tar yes medium  medium no medium medium yes everything, fat32 max 4GB
tgz yes medium medium yes high medium yes everything, fat32 max 4GB
rsync yes (once), no low small no low low yes ext3/ext4


Comparison of partitionorientierted backup and normal backup

1) Normal backup

This standard mode saves the first two paritions. (bootpartition and rootpartition) of the SD card. In addition tar and rsync backup will save an external rootpartiion i.e. a partition located on an USB Stick or USB. The dd backup can be used to save the whole SD car which can be used to save NOOBS images. If the target SD card has more space than the source SD card the second partition is extended accordingly.

2) Partitionoriented backup

Every partition or a  given number of partitions on the SD card will be saved as tar or rsync. The number of partitions is not limited and this allows to save NOOBS images and images with more than 2 partitions. If the target SD card is larger than the source SD card the additional space will not be used.


Backupspace directory structure (Normal backup)

every backup creates a backup directory and a subdirectory which hat following format: <hostname> and a subdirectory <hostname>-<backuptype>-<backupdatum>. If option -M is used the folder created is <hostname>-<-M parameter> and the subfolder will be <hostname>-<backuptyp>-<backupdatum>.

Examples: Raspberry has hostname raspberrypi and a backip is created on 2016/04/15 at 22:29:00 THe directory created will be raspberrypi and the subdirectory will be raspberrypi-dd-backup-20160415-222900. If option -M is used with parameter "Hello world" the directory created will be raspberrypi-Hello_world and the subdirectory will be raspberrypi-dd-backup-20160415-222900.

See the following backup directory structure I use on my backupserver which is also a Raspberry Pi. You can see that some Pis save themself on a regular base whereas others are saved only manually. 5 Pis save themself which can be seen by the different hostnames used. In addition different backup types can be saved in one backup directory.

For every Raspberry there are three or five additional files created in addition to the data backup and are needed for the restore if the backup is no dd backup.

  1. .img - Bootpartition of the SD card
  2. .mbr - Master boot record of the SD card
  3. .sfdisk - Partitionlayout of the SD card - Result of sfdisk command
  4. .blkid - (Partitionoriented backup only) - Result of blkid command
  5. .parted - - (Partitionoriented backup only) - Result of parted command

root@jessie:/mnt/backup/raspberrypi# tree -L 2
├── raspberrypi-dd-backup-20160415-222900
│   └── raspberrypi-dd-backup-20160415-222900.img
├── raspberrypi-rsync-backup-20160416-094106
│   ├── backup
│   ├── bin
│   ├── boot
│   ├── boot.bak
│   ├── dev
│   ├── etc
│   ├── home
│   ├── lib
│   ├── lost+found
│   ├── media
│   ├── mnt
│   ├── opt
│   ├── proc
│   ├── raspberrypi-backup.img
│   ├── raspberrypi-backup.mbr
│   ├── raspberrypi-backup.sfdisk
│   ├── remote
│   ├── root
│   ├── run
│   ├── sbin
│   ├── selinux
│   ├── srv
│   ├── sys
│   ├── tmp
│   ├── usr
│   └── var
├── raspberrypi-tar-backup-20160415-204305
    ├── raspberrypi-backup.img
    ├── raspberrypi-backup.mbr
    ├── raspberrypi-backup.sfdisk
    └── raspberrypi-tar-backup-20160415-204305.tar


Backupspace directory structure (Partitionoriented backup) 

root@jessie:/mnt/backup/raspberrypi# tree -L 2
├── raspberrypi-dd-backup-20160415-222923
│   └── raspberrypi-dd-backup-20160415-222923.img
├── raspberrypi-rsync-backup-20160416-104548
│   ├── mmcblk0p1
│   ├── mmcblk0p2
│   ├── raspberrypi-backup.blkid
│   ├── raspberrypi-backup.fdisk
│   ├── raspberrypi-backup.mbr
│   ├── raspberrypi-backup.parted
│   └── raspberrypi-backup.sfdisk
└── raspberrypi-tar-backup-20160416-114748
    ├── mmcblk0p1.tar
    ├── mmcblk0p2.tar
    ├── raspberrypi-backup.blkid
    ├── raspberrypi-backup.fdisk
    ├── raspberrypi-backup.mbr
    ├── raspberrypi-backup.parted
    └── raspberrypi-backup.sfdisk


This backup- and restorescript raspiBackup was initally created for personal use only. But it's very useful and it therefore was published for general use. It's seriously tested but it's not possible to guarantee the script works as expected in all possible environments. Everybody uses this script on his own risk. The creator of this script is not liable in any case for any malfunction.



From time to time a new version of raspiBackup is published with new functions, extensions and small fixes. raspiBackup then will create a message and will note the update in the eMail sent with a smiley :-). Use parameter -U to download and install the latest version. The current version will be saved and can be restore with parameter -V. Which new functions extensions and bugs are fixed read on version history. Updates are available every couple of months. Fixes for serious bugs will be published immediately.


Additional pages about raspiBackup

Enhancement requests


Useful links related to backup

Shrinking images on Linux

rpi-clone: A shell script to clone a running Raspberry Pi SD card to a USB mounted SD card

sysmatt: Backup, Restore, Customize and Clone your Raspberry Pi SD Cards

Automatic RPi Image Downsizer

Add comment

Spam Kommentare sind sinnlos !
Vor der Publizierung wird jeder Beitrag auf Spam geprüft. Leider dauert es deswegen bis ein Kommentar sichtbar wird. Dafür erhält aber kein Subscriber Spam eMails.
Die eMail ist optional und nicht öffentlich sichtbar. Sie ist notwendig um eMail Benachrichtigungen zu Antworten auf Kommentare zu erhalten. Sie wird auch u.U. auch vom Seitenbetreiber genutzt um offline Kontakt aufzunehmen.

Spam comments are useless !
Any comment will be reviewed first and checked for spam. Unfortunately this delays the publishing of comments but will protect subscribers from spam.
eMail is optional and hidden and is required to get update notifications for any comments. In addition your eMail may be used by the website owner to get in contact with you offline.


0 #86 framp 2016-12-20 18:46
I noticed an increasing demand for support of Raspberry3 in raspiBackup. Owners of a Raspberry3 please read https://www.linux-tips-and-tricks.de/en/raspberry/486-raspibackup-raspberry3-support
0 #85 framp 2016-12-18 00:08
7 days are left ...

I wish a merry Christmas and a happy new year to all Raspberry users and hope you don't need raspiBackup to restore your data :-)

If you want to enjoy a small slideshow with photos from various christmas markets in Germany which were created by me and free of any viruses :-) -> Click me

Cu framp
0 #84 framp 2016-12-08 21:12
Due to the number of feature requests and bug reports for raspiBackup and the fact I have issues to manage all these requests and reports I decided to use github from now on to track all requests. Please use this link to github from now on to report any issues you face or new function you like to get from raspiBackup.
Don't worry about issues written in German - I'll handle translation from German to English and vice versa if there are any duplicates :-)

Cu framp
0 #83 Stephen 2016-09-14 22:02
Hello Framp,
My intent was to backup to a NAS via rsync but if I recall correctly, a ext4 file system was required for the root partition so my initial setup was going to be via the tar method using the normal backup option.

I have a 32G USB flash drive already setup with vfat and ext4 partitions so i can test all three backup types.

0 #82 framp 2016-09-14 21:18
Hi Stephen,

sounds good :-) Thank you very much.

Please be patient. Please note: I work on raspiBackup in my spare time and the modification will take some time. I'll contact you via eMail when I have a version for you to test.

Just let me still know which backup type (dd, tar or rsync) and backup mode (normal or partition oriented) you want to use with raspiBackup.

Cu framp
0 #81 Stephen 2016-09-14 20:21
Hi Framp,
Thanks for the quick reply.

And Yes I would be happy to be your guinea pig!

Let me know when you wish to begin.

0 #80 framp 2016-09-14 19:51
Hi Stephen,

at the time I started to write raspiBackup there was no Raspi3 available. Raspberry had to boot from mmcblk0. Frankly raspiBackup doesn't work without mmcblk0 as of now :sad:

But given the fact that Raspi3 allows to boot from an USB drive I think raspiBackup should also be able to backup and restore from and to /dev/sda.

I don't have a Raspi3 in order to execute any tests and I don't plan to buy one but I'm willing to extend the functionality of raspiBackup to support /dev/sdx also :-) . But I need somebody who is willing to execute tests on Raspi3 and send me feedback and debug logs :-*

If you volunteer to handle the test part of the development work I'll start working on this requirement :-)

Cu framp
0 #79 Stephen 2016-09-14 18:34
First thank you for your contributions to the Raspberry Pi community!

I am using a Raspi 3 setup to boot from a usb flashdrive. I am currently looking for an automated backup method using a NAS and it appeared RaspiBackup.sh was indeed a wonderful piece for the toolbox. However when i attempted to execute it (so far only using -F), an error appeared that it could not locate mmcblck0. After looking at the script, from what i could tell in my limited scripting skills, that DEVICE="mmcblk0 " is identified very early in the script thereby suggesting the script may be by limited to only SD card applications. My boot partition is "/dev/sda1 on /boot type vfat" with root at "/dev/sda2 on / type ext4". I thought to try to modify the script to work with the USB Boot configuration, but after studying the code for about 10 minutes, I knew I was in WAY over my head! Is there an option available currently that I am overlooking? Or is raspiBackup truly designed to support uSD card only?

Thanks for your time.
0 #78 framp 2016-08-02 20:03
Hi Peter,

great you managed to create a backup with raspiBackup :thumbsup:

As far as I can see you have to stop samba only.

Maybe other people reading this answer can confirm my statement. I'm not an expert on this.

My argument for -o on my raspis is
service nfs-kernel-serv er stop; service samba stop; service pilight stop; service cups stop; service minidlna stop

And please test the restored image carefully :-)

Cu framp
+1 #77 Peter 2016-08-02 06:35
Hello Framp
Finally getting around to making the backup !!! Bought some USB flash drives. But , in order to run your program, you said to stop running services, and to provide a list if I am not sure.
I certainly don't know what services are necessary "to keep the state of the system", as you say.
So, here below is my list of currently running services.
Any advice most welcome about which ones to stop!!!

$ sudo service --status-all
[ - ] alsa-utils
[ + ] avahi-daemon
[ + ] bluetooth
[ - ] bootlogs
[ - ] bootmisc.sh
[ - ] checkfs.sh
[ - ] checkroot-bootc lean.sh
[ - ] checkroot.sh
[ + ] console-setup
[ + ] cron
[ + ] dbus
[ + ] dhcpcd
[ + ] dphys-swapfile
[ + ] fake-hwclock
[ + ] hdparm
[ - ] hostname.sh
[ - ] hwclock.sh
[ + ] kbd
[ + ] keyboard-setup
[ - ] killprocs
[ + ] kmod
[ + ] lightdm
[ - ] motd
[ - ] mountall-bootcl ean.sh
[ - ] mountall.sh
[ - ] mountdevsubfs.s h
[ - ] mountkernfs.sh
[ - ] mountnfs-bootcl ean.sh
[ - ] mountnfs.sh
[ + ] networking
[ - ] nfs-common
[ + ] nmbd
[ + ] ntp
[ - ] plymouth
[ - ] plymouth-log
[ + ] procps
[ + ] raspi-config
[ + ] rc.local
[ - ] rmnologin
[ - ] rpcbind
[ - ] rsync
[ + ] rsyslog
[ + ] samba
[ + ] samba-ad-dc
[ - ] sendsigs
[ + ] smbd
[ + ] ssh
[ - ] sudo
[ + ] triggerhappy
[ + ] udev
[ + ] udev-finish
[ - ] umountfs
[ - ] umountnfs.sh
[ - ] umountroot
[ + ] urandom
[ + ] webmin
[ - ] x11-common
pi@rpiserver:~ $