It's possible to add custom code which is executed before and after the backup process via two script extensions. They are useful if modification of the backup script is required to extent the script capabilities and will be lost and thus have to be merged again and again every time when raspiBackup will be updated.

Two extensions are available and can be used as samples for extensions. They report the CPU temperature and memory utilization pre and post a backup run.

If you create your own extension please share it with the community and announce it's availability in a comment. If there is any function missing for the extensions please write a comment and I'll check whether it's possible to provide the missing function.



  1. Following command installs the two extension in /usr/local/bin on Raspberry Pi:
    wget -O -q && bash 
  2. If you want to install the extensions manually download them with your browser or execute following command on your raspberry Pi to download the tar file and extract the contents to  /usr/local/bin.
    wget -O raspiBackupSampleExtensions.tgz
    tar -xzf raspiBackupSampleExtensions.tgz -C /usr/local/bin

Following scripts will be copied into /usr/local/sbin:

1) and

2) and


To activate the extension add following parameter to the raspiBackup call

-N "temp mem"

or add the following line to the config file


For details of the parameters and config file see this page.



Starting with version there exists an emailExtension which allows to write custom code which will send the eMail. That's very useful if the supported eMail clients of the script do not support the used eMailClient. In addition the format of the eMail can be customized. A sample emailExtension which uses mailx is included in the sample extension package.

The eMailExtension is used if mailext is used as parameter for -s. A script called will be called and has to handle the email creation and sending. Following parameters will be passed to the mailExtension script:

email="$1"        # target email address
subject="$2"      # email subject
content="$3"      # email contents
parms="$4"        # addtl email parms passed with -E
append="$5"       # file to append

If you create an eMailExtension for a special eMailClient please write a comment at the bottom of this page. There may be other interested in the extension also.



1) It's not required to have both pre and post scripts implemented.

2) When testing the extensions the parameter -F is very useful. This flag disables the backup process and speeds up script execution.

3) The return code of the backup process is passed as parameter to the extension script. 0 <=> OK, <>0 <=> failure

4) If you want to share your extension code just create a pull request on github where all the extension source code is available for sharing and update.

Add comment

Spam Kommentare sind sinnlos denn sie werden nicht publiziert. Sie werden vor der Publizierung auf Spam geprüft. Deshalb kann es aber etwas dauern bis ein Kommentar sichtbar wird.
Die eMail ist optional und nicht öffentlich sichtbar Sie wird u.U. genutzt um offline zu kommunizieren

Spam comments are useless because they will not be published. Before they are published they are checked for spam. Therefore it may take some time until the comment is published.
eMail is optional and hidden and may be used to contact you offline