Page 1 of 1

Executing .bat file TM1 TI to AWS S3 Bucket

Posted: Tue Apr 14, 2020 8:38 am
by Crayola
Hi all,

I've tried pushing data from TM1 directly into Redshift via ODBC connection. It works however it takes way too long. I've been offered an alternative solution by the data engineers.

I am exporting the required data from TM1 into a CSV and then executing a batch file to push the data up into the S3 bucket

If i execute the batch file from the TM1 server it works fine however i am having issues trying to execute the command from the TI process

TM1:

Code: Select all

sCommand= 'cmd /c E:\Scripts\upload_core_to_s3.bat';
ExecuteCommand(sCommand,0); 
Batch file to push to S3:

Code: Select all

forfiles /P "E:\Temp\Core_SKU" /M *.csv /D +0 /C "cmd /c aws s3 cp @path s3://upload-to-bi-redshift/merchandising-core/" 
Process says executes successfully but nothing is loaded into S3.

Any help/advice on this would be greatly appreciated

Thanks!

Re: Executing .bat file TM1 TI to AWS S3 Bucket

Posted: Tue Apr 14, 2020 11:43 am
by tomok
These type of issues are almost always due to permission issues between you physically being logged into the desktop of the server (and thus executing the batch under your ID) versus running it via TI which executes the batch under the service account TM1 runs under.

Re: Executing .bat file TM1 TI to AWS S3 Bucket

Posted: Thu Jul 02, 2020 3:26 am
by Crayola
tomok wrote: Tue Apr 14, 2020 11:43 am These type of issues are almost always due to permission issues between you physically being logged into the desktop of the server (and thus executing the batch under your ID) versus running it via TI which executes the batch under the service account TM1 runs under.
Thank you for this! it was permissions! Had to set up AWS CLI on the host account of server