Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. [gelößt] größe influxDB ermitteln

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    [gelößt] größe influxDB ermitteln

    This topic has been deleted. Only users with topic management privileges can see it.
    • E
      ente34 @Thomas Braun last edited by

      @Thomas-Braun
      Bei mir nicht (warum?)

      pi@raspi-iobroker:~ $  du -sh  /var/lib/influxdb/data/
      du: das Verzeichnis '/var/lib/influxdb/data/_internal' kann nicht gelesen werden: Keine Berechtigung
      du: das Verzeichnis '/var/lib/influxdb/data/iobroker' kann nicht gelesen werden: Keine Berechtigung
      12K     /var/lib/influxdb/data/
      pi@raspi-iobroker:~ $
      
      
      E Thomas Braun 2 Replies Last reply Reply Quote 0
      • E
        ente34 @ente34 last edited by

        @ente34
        Berechtigungen bei mir:

        pi@raspi-iobroker:~ $ ls -l /var/lib/influxdb/data/
        insgesamt 8
        drwx------ 4 influxdb influxdb 4096 Sep  7 18:13 _internal
        drwx------ 4 influxdb influxdb 4096 Sep  8 17:03 iobroker
        
        
        1 Reply Last reply Reply Quote 0
        • Thomas Braun
          Thomas Braun Most Active @ente34 last edited by

          @ente34
          Oh, sorry, mein Fehler, hab in einem anderen Verzeichnis geschaut.

          J 1 Reply Last reply Reply Quote 0
          • J
            jeti @Thomas Braun last edited by

            ah perfekt! danke!
            aber was stimmt hier nicht:

            var result;
            
            
            schedule("* * * * *", async function () {
              exec('sudo du -sh /var/lib/influxdb/data/', async function (error, result, stderr) {
                  setState("javascript.0.System.influxDB_size"/*influxDB_size*/, result);
              });
            });
            

            das Skript scheint nichts zu tun, folgende info Meldung gibts, sonst nichts...

            javascript.0 (14224) script.js.Datenbank.DB_size: registered 0 subscriptions and 1 schedule
            

            wo liegt mein Denkfehler?
            Gruß

            E 1 Reply Last reply Reply Quote 0
            • E
              ente34 @jeti last edited by

              @jeti
              Nein, das ist ein sudo-Problem.
              (Ich gehe davon aus, dass Du in der javascript-Instanz "exec" erlaubt hast)
              Du siehst es, wenn Du stderr ausgibts.

              Meine Unix Kenntnisse stammen von AIX(IBM) Mitte der 90er, da gab es noch kein sudo.
              Du kannst Dir aber (einmalig) die Leserechte setzen und dann in Deinem Script ohne sudo arbeiten.

              sudo chmod -R ugoa+r /var/lib/influxdb/data 
              sudo find /var/lib/influxdb/data/ -type d -exec chmod uoga+x {} \;
              

              Kontrollieren ohne sudo:

              du -sh /var/lib/influxdb/data/ | cut -f1
              
              Thomas Braun 1 Reply Last reply Reply Quote 0
              • Thomas Braun
                Thomas Braun Most Active @ente34 last edited by

                @ente34 @jeti
                Bevor ich die Rechte da so biegen würde würde ich mal mit

                sudo -u influxdb
                

                mein Glück versuchen.

                E J 2 Replies Last reply Reply Quote 0
                • E
                  ente34 @Thomas Braun last edited by

                  @Thomas-Braun
                  Guter Tipp, hat aber bei mir nicht funktioniert.
                  Und mit /etc/sudoers.d/ kenne ich mich leider nicht aus ...

                  1 Reply Last reply Reply Quote 0
                  • J
                    jeti @Thomas Braun last edited by

                    @Thomas-Braun du hast recht, hier liegt der Hund begraben:

                    sudo -u iobroker du -sh /var/lib/influxdb/data/
                    du: cannot read directory '/var/lib/influxdb/data/_internal': Permission denied
                    du: cannot read directory '/var/lib/influxdb/data/iobroker': Permission denied
                    12K     /var/lib/influxdb/data/
                    

                    dann fix die rechte vergeben:

                    sudo chmod -R 755 /var/lib/influxdb/data/
                    

                    und schon klappts:

                    sudo -u iobroker du -sh /var/lib/influxdb/data/
                    

                    Skript pass ich morgen an uns stelle es hier rein

                    J 1 Reply Last reply Reply Quote 0
                    • J
                      jeti @jeti last edited by

                      Skript sieht nun so aus:

                      var result;
                      
                      
                      schedule('{"time":{"start":"00:00","end":"24:00","mode":"hours","interval":6},"period":{"days":1}}', async function () {
                        exec('du -sh /var/lib/influxdb/data/', async function (error, result, stderr) {
                            setState("javascript.0.System.influxDB_size"/*influxDB_size*/, parseFloat(result));
                        });
                      });
                      

                      Danke für die Hilfe

                      1 Reply Last reply Reply Quote 0
                      • L
                        loverz last edited by

                        Wenn der Befehl:

                        sudo du -sh /var/lib/influxdb/data/
                        

                        folgendes ausspuckt:
                        19M /var/lib/influxdb/data/

                        ist meine Datenbank dann 19 MB groß?

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        Support us

                        ioBroker
                        Community Adapters
                        Donate
                        FAQ Cloud / IOT
                        HowTo: Node.js-Update
                        HowTo: Backup/Restore
                        Downloads
                        BLOG

                        925
                        Online

                        31.9k
                        Users

                        80.2k
                        Topics

                        1.3m
                        Posts

                        influxdb
                        4
                        13
                        6203
                        Loading More Posts
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes
                        Reply
                        • Reply as topic
                        Log in to reply
                        Community
                        Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                        The ioBroker Community 2014-2023
                        logo