I've seen this before, I just don't know where

146 views
Skip to first unread message

Dave Graham

unread,
Oct 16, 2017, 5:40:47 PM10/16/17
to Pick and MultiValue Databases
I know I've seen a technique to do what I need to do in this group before. I just can't formulate a proper search query to find the post.

So I suppose I'll have to ask the question again.

I have a need to write a scheduled process (either a cron job or a Windows scheduled process) that will occasionally CD to a specific folder, run UDT (yes run UniData) and then run an ECL command. Once the ECL command has completed (I don't care about the results), I want the UDT session to 'exit' (complete normally) and the host O/S session will shut down.

Most of this is trivial and really simply to do and I'm pretty certain that I've figured out the answer to my own question but I'll pose it anyway. Is this really as simple as:

cd \folder\folder
udt command
exit

If my memory serves (and I don't trust it at this point) 'udt command' simply starts udt and runs command until it completes. When it completes, the udt session ends and control returns to the host O/S.

Am I right on this?

DaveG

George Gallen

unread,
Oct 16, 2017, 10:25:09 PM10/16/17
to mvd...@googlegroups.com
You may need to use

Cd dir ; udt command

In your example, once the cd line executes, it returns back to the current directory prior to the cd, also, you might want to consider putting a full file location. /usr/uv/bin/uv for universe per se, but wherever your udt program lives.

George
--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms

Ladd, Ryan

unread,
Oct 17, 2017, 10:08:18 AM10/17/17
to mvd...@googlegroups.com

 

I've used "here documents" to pass more than one command into uv before.  The same technique should work for udt as well.

 

cd `cat /.uvhome` && uv <<end_uv

FIRST_COMMAND

SECOND_COMMAND

...

LAST_COMMAND

QUIT

end_uv

exit

 

Ryan



Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer.

Ian McGowan

unread,
Oct 18, 2017, 2:41:54 PM10/18/17
to Pick and MultiValue Databases
The "here" document Ryan posted is what I usually do to exit cleanly.

cd /path/to/account
$UDTBIN/udt <<EOF
COMMAND
<input 1>
<input 2>
BYE
EOF

Of course the command can't ask for any input that you don't already provide in the here doc.

Kevin King

unread,
Oct 23, 2017, 9:13:41 PM10/23/17
to mvd...@googlegroups.com
Also be aware the LOGIN proc or paragraph can get in the way. Also if you use "udt PHANTOM" and then the command the output will be captured in a _PH_ (Unidata) or &COMO& (UV) record.

--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+unsubscribe@googlegroups.com

Dave Graham

unread,
Oct 24, 2017, 6:20:29 AM10/24/17
to Pick and MultiValue Databases
Thanks Kevin. I had not thought about the LOGIN proc. that could be messy in some cases. udt PHANTOM is interesting but not needed in this case thankfully.

For those that are curious, we have a need to CLEAR.FILE the WebDE WWSTATE file periodically. For some reason that no one (including Rocket) can understand, this file is not clearing during GARBAGECOLLECT so we need to do it ourselves. this has been a problem thought Redback 3.x, 4.x and now WedDE so we're just going to go with the flow and take care of it ourselves.

Previously, we would simply log on to the "rbdefn" account and manually issue a CLEAR.FILE WWSTATE occasionally. However, the folks that take care of that bit of housekeeping are getting busier and busier and this manual task is being forgotten. So that file gets really, really big (close to 100 GB). Since we're on AIX, adding disk is a pain and costly so automating the task is far easier.

We'll just write a cron job that builds a script to go to the proper folder as the proper user and "udt CLEAR.FILE WWSTATE". Since "rbdefn" has no LOGON proc, we're good and the file is cleared, disk space returned and we live to fight another day.

Thanks all!
Reply all
Reply to author
Forward
0 new messages