bei mir sammeln sich auf der CCU3 in /tmp lauter cgimail.nnn Dateien an:
Code: Alles auswählen
...
-rw-r--r-- 1 root root 597 Jan 11 03:33 cgimail.8831
-rw-r--r-- 1 root root 597 Jan 12 03:33 cgimail.32662
-rw-r--r-- 1 root root 597 Jan 13 03:33 cgimail.14443
...
Code: Alles auswählen
# cat /tmp/cgimail.16580
Return-Path: <CGI script - do not reply>
From: <CGI script - do not reply>
To: root
Subject: CGI problem
CGI environment:
REQUEST_METHOD: GET
SCRIPT_NAME: /config/cp_security.cgi
HTTP_USER_AGENT: Wget/1.19.5 (linux-gnueabihf)
HTTP_HOST: 127.0.0.1
REMOTE_ADDR: 127.0.0.1
cgi.tcl version: 1.8.0
input:
sid=@XPeaQNngIJ@&action=create_backup
cookie:
errorInfo:
invalid command name ""
while executing
"[create_backup]"
(procedure "action_create_backup" line 2)
invoked from within
"action_create_backup"
invoked from within
"if {[session_requestisvalid 8] > 0} then action_$action"
(auf meiner CCU2 läuft das seit Jahren genauso, nur ohne diese cgimail-Fehler-Dateien)
Wie muss der wget-Befehl heißen, damit das auf der CCU3 ohne diesen Fehler läuft? Derzeit:
Code: Alles auswählen
wget "http://$host/config/cp_security.cgi?sid=@$sessionid@&action=create_backup" -O $host-backup.tar.sbk
Code: Alles auswählen
host="127.0.0.1"
user="Admin"
### password="..."
# --- login: ---
loginresponse=$( wget --post-data '{"method":"Session.login","params":{"username":"'$user'","password":"'$password'"}}' http://$host/api/homematic.cgi -O - -q )
echo "$loginresponse"
# --> {"version": "1.1","result": "XPeaQNngIJ","error": null}
# --- get sessionid: ---
sessionid=`echo "$loginresponse" | cut -d "," -f2 | awk '{print $2}' | cut -d '"' -f2`
echo "$sessionid"
# --> XPeaQNngIJ
# --- create_backup: ---
wget "http://$host/config/cp_security.cgi?sid=@$sessionid@&action=create_backup" -O $host-backup.tar.sbk
--2023-01-21 08:52:26-- http://127.0.0.1/config/cp_security.cgi?sid=@XPeaQNngIJ@&action=create_backup
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6052266 (5.8M) [application/x-download]
Saving to: '127.0.0.1-backup.tar.sbk'
127.0.0.1-backup.tar.sbk 100%[================================================================================>] 5.77M 2.39MB/s in 2.4s
2023-01-21 08:52:36 (2.39 MB/s) - '127.0.0.1-backup.tar.sbk' saved [6052266/6052266]
# --- logout: ---
wget --post-data '{"method":"Session.logout","params":{"_session_id_":"'$sessionid'"}}' http://$host/api/homematic.cgi -O - -q
# --> {"version": "1.1","result": true,"error": null}
# tar -tvf 127.0.0.1-backup.tar.sbk
-rw-r--r-- root/root 6046075 2023-01-21 08:52 usr_local.tar.gz
-rw-r--r-- root/root 33 2023-01-21 08:52 signature
-rw-r--r-- root/root 15 2022-06-23 17:37 firmware_version
-rw-r--r-- root/root 2 2023-01-21 08:52 key_index
# ls -ltr /tmp/
...
-rw-r--r-- 1 root root 2 Jan 21 08:52 key_index
-rw-r--r-- 1 root root 597 Jan 21 08:52 cgimail.16580
drwxr-xr-x 2 root root 80 Jan 21 08:52 event
# cat /tmp/key_index
0
# cat /tmp/cgimail.16580
Return-Path: <CGI script - do not reply>
From: <CGI script - do not reply>
To: root
Subject: CGI problem
CGI environment:
REQUEST_METHOD: GET
SCRIPT_NAME: /config/cp_security.cgi
HTTP_USER_AGENT: Wget/1.19.5 (linux-gnueabihf)
HTTP_HOST: 127.0.0.1
REMOTE_ADDR: 127.0.0.1
cgi.tcl version: 1.8.0
input:
sid=@XPeaQNngIJ@&action=create_backup
cookie:
errorInfo:
invalid command name ""
while executing
"[create_backup]"
(procedure "action_create_backup" line 2)
invoked from within
"action_create_backup"
invoked from within
"if {[session_requestisvalid 8] > 0} then action_$action"
# ls -l /tmp/event/
total 4
-rw-r--r-- 1 root root 0 Jan 21 09:01 0za6wDcgJa
-rw-r--r-- 1 root root 26 Jan 21 08:24 subscriber.list
# cat /tmp/event/subscriber.list
0za6wDcgJa {EVENT_COUNT 1}