I am using Screen via SSH to run a backup script on the host. The tricky thing is that I want a clean backup, so I'm stopping everything including Node-RED when doing it. I would like to be able to see on VNC if the script is still running, but that means that I need Screen to run the script in a window. I have tried to search around, but I haven't found an answer to that, probably because it's not a common use. The node is like this:
{
"id": "eb607f0925ac4680",
"type": "inject",
"z": "139a05b0e07293f9",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 100,
"y": 400,
"wires": [
[
"fab1883caac56ce6"
]
]
},
{
"id": "fab1883caac56ce6",
"type": "exec",
"z": "139a05b0e07293f9",
"command": "sshpass -p \"SECRET_PASSWORD\" ssh pi@192.168.5.2 -o StrictHostKeyChecking=no \"screen -S sikkerhetskopiering -d -m /home/pi/sikkerhetskopiering.sh\"",
"addpay": "",
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "Backup via Screen",
"x": 270,
"y": 400,
"wires": [
[
"e12ed03ace973a37"
],
[
"e12ed03ace973a37"
],
[
"e12ed03ace973a37"
]
]
},
{
"id": "e12ed03ace973a37",
"type": "debug",
"z": "139a05b0e07293f9",
"name": "debug 23",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 460,
"y": 400,
"wires": []
}
]
So the SSH command is:
sshpass -p "SECRET_PASSWORD" ssh pi@192.168.5.2 -o StrictHostKeyChecking=no "screen -S sikkerhetskopiering -d -m /home/pi/sikkerhetskopiering.sh"
Is there a way to do what I want, or is that just not possible?