Page 1 of 1
TM1 Linux shell
Posted: Tue May 12, 2020 3:20 am
by blandmtm1
What is the proper way to call a bash shell script in TM1 on linux. We can get it to work on windows with the following
ExecuteCommand ( 'PowerShell /data/disk1/xxx/ftp.sh',1);
When I try to run the shell using something like this nothing happens :
ExecuteCommand ( 'bash /data/disk1/xxx/ftp.sh',1);
Also tried
ExecuteCommand ( '/data/disk1/xxx/ftp.sh',1);
What I am doing wrong?
Re: TM1 Linux shell
Posted: Tue May 12, 2020 4:15 am
by Andy Key
Both of your examples should be fine.
Check that ftp.sh is in a unix format (see dos2unix) then also check that the user that your TM1 instance is running as has execute permissions to the script (chmod).
Re: TM1 Linux shell
Posted: Tue May 12, 2020 6:08 pm
by blandmtm1
The script runs good from terminal / bash but will not run when called from tm1. We gave it 777 just to be safe.
We even put a simple echo hello world >> log.txt in the script to see if it ran.
Re: TM1 Linux shell
Posted: Wed May 13, 2020 12:23 am
by ykud
blandmtm1 wrote: ↑Tue May 12, 2020 6:08 pm
The script runs good from terminal / bash but will not run when called from tm1. We gave it 777 just to be safe.
We even put a simple echo hello world >> log.txt in the script to see if it ran.
Are you trying from the user that runs tm1s? Try running
ExecuteCommand ( 'touch /data/disk1/xxx/can_i_create_a_file',1);
and see if has write perms to the folder with your script
and something like
ExecuteCommand ( 'touch ~/can_i_create_a_file',1);
to see that it can generate the file in user home folder.
Re: TM1 Linux shell
Posted: Wed May 13, 2020 1:20 pm
by blandmtm1
We tried both of these. Job ran without errors but nothing was created in either of the commands. No idea what is going on.
Re: TM1 Linux shell
Posted: Thu May 14, 2020 4:04 am
by ykud
blandmtm1 wrote: ↑Wed May 13, 2020 1:20 pm
We tried both of these. Job ran without errors but nothing was created in either of the commands. No idea what is going on.
Must be something with user running the tm1 server, try su under it and run the same?