Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Script anhalten und wieder starten über ein anderes Script

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Script anhalten und wieder starten über ein anderes Script

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

      @manuel001 sagte in Script anhalten und wieder starten über ein anderes Script:

      Ist das normal?

      Natürlich.
      Für solche systemnahen Dinge braucht es entsprechende Rechte. Aber auch die gibt man seinem Standarduser und dann setzt man vor diese systemkritischen Kommandos nur ein sudo
      Also:

      sudo apt update
      sudo apt full-upgrade
      
      M 1 Reply Last reply Reply Quote 0
      • M
        Manuel001 @Thomas Braun last edited by

        iobroker und vis Adapter ist installiert.
        Daten jetzt übertragen mit Backitup?

        DJMarc75 1 Reply Last reply Reply Quote 0
        • DJMarc75
          DJMarc75 @Manuel001 last edited by

          @manuel001 vll zeigst Du vorher mal die Ausgabe von

          iob diag
          

          😉

          M 1 Reply Last reply Reply Quote 0
          • M
            Manuel001 @DJMarc75 last edited by

            @djmarc75

            Skript v.2023-04-16
            
            *** BASE SYSTEM ***
            Architecture    : aarch64
            Docker          : false
            Virtualization  : none
            Distributor ID: Debian
            Description:    Debian GNU/Linux 11 (bullseye)
            Release:        11
            Codename:       bullseye
            
            PRETTY_NAME="Armbian 23.02.2 Bullseye"
            NAME="Debian GNU/Linux"
            VERSION_ID="11"
            VERSION="11 (bullseye)"
            VERSION_CODENAME=bullseye
            ID=debian
            HOME_URL="https://www.debian.org/"
            SUPPORT_URL="https://www.debian.org/support"
            BUG_REPORT_URL="https://bugs.debian.org/"
            
            Systemuptime and Load:
             18:02:21 up 3 min,  1 user,  load average: 0.32, 0.42, 0.20
            CPU threads: 4
            
            
            *** Time and Time Zones ***
                           Local time: Thu 2023-04-27 18:02:21 CEST
                       Universal time: Thu 2023-04-27 16:02:21 UTC
                             RTC time: Thu 1970-01-01 00:03:56
                            Time zone: Europe/Vienna (CEST, +0200)
            System clock synchronized: yes
                          NTP service: active
                      RTC in local TZ: no
            
            *** User and Groups ***
            mf
            /home/mf
            mf tty disk dialout sudo audio video plugdev games users systemd-journal input n                                                                                                                                                             etdev ssh iobroker
            
            *** X-Server-Setup ***
            X-Server:       false
            Desktop:
            Terminal:       tty
            Boot Target:    graphical.target
            
            *** MEMORY ***
                           total        used        free      shared  buff/cache   available
            Mem:            3.8G        424M        3.1G        5.0M        260M        3.3G
            Swap:           1.9G          0B        1.9G
            Total:          5.7G        424M        5.0G
            
                     3785 M total memory
                      424 M used memory
                      133 M active memory
                      411 M inactive memory
                     3100 M free memory
                       22 M buffer memory
                      238 M swap cache
                     1892 M total swap
                        0 M used swap
                     1892 M free swap
            
            *** FILESYSTEM ***
            Filesystem     Type      Size  Used Avail Use% Mounted on
            udev           devtmpfs  1.8G     0  1.8G   0% /dev
            tmpfs          tmpfs     379M  5.5M  374M   2% /run
            /dev/mmcblk0p1 ext4      7.2G  2.5G  4.6G  35% /
            tmpfs          tmpfs     1.9G     0  1.9G   0% /dev/shm
            tmpfs          tmpfs     5.0M  4.0K  5.0M   1% /run/lock
            tmpfs          tmpfs     1.9G     0  1.9G   0% /tmp
            /dev/zram1     ext4       49M  1.8M   44M   4% /var/log
            tmpfs          tmpfs     379M     0  379M   0% /run/user/1000
            
            Messages concerning ext4 filesystem in dmesg:
            [Thu Apr 27 17:58:25 2023] Kernel command line: root=UUID=15c6a926-2ff7-4386-ae1                                                                                                                                                             d-b9aa9de31a3d rootwait rootfstype=ext4 splash=verbose console=ttyAML0,115200 co                                                                                                                                                             nsole=tty1 consoleblank=0 coherent_pool=2M loglevel=1 ubootpart=500340a8-01 liba                                                                                                                                                             ta.force=noncq usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u    cgroup_enab                                                                                                                                                             le=memory swapaccount=1
            [Thu Apr 27 17:58:28 2023] EXT4-fs (mmcblk0p1): mounted filesystem with writebac                                                                                                                                                             k data mode. Quota mode: none.
            [Thu Apr 27 17:58:31 2023] EXT4-fs (mmcblk0p1): re-mounted. Quota mode: none.
            [Thu Apr 27 17:58:32 2023] EXT4-fs (zram1): mounted filesystem without journal.                                                                                                                                                              Quota mode: none.
            [Thu Apr 27 17:58:32 2023] ext4 filesystem being mounted at /var/log supports ti                                                                                                                                                             mestamps until 2038 (0x7fffffff)
            
            Show mounted filesystems (real ones only):
            TARGET         SOURCE                   FSTYPE OPTIONS
            /              /dev/mmcblk0p1           ext4   rw,noatime,errors=remount-ro,comm                                                                                                                                                             it=600
            |-/var/log.hdd /dev/mmcblk0p1[/var/log] ext4   rw,noatime,errors=remount-ro,comm                                                                                                                                                             it=600
            `-/var/log     /dev/zram1               ext4   rw,relatime,discard
            
            Files in neuralgic directories:
            
            /var:
            554M    /var/
            293M    /var/lib
            266M    /var/lib/apt/lists
            266M    /var/lib/apt
            249M    /var/cache
            
            Archived and active journals take up 14.7M in the file system.
            
            /opt/iobroker/backups:
            4.0K    /opt/iobroker/backups/
            
            /opt/iobroker/iobroker-data:
            38M     /opt/iobroker/iobroker-data/
            35M     /opt/iobroker/iobroker-data/files
            13M     /opt/iobroker/iobroker-data/files/admin.admin/custom/static/js
            13M     /opt/iobroker/iobroker-data/files/admin.admin/custom/static
            13M     /opt/iobroker/iobroker-data/files/admin.admin/custom
            
            The five largest files in iobroker-data are:
            6.3M    /opt/iobroker/iobroker-data/files/admin.admin/custom/static/js/vendors-n                                                                                                                                                             ode_modules_iobroker_adapter-react-v5_assets_devices_parseNames_js-node_modules_                                                                                                                                                             iobr-99c23e.847b8ad9.chunk.js.map
            4.5M    /opt/iobroker/iobroker-data/files/web.admin/static/js/2.b1d56998.chunk.j                                                                                                                                                             s.map
            3.4M    /opt/iobroker/iobroker-data/objects.jsonl
            2.8M    /opt/iobroker/iobroker-data/files/admin.admin/custom/static/js/vendors-n                                                                                                                                                             ode_modules_iobroker_adapter-react-v5_assets_devices_parseNames_js-node_modules_                                                                                                                                                             iobr-99c23e.847b8ad9.chunk.js
            1.6M    /opt/iobroker/iobroker-data/files/admin.admin/custom/static/js/vendors-n                                                                                                                                                             ode_modules_mui_material_Accordion_index_js-node_modules_mui_material_AccordionD                                                                                                                                                             etai-57e02d.0886b730.chunk.js.map
            
            *** NodeJS-Installation ***
            
            /usr/bin/nodejs         v18.16.0
            /usr/bin/node           v18.16.0
            /usr/bin/npm            9.5.1
            /usr/bin/npx            9.5.1
            
            
            nodejs:
              Installed: 18.16.0-deb-1nodesource1
              Candidate: 18.16.0-deb-1nodesource1
              Version table:
             *** 18.16.0-deb-1nodesource1 500
                    500 https://deb.nodesource.com/node_18.x bullseye/main arm64 Packages
                    100 /var/lib/dpkg/status
                 12.22.12~dfsg-1~deb11u3 500
                    500 http://security.debian.org bullseye-security/main arm64 Packages
                 12.22.5~dfsg-2~11u1 500
                    500 http://deb.debian.org/debian bullseye/main arm64 Packages
            
            Temp directories causing npm8 problem: 0
            No problems detected
            
            *** ioBroker-Installation ***
            
            ioBroker Status
            iobroker is running on this host.
            
            
            Objects type: jsonl
            States  type: jsonl
            
            MULTIHOSTSERVICE/enabled: false
            
            Core adapters versions
            js-controller:  4.0.24
            admin:          6.3.5
            javascript:     "javascript" not found
            
            Adapters from github:   0
            
            Adapter State
            + system.adapter.admin.0                  : admin                 : odroidc4                                 -  enabled, port: 8081, bind: 0.0.0.0, run as: admin
            + system.adapter.backitup.0               : backitup              : odroidc4                                 -  enabled
            + system.adapter.discovery.0              : discovery             : odroidc4                                 -  enabled
              system.adapter.vis.0                    : vis                   : odroidc4                                 -  enabled
            + system.adapter.web.0                    : web                   : odroidc4                                 -  enabled, port: 8082, bind: 0.0.0.0, run as: admin
            
            + instance is alive
            
            Enabled adapters with bindings
            + system.adapter.admin.0                  : admin                 : odroidc4                                 -  enabled, port: 8081, bind: 0.0.0.0, run as: admin
            + system.adapter.web.0                    : web                   : odroidc4                                 -  enabled, port: 8082, bind: 0.0.0.0, run as: admin
            
            ioBroker-Repositories
            stable        : http://download.iobroker.net/sources-dist.json
            beta          : http://download.iobroker.net/sources-dist-latest.json
            
            Active repo(s): stable
            
            Installed ioBroker-Instances
            Used repository: stable
            Adapter    "admin"        : 6.3.5    , installed 6.3.5
            Adapter    "backitup"     : 2.6.19   , installed 2.6.19
            Adapter    "discovery"    : 3.1.0    , installed 3.1.0
            Controller "js-controller": 4.0.24   , installed 4.0.24
            Adapter    "simple-api"   : 2.7.2    , installed 2.7.2
            Adapter    "socketio"     : 4.2.0    , installed 4.2.0
            Adapter    "vis"          : 1.4.16   , installed 1.4.16
            Adapter    "web"          : 4.3.0    , installed 4.3.0
            Adapter    "ws"           : 1.3.0    , installed 1.3.0
            
            Objects and States
            Please stand by - This may take a while
            Objects:        178
            States:         137
            
            *** OS-Repositories and Updates ***
            Hit:1 http://deb.debian.org/debian bullseye InRelease
            Hit:2 http://security.debian.org bullseye-security InRelease
            Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
            Hit:4 http://deb.debian.org/debian bullseye-backports InRelease
            Hit:5 https://deb.nodesource.com/node_18.x bullseye InRelease
            Hit:6 http://fi.mirror.armbian.de/apt bullseye InRelease
            Reading package lists...
            Pending Updates: 0
            
            *** Listening Ports ***
            Active Internet connections (only servers)
            Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode      PID/Program name
            tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      0          8826       1685/sshd: /usr/sbi
            tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      0          10616      1/init
            tcp        0      0 127.0.0.1:9001          0.0.0.0:*               LISTEN      1001       8861       1664/iobroker.js-co
            tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN      1001       8975       1664/iobroker.js-co
            tcp6       0      0 :::22                   :::*                    LISTEN      0          8828       1685/sshd: /usr/sbi
            tcp6       0      0 :::111                  :::*                    LISTEN      0          8312       1/init
            tcp6       0      0 :::8082                 :::*                    LISTEN      1001       12586      1877/io.web.0
            tcp6       0      0 :::8081                 :::*                    LISTEN      1001       13357      1805/io.admin.0
            udp        0      0 0.0.0.0:111             0.0.0.0:*                           0          3022       1/init
            udp        0      0 127.0.0.1:323           0.0.0.0:*                           0          11581      1675/chronyd
            udp6       0      0 :::111                  :::*                                0          10619      1/init
            udp6       0      0 ::1:323                 :::*                                0          11582      1675/chronyd
            
            *** Log File - Last 25 Lines ***
            
            2023-04-27 16:27:36.627  - info: host.odroidc4 Delete state "system.host.odroidc4.versions.npmCurrent"
            2023-04-27 16:27:36.653  - info: host.odroidc4 Delete state "system.host.odroidc4.versions.npmNewest"
            2023-04-27 16:27:36.682  - info: host.odroidc4 Delete state "system.host.odroidc4.versions.npmNewestNext"
            2023-04-27 16:27:36.708  - info: host.odroidc4 Some obsolete host states deleted.
            2023-04-27 17:58:52.331  - info: host.odroidc4 instance system.adapter.discovery.0 started with pid 1824
            2023-04-27 17:58:52.474  - info: admin.0 (1805) starting. Version 6.3.5 in /opt/iobroker/node_modules/iobroker.admin, node: v18.16.0, js-controller: 4.0.24
            2023-04-27 17:58:52.561  - info: admin.0 (1805) requesting all states
            2023-04-27 17:58:52.562  - info: admin.0 (1805) requesting all objects
            2023-04-27 17:58:53.421  - info: admin.0 (1805) received all objects
            2023-04-27 17:58:54.012  - info: admin.0 (1805) http server listening on port 8081
            2023-04-27 17:58:54.014  - info: admin.0 (1805) Use link "http://localhost:8081" to configure.
            2023-04-27 17:58:54.032  - info: admin.0 (1805) socket.io server listening on port 8081
            2023-04-27 17:58:55.360  - info: host.odroidc4 instance system.adapter.backitup.0 started with pid 1854
            2023-04-27 17:58:55.998  - info: discovery.0 (1824) starting. Version 3.1.0 in /opt/iobroker/node_modules/iobroker.discovery, node: v18.16.0, js-controller: 4.0.24
            2023-04-27 17:58:58.617  - info: backitup.0 (1854) starting. Version 2.6.19 in /opt/iobroker/node_modules/iobroker.backitup, node: v18.16.0, js-controller: 4.0.24
            2023-04-27 17:58:58.831  - info: backitup.0 (1854) [iobroker] backup will be activated at 02:40 every 1 day(s)
            2023-04-27 17:58:59.369  - info: host.odroidc4 instance system.adapter.web.0 started with pid 1877
            2023-04-27 17:59:02.579  - info: web.0 (1877) starting. Version 4.3.0 in /opt/iobroker/node_modules/iobroker.web, node: v18.16.0, js-controller: 4.0.24
            2023-04-27 17:59:02.970  - info: web.0 (1877) socket.io server listening on port 8082
            2023-04-27 17:59:02.982  - info: web.0 (1877) http server listening on port 8082
            2023-04-27 17:59:05.679  - info: vis.0 (1894) starting. Version 1.4.16 in /opt/iobroker/node_modules/iobroker.vis, node: v18.16.0, js-controller: 4.0.24
            2023-04-27 17:59:05.768  - error: vis.0 (1894) No license found for vis. Please get one on https://iobroker.net !
            2023-04-27 17:59:06.480  - info: vis.0 (1894) Terminated (NO_ERROR): Without reason
            2023-04-27 17:59:07.064  - info: host.odroidc4 instance system.adapter.vis.0 terminated while should be started once
            2023-04-27 17:59:40.284  - info: admin.0 (1805) ==> Connected system.user.admin from ::ffff:192.168.1.146
            
            
            ======================= SUMMARY =======================
                                 v.2023-04-16
            
            
            Operatingsystem:        Debian GNU/Linux 11 (bullseye)
            Kernel:                 6.1.11-meson64
            Installation:           Native
            Timezone:               Europe/Vienna (CEST, +0200)
            User-ID:                1000
            X-Server:               false
            Boot Target:            graphical.target
            
            Pending OS-Updates:     0
            Pending iob updates:    0
            
            Nodejs-Installation:    /usr/bin/nodejs         v18.16.0
                                    /usr/bin/node           v18.16.0
                                    /usr/bin/npm            9.5.1
                                    /usr/bin/npx            9.5.1
            
            Recommended versions are nodejs 18.x.y and npm 9.x.y
            Your nodejs installation is correct
            
            MEMORY:
                           total        used        free      shared  buff/cache   available
            Mem:            3.8G        459M        2.9G        5.0M        439M        3.2G
            Swap:           1.9G          0B        1.9G
            Total:          5.7G        459M        4.8G
            
            Active iob-Instances:   5
            Active repo(s): stable
            
            ioBroker Core:          js-controller           4.0.24
                                    admin                   6.3.5
            
            ioBroker Status:        iobroker is running on this host.
            
            
            Objects type: jsonl
            States  type: jsonl
            
            Status admin and web instance:
            + system.adapter.admin.0                  : admin                 : odroidc4                                 -  enabled, port: 8081, bind: 0.0.0.0, run as: admin
            + system.adapter.web.0                    : web                   : odroidc4                                 -  enabled, port: 8082, bind: 0.0.0.0, run as: admin
            
            Objects:                178
            States:                 137
            
            Size of iob-Database:
            
            6.4M    /opt/iobroker/iobroker-data/objects.jsonl
            280K    /opt/iobroker/iobroker-data/states.jsonl
            
            
            
            =================== END OF SUMMARY ====================
            
            DJMarc75 1 Reply Last reply Reply Quote 0
            • DJMarc75
              DJMarc75 @Manuel001 last edited by

              @manuel001 dann gib Gas 😉

              M 1 Reply Last reply Reply Quote 0
              • M
                Manuel001 @DJMarc75 last edited by Manuel001

                @djmarc75
                Achja, ich habe ein Multihost System.
                Nur der Master wird ersetzt. Gibt es da irgendwas zu beachten?
                Dem neuen Master hätte ich eine neue fixe IP vergeben.

                DJMarc75 1 Reply Last reply Reply Quote 0
                • DJMarc75
                  DJMarc75 @Manuel001 last edited by

                  @manuel001 sagte in Script anhalten und wieder starten über ein anderes Script:

                  Achja, ich habe ein Multihost System.
                  Nur der Master wird ersetzt. Gibt es da irgendwas zu beachten?
                  Dem neuen Master hätte ich eine neue fixe IP vergeben.

                  keine Ahnung - aber ich denke dass da schon Probleme auftreten ... bin da aber raus weil ich mich mit solchen Systemen nicht auskenne.

                  M 1 Reply Last reply Reply Quote 0
                  • M
                    Manuel001 @DJMarc75 last edited by Manuel001

                    Ich habe mich dazu entschlossen, dass ich die IP Adresse für den Master gleich lasse.
                    Dann wurden die Slaves nach Backup einspielen auch gleich erkannt.
                    Auf den ersten Blick sieht alles gut aus.

                    1 Reply Last reply Reply Quote 0
                    • AlexAtHome
                      AlexAtHome @bahnuhr last edited by

                      @bahnuhr

                      setState('javascript.0.scriptEnabled.Scripte.xxxx',false);
                      

                      Vielen Dank! Genau das habe ich gesucht für meinen Zweck, 2 Scripte zu de/aktivieren, die nur laufen sollen, während wir im Urlaub (und damit abwesend) sind, dann aber täglich.

                      Sie werden also nur 1-3*/Jahr an- & ausgeschaltet. Da fand ich den Compiling-Aufwand vertretbar.
                      Alternative wäre, die Scripte zeitgesteuert täglich laufen zu lassen, und stets am Anfang die Urlaubs-Variable abzufragen.
                      Das käme mir oversized vor.

                      bahnuhr 1 Reply Last reply Reply Quote 0
                      • bahnuhr
                        bahnuhr Forum Testing Most Active @AlexAtHome last edited by

                        @alexathome sagte in Script anhalten und wieder starten über ein anderes Script:

                        stets am Anfang die Urlaubs-Variable abzufragen.

                        Das ist der richtige Weg.
                        Genauso mache ich es.
                        Habe mittlerweile DP für Urlaub, anwensend, Wochentag, Wochenende, Feiertag, etc.

                        Und damit werden die Scripte gesteuert.

                        Ich halte dies für die richtige Logik.
                        Denn das evtl. ständige aus/einschalten manuell ober per Script sollte die Ausnahme sein.

                        AlexAtHome 1 Reply Last reply Reply Quote 0
                        • AlexAtHome
                          AlexAtHome @bahnuhr last edited by

                          @bahnuhr
                          Dann baue ich es vielleicht doch wieder um, aber erst nach meinem Urlaub... 🙂

                          Wobei, wie gesagt, "ständig" in dem Fall ja nur 1-3 mal pro Jahr wäre.

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

                          Support us

                          ioBroker
                          Community Adapters
                          Donate

                          887
                          Online

                          31.7k
                          Users

                          79.8k
                          Topics

                          1.3m
                          Posts

                          6
                          45
                          1480
                          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