cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2360
Views
0
Helpful
10
Replies

TES 6.1 - issue using SACmd inside a batch file

Lumi Mihalcea
Level 1
Level 1

I just discovered an issue when using SACmd inside a batch file. I issue the command 'sacmd varset ...' to update a variable. In the output I see that the variable was updated but it seems that at that point I am at the sacmd prompt and that's where the bat file completes, it does not execute anything after the sacmd varset. Example:

sacmd varset -n test_var -v "%newfile%"

copy P:\Test_Files\"%newfile%".PDF C:\temp\*.*

It sets the variable but the copy command is not executed. I tried 'sacmd exit', did not help. Any ideas?

10 Replies 10

tesabrrco
Level 1
Level 1

If this is .cmd/.bat, then try

call sacmd varset -n test_var -v "%newfile%"

copy P:\Test_Files\"%newfile%".PDF C:\temp\*.*

I should've thought of that...Many, many, MANY thanks!!!

Patricia Hindes
Level 1
Level 1

This is a bit off topic, but how are you able to call the sacmd in the above manner in TES 6.1?

Prior to our recent upgrade to TES 6.1 we were able to call sacmd as you are in this thread, but during upgrade we found that the sacmd had changed and we needed to change all of our jobs, scripts and other programs to call sacmd via the client url w/ user name and pwd.  Example below:

c:\program files\Tidal\tescmdline\bin\sacmd.cmd

-cmdspurl

http://tesclient:8080/api/tes-6.0 -user org\tesuser -pass xoxo varset -n tescmdvar -v 20

The first time I issued the connect command using -persist option, that way the info is saved for the user and you don't have to enter it again

C:\Program Files\TIDAL\TESCmdLine\bin\sacmd.cmd

-cmdspurl http://tes-client.ad.uwm.edu:8080/api/tes-6.1  -user ad\user -pass  -persist

Then in the batch file

cd /d C:\Program Files\TIDAL\TESCmdLine\bin

call sacmd varset -n ADDUAL_file_name -v "%newfile%"

call sacmd jobadd -i 5071

The output will look like this. You will see the connection made for the user but no pw. That info is all encrypted in the user's file.

P:\Test_Files\SR>cd /d C:\Program Files\TIDAL\TESCmdLine\bin 

C:\Program Files\TIDAL\TESCmdLine\bin>call sacmd varset -n ADDUAL_file_name -v "UWM_SR_DUAL_CAREER_2126_20130402"  
TES SA Command Console (Version 6.1.0.197).
JRE Version : 1.6.0_35
Style       : table
DSP URL     : http://tes-client.ad.uwm.edu:8080/api/tes-6.1
User        : ad\uit-tesscheduler-s

SACmd>varset -n ADDUAL_file_name -v UWM_SR_DUAL_CAREER_2126_20130402
Variable has been updated.(ID:212)
TES SA Command Console (Version 6.1.0.197).
JRE Version : 1.6.0_35
Style       : table
DSP URL     : http://tes-client.ad.uwm.edu:8080/api/tes-6.1
User        : ad\uit-tesscheduler-s

SACmd>jobadd -i 5071
done

Thank you.  I did read about the persistance of "user information" but may have misinformed when we were told that we would still need to change all of our jobs to include the cmdspurl.

I tested your suggestion and it works.

Thanks!!

Does anyone have any luck running this repeatedly in Linux without using batch file?

I just have these one liners that I want to run to enable/disable agents using sacmd, and did -persist and saw the information stored in the /home/user of the Linux account I am using.  I source the profile on each of the jobs (essentailly enableing and disabling agents for different servers) as part of their patching sequence.

The first time it ran fine,  second time it said port already in use.

All I do in the Tidal job is:

cmd:

/opt/tidal/...../sacmd.sh

parameter: 

agent -C MODIFY -n HRQA-PSUNX -e Y

This is what is in the output:

TES SA Command Console (Version 6.1.0.267).

JRE Version : 1.7.0_25 Style :

table DSP URL : https://tes6dev.companyb.com/api/TesDevCM1

User: wfm\tesadmdev

SACmd>agent -C MODIFY -n HRQA-PSUNX -e Y TES_003008:The specified port [null:null] is already in use

I wonder if you have any hung SACmd processes on the linux server that might need to be stopped?

I will retest to verify that.  Hopefully that is ot the case since I don't know what would cause that aside from the first job that ran.  thanks!

I was able to run twice today with no issues - examining the job output from last week lead me to believe that since the jobs where within 1 minute of each other that some kicked off at the same time.

I was just so busy bringing down 10 applications via Tidal becasue of database cluster patching to pay close attention to time.  In 5.3 i bring down all our PeopleSoft envronment and other apps all at the same time and never ran into this.

Maybe this version doesn't run concurrent sacmd?

I am glad to kow though that folks have been able to make the -persist work, because passing credentials in the command line is not acceptable.  I even tried it using private variables but the agent logs ofcourse show parameter clear text.

I got it to repeat the port already in user by selecting two sacmd jobs at one time and insert to schedule at the same time.  One ran normally  the other completed abnormally.  And I can run other sacmd jobs after this fine, but I can't get the one the errored out to run normally.  Its not the job number itself, but even if I use another job to enable the adapter, it still won't run normally - keeps complaning about the port BUT  I can enable and disable same adater via the web gui.

Its just enabling a process scheduler adapter agent - I already tried stopping agent, stopping process scheduler on PeopleSoft side, clearing Process Scheduler cache.   the disable of same agent runs fine.I guess bounce the master I haven't tried yet.

Review Cisco Networking for a $25 gift card