TM1 Linux shell

Post Reply
blandmtm1
Posts: 3
Joined: Tue May 12, 2020 3:15 am
OLAP Product: db2
Version: v11
Excel Version: 365

TM1 Linux shell

Post 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?
Andy Key
MVP
Posts: 351
Joined: Wed May 14, 2008 1:37 pm
OLAP Product: TM1
Version: 2.5 to PA
Excel Version: Lots
Location: Sydney
Contact:

Re: TM1 Linux shell

Post 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).
Andy Key
blandmtm1
Posts: 3
Joined: Tue May 12, 2020 3:15 am
OLAP Product: db2
Version: v11
Excel Version: 365

Re: TM1 Linux shell

Post 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.
User avatar
ykud
MVP
Posts: 148
Joined: Sat Jan 10, 2009 10:52 am
Contact:

Re: TM1 Linux shell

Post 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.
blandmtm1
Posts: 3
Joined: Tue May 12, 2020 3:15 am
OLAP Product: db2
Version: v11
Excel Version: 365

Re: TM1 Linux shell

Post 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.
User avatar
ykud
MVP
Posts: 148
Joined: Sat Jan 10, 2009 10:52 am
Contact:

Re: TM1 Linux shell

Post 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?
Post Reply