Duplicati RPi setup on 64-bit Ubuntu OS Jammy (22.04)

Setting up Duplicati on Ubuntu Jammy (22.04) for Raspberry Pi (RPI) is a great way to ensure your data is securely backed up. Duplicati is a free, open-source backup solution that allows you to store encrypted, incremental, and compressed backups on various cloud storage services and remote file servers. It supports a wide range of storage options, including Amazon S3, Google Drive, Dropbox, Onedrive and many more.

Duplicati uses AES-256 encryption to secure your data before it is uploaded, ensuring your privacy is protected from unauthorized access. The software is designed to handle network issues and interrupted backups efficiently, making it a reliable choice for online backups.

This guide will walk you through the process of installing and configuring Duplicati on your RPI running the 64-bit ARM version of Ubuntu Jammy.

Steps to setup Duplicati:
-Download the latest Duplicati-package (2.0.8.1 as of writing this page)

wget https://updates.duplicati.com/beta/duplicati_2.0.8.1-1_all.deb


Output:
--2024-08-26 11:12:53--  https://updates.duplicati.com/beta/duplicati_2.0.8.1-1_all.deb
Resolving updates.duplicati.com (updates.duplicati.com)... 2606:4700:7::60, 2a06:98c1:58::60, 172.66.0.96, ...
Connecting to updates.duplicati.com (updates.duplicati.com)|2606:4700:7::60|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 32505580 (31M) [application/x-debian-package]
Saving to: ‘duplicati_2.0.8.1-1_all.deb.1’

duplicati_2.0.8.1-1_all.deb.1                   100%[====================================================================================================>]  31.00M  11.3MB/s    in 2.7s

2024-08-26 11:12:56 (11.3 MB/s) - ‘duplicati_2.0.8.1-1_all.deb.1’ saved [32505580/32505580]

-Install the package

apt install ./duplicati_2.0.8.1-1_all.deb

Output:
.....
snip
.....
137 new root certificates were added to your trust store.
Import process completed.
Done
done.
Setting up duplicati (2.0.8.1-1) ...
Setting up mono-devel (6.8.0.105+dfsg-3.2) ...
update-alternatives: using /usr/bin/mono-csc to provide /usr/bin/cli-csc (c-sharp-compiler) in auto mode
update-alternatives: using /usr/bin/resgen to provide /usr/bin/cli-resgen (resource-file-generator) in auto mode
update-alternatives: using /usr/bin/al to provide /usr/bin/cli-al (assembly-linker) in auto mode
update-alternatives: using /usr/bin/sn to provide /usr/bin/cli-sn (strong-name-tool) in auto mode
Setting up mono-xsp4-base (4.2-2.3) ...
Setting up mono-xsp4 (4.2-2.3) ...
Using Mono XSP 4 port: 8084
Binding Mono XSP 4 address: 0.0.0.0
Use of uninitialized value $libs in concatenation (.) or string at /usr/sbin/mono-xsp4-update line 216.
Setting up monodoc-http (4.2-3.1) ...
Use of uninitialized value $libs in concatenation (.) or string at /usr/sbin/mono-xsp4-update line 216.
Processing triggers for libgdk-pixbuf-2.0-0:arm64 (2.42.8+dfsg-1ubuntu0.3) ...

As next we start the Duplicati-service and check if the service is running:

systemctl start duplicati
systemctl status duplicati

Output:
● duplicati.service - Duplicati web-server
     Loaded: loaded (/lib/systemd/system/duplicati.service; disabled; vendor preset: enabled)
     Active: active (running) since Mon 2024-08-26 11:24:22 CEST; 4s ago
   Main PID: 1129 (mono)
      Tasks: 16 (limit: 4422)
     Memory: 55.7M
        CPU: 2.516s
     CGroup: /system.slice/duplicati.service
             ├─1129 DuplicatiServer /usr/lib/duplicati/Duplicati.Server.exe
             └─1133 /usr/bin/mono-sgen /usr/lib/duplicati/Duplicati.Server.exe

Aug 26 11:24:22 raspi24n systemd[1]: Started Duplicati web-server.

Duplicati uses port 8200 and binds the service per default to the loopback-address.

-To get access from remote to the Duplicati Gui edit /etc/default/duplicati and add “–webservice-interface=any” to the DAEMON_OPTS

vi /etc/default/duplicati

# Defaults for duplicati initscript
# sourced by /etc/init.d/duplicati
# installed at /etc/default/duplicati by the maintainer scripts

#
# This is a POSIX shell fragment
#

# Additional options that are passed to the Daemon.
DAEMON_OPTS="--webservice-interface=any"

-Restart the service

systemctl restart duplicati

Now you are able to access the Duplicati-GUI from remote on port 8200:
http://[IP-RPI]:8200

Make sure to set a password , close the page with <OK>:

In case you want to have the service activated at boot-time enable the service at startup:

systemctl enable duplicate

Output:
Created symlink /etc/systemd/system/multi-user.target.wants/duplicati.service → /lib/systemd/system/duplicati.service.

et voilà ! Duplicati is now up and running in a very basic setup.

To increase security make the Duplicati-page secure with adding a PKCS12-Container to have HTTPS-security enabled.

The Daemon-opts statement needs to be enhanced with:

--webservice-sslcertificatefile=[path]
--webservice-sslcertificatepassword=[password (empty is ok]
(in case the PKCS12-Container is unprotected(=no password set)), please keep in mind to add the second statement with an empty password. Additional instructions can be found on the Duplicati-docs.


Example-section:


ADD-ON: example to backup a folder to Onedrive
Duplicati’s robust features, including AES-256 encryption, ensure that your data is securely backed up and protected from unauthorized access. 

This small guide shows you how to create a daily, incremental Backup of a local RPI-folder to Onedrive:

Local folder to Backup: /daten/important_data
Onedrive Backup folder: /Backup/rpi_backup

Access the Duplicati-Gui and add a Backup:

Bosch Heat-pump, Influx, Grafana and Home-Assistant: get the water-temperature presented

Used Hard/Software:
Home Assistant Frontend 20240806.1
Core 2024.8.0
Supervisor 2024.08.0
Operating System 12.4

HA-Integration: Bosch custom component v0.26.1

It was a hard time to find the right Grafana-settings to get the water-temperature presented.
Bosch/Home-Assistant transports this value based on the state-series:

Hence Grafana needs a statement as shown:

Example output:

Done 🙂

remove/rename files with spaces in filename(s)

Let’s examine the folder structure:

Search for files with space(s) in the filename(s)

To do a search within the current folder for all files with a space in the filename do:

find . -maxdepth 1 -type f -name "* *" | while read file; do ls -la   "$file"; done |more
-rw-r--r--  1 ugu5ma  staff  8 Dec 29 14:38 ./file 2.txt
-rw-r--r--  1 ugu5ma  staff  13 Dec 29 14:38 ./file 3.txt
-rw-r--r--  1 ugu5ma  staff  6 Dec 29 14:38 ./file 1.txt

the “-maxdepth 1” parameter limits the search within the current folder.
-maxdepth 2” would search within the current and the first subfolder(s)

To do a recursive search for all files with a space in the filename do:

find . -type f -name "* *" | while read file; do ls -la   "$file"; done |more
-rw-r--r--  1 ugu5ma  staff  8 Dec 29 14:38 ./file 2.txt
-rw-r--r--  1 ugu5ma  staff  13 Dec 29 14:38 ./file 3.txt
-rw-r--r--  1 ugu5ma  staff  6 Dec 29 14:38 ./file 1.txt
-rw-r--r--  1 ugu5ma  staff  8 Dec 29 14:38 ./1/subfolder/file 2.txt
-rw-r--r--  1 ugu5ma  staff  13 Dec 29 14:38 ./1/subfolder/file 3.txt
-rw-r--r--  1 ugu5ma  staff  6 Dec 29 14:38 ./1/subfolder/file 1.txt
-rw-r--r--  1 ugu5ma  staff  8 Dec 29 14:38 ./1/file 2.txt
-rw-r--r--  1 ugu5ma  staff  13 Dec 29 14:38 ./1/file 3.txt
-rw-r--r--  1 ugu5ma  staff  6 Dec 29 14:38 ./1/file 1.txt
-rw-r--r--  1 ugu5ma  staff  8 Dec 29 14:38 ./3/file 2.txt
-rw-r--r--  1 ugu5ma  staff  13 Dec 29 14:38 ./3/file 3.txt
-rw-r--r--  1 ugu5ma  staff  6 Dec 29 14:38 ./3/file 1.txt
-rw-r--r--  1 ugu5ma  staff  8 Dec 29 14:38 ./2/file 2.txt
-rw-r--r--  1 ugu5ma  staff  13 Dec 29 14:38 ./2/file 3.txt
-rw-r--r--  1 ugu5ma  staff  6 Dec 29 14:38 ./2/file 1.txt

Rename files with space(s) in filename(s)

To replace the space with an underscore for files within the current folder execute:

find . -maxdepth 1 -type f -name "* *" | while read file; do mv "$file" ${file// /_}; done

➜  ordner ls -l
total 24
drwxr-xr-x  6 ugu5ma  staff  192 Dec 29 14:51 1
drwxr-xr-x  5 ugu5ma  staff  160 Dec 29 14:39 2
drwxr-xr-x  5 ugu5ma  staff  160 Dec 29 14:39 3
-rw-r--r--  1 ugu5ma  staff    6 Dec 29 14:38 file_1.txt
-rw-r--r--  1 ugu5ma  staff    8 Dec 29 14:38 file_2.txt
-rw-r--r--  1 ugu5ma  staff   13 Dec 29 14:38 file_3.txt

the files in the subfolders are still untouched:

ordner find . -type f -name "* *" | while read file; do ls -la   "$file"; done |more
-rw-r--r--  1 ugu5ma  staff  8 Dec 29 14:38 ./1/subfolder/file 2.txt
-rw-r--r--  1 ugu5ma  staff  13 Dec 29 14:38 ./1/subfolder/file 3.txt
-rw-r--r--  1 ugu5ma  staff  6 Dec 29 14:38 ./1/subfolder/file 1.txt
-rw-r--r--  1 ugu5ma  staff  8 Dec 29 14:38 ./1/file 2.txt
-rw-r--r--  1 ugu5ma  staff  13 Dec 29 14:38 ./1/file 3.txt
-rw-r--r--  1 ugu5ma  staff  6 Dec 29 14:38 ./1/file 1.txt
-rw-r--r--  1 ugu5ma  staff  8 Dec 29 14:38 ./3/file 2.txt
-rw-r--r--  1 ugu5ma  staff  13 Dec 29 14:38 ./3/file 3.txt
-rw-r--r--  1 ugu5ma  staff  6 Dec 29 14:38 ./3/file 1.txt
-rw-r--r--  1 ugu5ma  staff  8 Dec 29 14:38 ./2/file 2.txt
-rw-r--r--  1 ugu5ma  staff  13 Dec 29 14:38 ./2/file 3.txt
-rw-r--r--  1 ugu5ma  staff  6 Dec 29 14:38 ./2/file 1.txt

To replace the space with an underscore for files within the current folder and subfolders execute:

find . -type f -name "* *" | while read file; do mv "$file" ${file// /_}; done

Danger zone: delete files in current and subfolder with space(s) in filename(s)

find . -type f -name "* *" | while read file; do rm "$file"; done

Ubuntu: remove ipv4-protocol from ethernet interface

On my Ubuntu-host I have my ethernet-interface connected to an mirror-port.
I want to remove the ipv4-protocol from this interface to avoid unnecessary traffic on this interface.

With root-rights execute “nmcli connection show –active”:

ugu5ma nmcli connection show --active
NAME             UUID                                  TYPE      DEVICE          
Fleischele2      8877f4c8-b38d-4028-a71d-b237d8ff649e  wifi      wlp3s0          
br-5bece4d6fbd8  3a34eddc-2c98-4140-9b40-74bcd355cde4  bridge    br-5bece4d6fbd8 
docker0          8de484ba-00e4-4130-b629-0037e3b00015  bridge    docker0         
enp6s0           57bc44f6-5190-42b2-b17f-e928868a42c0  ethernet  enp6s0 

my ethernet-interface (enp6s0) has UUID 57bc44f6-5190-42b2-b17f-e928868a42c0.

Let’s remove ipv4 :

ugu5ma nmcli connection modify 57bc44f6-5190-42b2-b17f-e928868a42c0 ipv4.method disabled

Check again:

➜  ugu5ma nmcli connection show --active                                                   
NAME         UUID                                  TYPE  DEVICE 
Fleischele2  8877f4c8-b38d-4028-a71d-b237d8ff649e  wifi  wlp3s0 

done!