Loxone backup - Docker container

Einklappen
X
 
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge
  • jereminius
    Dumb Home'r
    • 03.09.2021
    • 17

    #1

    Loxone backup - Docker container

    Hi,
    I made a Docker container for backing up the Loxone miniserver, I tought it would help someone else so I published it on Docker Hub:


    GitHub repository: https://github.com/jereminius/loxonebackup

    If you have any tips or issues, feel free to comment, its my first ever Docker container.

    edit: added github repo
    Zuletzt geändert von jereminius; 01.12.2022, 15:21.
  • hismastersvoice
    Supermoderator
    • 25.08.2015
    • 7265

    #2
    Thanks...
    What is the difference to the Loxberry MiniServer Backup?
    Are you able to Backup & Restore or only Backup?
    Kein Support per PN!

    Kommentar

    • jereminius
      Dumb Home'r
      • 03.09.2021
      • 17

      #3
      I cant really tell as I dont use Loxberry. My container backs up all the data from the miniserver, puts them in a folder (incremental - so only files with changes are downloaded), then it creates an archive. So in the backup folder you have a folder with the data from the miniserver, a folder with the archives and a log with the latest backup.

      AFAIK the restoration is made in the Loxone config, dont know how the Loxberry backup works, I never had to actually restore anything yet.

      Kommentar


      • hismastersvoice
        hismastersvoice kommentierte
        Kommentar bearbeiten
        Loxberry is more or less the same... 
        Restore has to be done with the Config.
        ​​​​​​​

      • jereminius
        jereminius kommentierte
        Kommentar bearbeiten
        I run my own server with a lot of stuff in Docker, so it made sense for me to make a solution just like that.
    • jereminius
      Dumb Home'r
      • 03.09.2021
      • 17

      #4
      This is whats in the folder after a backup has been done (I keep only 3 latest backups for now).
      Angehängte Dateien

      Kommentar

      • jokay
        Dumb Home'r
        • 15.08.2022
        • 15

        #5
        jereminius It's a very good idea, but I'm not sure if a "closed-source" Docker container where you provide your credentials of your Loxone Miniserver will be accepted by security-aware people?

        I was searching for a similar solution myself but would rather make this open-source on GitHub and build the container as multi-arch so it can be used on a e.g. RaspberryPi too.

        I think when I have time I will create an open-source Docker container based on Alpine Linux and multi-arch myself
        Zuletzt geändert von jokay; 30.11.2022, 16:43.

        Kommentar

        • jereminius
          Dumb Home'r
          • 03.09.2021
          • 17

          #6
          jokay give me a sec, ill publish it on github also. There is nothing sketchy going on, its based on Alpine Linux, you can check that btw on the Docker Hub also, you see the Dockerfile, just not the running scripts. I dont have a free Raspberry now, but i want to make an arm based version also.

          Kommentar

          • jereminius
            Dumb Home'r
            • 03.09.2021
            • 17

            #7
            Here you go: https://github.com/jereminius/loxonebackup

            Kommentar

            • jokay
              Dumb Home'r
              • 15.08.2022
              • 15

              #8
              Looks good, I made one myself with multi-arch and different options:
              Zuletzt geändert von jokay; 01.12.2022, 14:31.

              Kommentar

              • jereminius
                Dumb Home'r
                • 03.09.2021
                • 17

                #9
                Yeah i took a look at it. Looks good, only i prefer the cron approach. It can be hard for someone to understand, but you have more flexibility then interval based backup.

                Kommentar

                • jokay
                  Dumb Home'r
                  • 15.08.2022
                  • 15

                  #10
                  Yes, I decided against cron for the first version but I may add this later as well, we will see

                  Kommentar

                  • Acidcliff
                    Dumb Home'r
                    • 06.09.2021
                    • 11

                    #11
                    Very cool! Thank you very much to both of you!

                    Kommentar

                    • Flymaik
                      Azubi
                      • 13.01.2018
                      • 2

                      #12
                      Zitat von jokay
                      Looks good, I made one myself with multi-arch and different options:
                      Hallo jokay,

                      great job with the docker backup tool. Just a question on this: Where do the tool writes the backup data? It should be in a data directory, but where is this directory? should I create a folder named data inside the docker folder on my NAS, maybe in the container folder, or at an other path?

                      Thank you for a little explanation.

                      ​​​​​​​Flymaik

                      Kommentar

                      • jokay
                        Dumb Home'r
                        • 15.08.2022
                        • 15

                        #13
                        Flymaik you need to mount the `/data` folder to your Docker host or to a remote NFS share.

                        The left part on volumes is the path on the Docker host / NFS share and the right part is the path inside the Docker container.

                        The sample shows how to mount it to the Docker host, relative to the location of the `docker-compose.yml`:

                        Klicke auf die Grafik für eine vergrößerte Ansicht  Name: image.png Ansichten: 3 Größe: 35,0 KB ID: 373379
                        or relative to the location where you execute the `docker run` command:

                        Klicke auf die Grafik für eine vergrößerte Ansicht  Name: image.png Ansichten: 3 Größe: 28,5 KB ID: 373380
                        Personally I mount an NFS share from the NAS for this, see the Docker documentation: https://docs.docker.com/storage/volu...-an-nfs-volume.

                        This is my `docker-compose.yml` I currently use:

                        ​​Klicke auf die Grafik für eine vergrößerte Ansicht  Name: image.png Ansichten: 0 Größe: 84,1 KB ID: 373386

                        Hope this helps
                        Zuletzt geändert von jokay; 03.01.2023, 06:21.

                        Kommentar


                        • HBeumer
                          HBeumer kommentierte
                          Kommentar bearbeiten
                          When running your container on a Synology (DSM 7) I don't really see a backup. the log output does show that there's 630 files to backup. but none of these files makes it across.
                      • jereminius
                        Dumb Home'r
                        • 03.09.2021
                        • 17

                        #14
                        So I decided to update the code, and added some functionality.

                        - MQTT message sender (backup failed/completed)
                        - better scheduler
                        - better logging with timestamps
                        - multiarch build (now works on Rasperry too)


                        Klicke auf die Grafik für eine vergrößerte AnsichtName: image (1).pngAnsichten: 0Größe: 4,7 KBID: 391587
                        Docker Hub:
                        https://hub.docker.com/r/jereminius/loxonebackup



                        Klicke auf die Grafik für eine vergrößerte AnsichtName: image (2).pngAnsichten: 0Größe: 4,8 KBID: 391588
                        GitHub repository:
                        https://github.com/jereminius/loxonebackup


                        Kommentar


                        • HBeumer
                          HBeumer kommentierte
                          Kommentar bearbeiten
                          looks good, not very clear though where the final compressed file is saved. may want to add that as an option to the container.

                        • jereminius
                          jereminius kommentierte
                          Kommentar bearbeiten
                          Honestly i dont remember. I set it up once with duplicati and since i havent touched it. I can look into it tomorrow, but irc it should be in the folder called after your IP/archives?
                      • jereminius
                        Dumb Home'r
                        • 03.09.2021
                        • 17

                        #15
                        HBeumer

                        This is how my docker compose looks like:

                        Klicke auf die Grafik für eine vergrößerte Ansicht

Name: scr1.png
Ansichten: 249
Größe: 16,1 KB
ID: 417390

                        I mounted the /usr/loxone_scheduler/backups to /data/backup/loxone on my computer. This is where the archives are:

                        Klicke auf die Grafik für eine vergrößerte Ansicht

Name: scr2.png
Ansichten: 231
Größe: 7,7 KB
ID: 417391

                        you can do something like this if you want to only mount the folder with the archives:

                        - /your/folder/with/backups:/usr/loxone_scheduler/backups/archives​

                        Kommentar

                        Lädt...