how to create job scripts

35 views
Skip to first unread message

Jon Paynter

unread,
May 4, 2012, 4:48:04 PM5/4/12
to ControlTier
Hi, im new to control tier - so please forgive any misunderstandings.

Im trying to create a job that takes a parameter, so I can pass it to
my scripts. but the job wont get past line 1.
using the web UI, I created an option for my job called 'Process'

using the 'script' option I enter the following:
#!/bin/ksh
cd /home/oracle/startup
echo starting $1

and then in the box "command line arguments" I add:
@option.Process@

but when I try to run the job I get an error back:
bash: /tmp/1336163862403-sjdvir31-ctl-exec-script: /bin/ksh^M: bad
interpreter: No such file or directory.

why wont my scripts run?

Moses Lei

unread,
May 7, 2012, 10:05:40 PM5/7/12
to contr...@googlegroups.com
That ^M is a dead giveaway. Is your server on Windows? The line endings are being screwed up.

Pre-create the script, make sure it has UNIX line endings, and use a script file job instead of typing the script in the GUI. Or, I think this is fixed in RunDeck, might give it a try there. Or use a *nix server.

Moses

--
Moses Lei
[ Professional Services | DTO Solutions, Inc. ]
[ mobile: +1 703.901.5969 | e-mail: ml...@dtosolutions.com | aim/gtalk: ml...@controltier.com | yahoo: moseslei | windows live (msn): ml...@dtosolutions.com ]




--
You received this message because you are subscribed to the Google Groups "ControlTier" group.
To post to this group, send email to contr...@googlegroups.com
To unsubscribe from this group, send email to controltier...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/controltier?hl=en
http://wiki.controltier.org

Jon Paynter

unread,
May 8, 2012, 12:02:26 AM5/8/12
to contr...@googlegroups.com
yes the ^M is a dead giveaway... I was able to find the generated script in the /tmp folder on my unix server, run dos2unix and have it work.

my testing server is running on my windows box, and the test client is a redhat vm running on the same windows box.  I use windows for the server because its what I know best, and i I can get this thing working, we will have 1 or or more windows hosts...

I created the script using the web ui only.  nothing has been done on the command line.  Is there a way to have the web ui detect the correct line ending scheme for the destination host and use it?

-or-
back to my original question on the parameters.  How do i get them to work with just a single command? I tried something like this:
cd /home/oracle/startup ; echo starting @option.Process@
and when I pick the process name and run the script, all I see is:  "starting"

In the end I want to pass a parameter to scripts or single commands.  How do I accomplish that?

Greg Schueler

unread,
May 8, 2012, 12:06:17 AM5/8/12
to contr...@googlegroups.com
To pass options via commandline/arguments, use the ${option.Process} syntax.

Jon Paynter

unread,
May 14, 2012, 2:33:45 PM5/14/12
to contr...@googlegroups.com
ok I got the single command working.
But entering scripts via the UI still give an erorr with '^M' everywhere.

How do I tell the server to use the correct line ending style?
Reply all
Reply to author
Forward
0 new messages