i was wondering if you could assist me in the following situation:
i am trying to queue a group execution commands (same command but different parameters) submited from an openVMS system to a Unix system (HP UX). The commands should run in sequence; the next starts after prev finish and only one running at a time. The commands are submitted from openVMS server in random order at any time. Notes: openVMS has queue functionality however is not an option in this case due to other reasons
So far the only option i see is writing a solution from scratch. generally speaking, this solution will involve copying the command as they come in from the openVms server into a file and having another process check this file for the next command insuring the commands are executed in FIFO order. the process will check the file continously or within specified constraint
this said, i was wondering if there are any unix commands that can do similar function or could help in this case?
i was looking into command such as mkfifo however they only seralize the processes. ie it does not gaurantee one process will start after the prev finishes. i can only have process running at a time.
yes. each is submited usinging its own ssh sessions. some of these jobs take 3 hours to complete which causes ssh session to timeout. Increasing the timeout period is not an option in this case. at the same time the rest of the job should be submitted provided nothing is running on the hpux server and this is basically the delima. i personally perfer the load and logic is moved to the hpux and the only role of the openvms server is just submitting jobs instead of waiting for the ssh session to complete.
I waited a few days to let others give a try at this. Here are some possibilities:
1. Use batch which comes along with at. If atd is not running, ask your sysadmin about this. I've access to the Linux version which might be completely different than the AIX version.
With batch you give it the commands from standard input. It queues the commands to run (by atd) when the system load average is below a threshold (specified by atrun or atd).
Cons: Your jobs might not affect load, so this might be useless. A job might suddenly become IO bound, fooling atd to run the next program.
2. SGE - Sun Grid Engine. It's a full-featured batch submission engine, but it might be overly complex for this kind of application. On the other hand, it's relatively easy to set up.
3. Custom queue:
Instead of the command actually doing the work, override it with a shell function that outputs the command and parameters to a FIFO. Here's the gist of this:
Now create a cronjob (to run every minute) to read the queue and execute the next command, as long as the previous is not still running:
in $HOME/bin, you can create the script:
There is a big problem with this scheme, however: the writers will block until the reader is available. So the job submitter must go into the background until the reader is available. Here's such a job-submitter.
Prefix all your jobs with this "submit" script (which should be in your PATH or hard-coded as something like $HOME/bin/submit.sh).
I haven't tested this, and there maybe some problems. But give it a try.
below is the output xml string from some other command and i will be parsing it using awk
cat /tmp/alerts.xml
<Alert id="10102" name="APP-DS-ds_ha-140018-componentFailure-S" alertDefinitionId="13982" resourceId="11427" ctime="1359453507621" fixed="false" reason="If Event/Log Level(ANY) and... (2 Replies)
I'm running cygwin bash on windows 7 and I'm have some bat files that perform large builds and take a long time and a lot of memory.
Therefor, I don't want to builds executing simultaneously (too much memory).
How can I implement a queue so I can queue up multiple builds and only execute one... (2 Replies)
How can we create new directory/Or execute command on remote unix machine from another unix machine.
We can use SSH command to execute command on remote machine but problem is that ssh will prompt for password before executing command.
My requirment is to execute command without manual... (1 Reply)
Hello All,
Good day! This is my first UNIX post. :D
Anyways, I would like to seek help from you guys if you know of any UNIX command that will skip a warning message once it is encountered but continue to run the execution.
Ok here's the situation in general:
An encypted file is sent to... (2 Replies)
Hi all:
I have a problem with a C++ service runing on solaris 10. This service only set a signal on oracle table. When the service detect a cut off on the line (tcp/ip), trigger a cobol program for set the signal OFF. When the line is on again, the service trigger the same cobol program for set... (0 Replies)
Hello !!!!! I have a simple question but i can't find the answer anywhere hope to meet it here.
Why it is a bad idea to pass pointers through message queues ?
Most structs i see all of their char types are arrays... Is it becase having pointers means we could possibily send wrong bytes ?
For... (2 Replies)
How is the hash queue categorized? I am trying to understand the free list vs the hash queue and i'm just not getting it. The book im using is written like you already have a degree in Unix architecture. Maybe someone knows a web site that explains this in laymans terms. A Unix architecture for... (1 Reply)
Hi,
I am working closly with unix message queues i have encountered the following -
after creating the Q and start working with it (pushing & pulling) i receive the following stange parameters on the q's -
STIME=no_entry
Qnum=0
CBYTES=4140
when this happens, the Q is disabled (meaning i... (3 Replies)
how do I setup my unix workstation to print to NT Printer server queue? any helps greatly appreciated. I can setup print staight to printer, however, I can not print it to NT server queue.
thanks, (1 Reply)