Trying to rename (and put) files on an SFTP server.
This works if the names are hardcoded into the node, but when trying to use variables to drive source and destination names in a prior function, "Error: No such file" is raised. using node-red-contrib-sftp
Any ideas on how to pass the src/dest as variables?
[
{
"id": "9621641beda81abd",
"type": "debug",
"z": "7c0ebce243632905",
"name": "debug 5",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 900,
"y": 860,
"wires": []
},
{
"id": "e0714f71d3e36c17",
"type": "SFTP-main",
"z": "7c0ebce243632905",
"path": "/",
"method": "rename",
"remoteFilePath": "",
"localFilePath": "/",
"remoteDestPath": "",
"useCompression": "",
"encoding": "utf8",
"mode": "",
"recursive": "false",
"server": "5aa1834ab03a65fd",
"x": 590,
"y": 840,
"wires": [
[
"9621641beda81abd"
]
]
},
{
"id": "24702feb8b9877d2",
"type": "inject",
"z": "7c0ebce243632905",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 220,
"y": 840,
"wires": [
[
"96b663a84c8f0d61"
]
]
},
{
"id": "96b663a84c8f0d61",
"type": "function",
"z": "7c0ebce243632905",
"name": "function 8",
"func": "\n\nmsg.remoteSourcePath ='/u/awards/spool/NEWELL_BRANDS/out/pending/is08459888.txt';\nmsg.remoteDestPath ='/u/awards/spool/NEWELL_BRANDS/out/pending/__is08459888.txt';\n\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 400,
"y": 840,
"wires": [
[
"e0714f71d3e36c17"
]
]
},
{
"id": "82c6c81e484422fd",
"type": "SFTP-main",
"z": "7c0ebce243632905",
"path": "/",
"method": "rename",
"remoteFilePath": "/u/awards/spool/NEWELL_BRANDS/out/pending/is08459888.txt",
"localFilePath": "/",
"remoteDestPath": "/u/awards/spool/NEWELL_BRANDS/out/pending/__is08459888.txt",
"useCompression": "",
"encoding": "utf8",
"mode": "",
"recursive": "false",
"server": "5aa1834ab03a65fd",
"x": 590,
"y": 920,
"wires": [
[
"9621641beda81abd"
]
]
},
{
"id": "8ac06aa0844fa856",
"type": "inject",
"z": "7c0ebce243632905",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 220,
"y": 920,
"wires": [
[
"82c6c81e484422fd"
]
]
},
{
"id": "5aa1834ab03a65fd",
"type": "SFTP-credentials",
"host": "10.233.238.142",
"port": "22",
"username": "sistema",
"password": "dexion2020"
}
]