Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Hi,
I tried to deploy a batch file to a IoT device running Windows and expected it to be executed after downloaded, but the feature seems to not work (downloaded but not be executed)
Thingworx 8.5.19, WSEMS 5.3.2.1693
POST {{serverURI}}/Subsystems/FileTransferSubsystem/Services/Copy
{
"sourceRepo": "FileRepo",
"sourceFile": "backup.cmd",
"sourcePath": "/scripts",
"targetRepo": "IPU_1323212",
"targetPath": "/Tmp",
"targetFile": "backup.cmd",
"timeout": 120000,
"async": false,
"queueable": false,
"metadata": {
"download": {
"executeAfterDownload": true
}
}
}
Any ideas would be much appreciated!
Best Regards,
Hung Tran
Solved! Go to Solution.
executeAfterDownload is an Axeda agent feature which is being exposed through the metadata parameter of the FileTransferSubsystem which implements the Copy. Metadata is just a payload without meaning unless your agent knows to look for some field inside the metadata block.
Here are the features than an Axeda agent supports in the metadata block, note that the EMS does not support any of these.
You should follow the advice in this KB article https://www.ptc.com/en/support/article/CS351449 and subscribe to file transfer events. When your file transfer completes, your agent can use this event to call code to execute your downloaded script, perhaps using lua's os.execute() command.
Depending on how often you are planning on doing this kind of thing, you might consider using the EMS's implementation of Thingworx Software Content (SCM) Management http://support.ptc.com/help/thingworx/edge_microserver/en/index.html#page/c_sdk/c_ems_wsems_scm_setup.html This service suite, combined with a Thingworx platform extension and Mashup will manage the download and execution of files based on schedules and verify their successful execution.
Hi @htran-21.
We're taking a look at this and will let you know if we have any questions.
Regards.
--Sharon
executeAfterDownload is an Axeda agent feature which is being exposed through the metadata parameter of the FileTransferSubsystem which implements the Copy. Metadata is just a payload without meaning unless your agent knows to look for some field inside the metadata block.
Here are the features than an Axeda agent supports in the metadata block, note that the EMS does not support any of these.
You should follow the advice in this KB article https://www.ptc.com/en/support/article/CS351449 and subscribe to file transfer events. When your file transfer completes, your agent can use this event to call code to execute your downloaded script, perhaps using lua's os.execute() command.
Depending on how often you are planning on doing this kind of thing, you might consider using the EMS's implementation of Thingworx Software Content (SCM) Management http://support.ptc.com/help/thingworx/edge_microserver/en/index.html#page/c_sdk/c_ems_wsems_scm_setup.html This service suite, combined with a Thingworx platform extension and Mashup will manage the download and execution of files based on schedules and verify their successful execution.