Sponsored Content
Top Forums UNIX for Advanced & Expert Users Notification from Background jobs Post 302121740 by ennstate on Monday 18th of June 2007 07:40:03 AM
Old 06-18-2007
Hi,
Does this approach helps?.

Gurus,
Please provide suggestions.

Code:
#!/bin/ksh
LOG_FILE=/tmp/${0##*/}.log

LogMsg() {
 print "$(date +%d/%m/%y:%H:%M:%S) : $@"  >> $LOG_FILE
}

CallA() {
 LogMsg "Calling Function A"
 iostat 5 5  >> $LOG_FILE &
 wait $!
 LogMsg "A done with $!"
 return 45
}

CallB() {
 LogMsg "Calling Function B"
 vmstat 5 5  >> $LOG_FILE &
 wait $!
 LogMsg "B done with $!"
 return 46
}

Main() {
 LogMsg "Starting the Process - Main"
 CallA
 Ret=$?
 LogMsg " Returned value $Ret "
 CallB
 Ret=$?
 LogMsg " Returned value $Ret "
}

# Call the Main Function here
Main


Thanks
Nagarajan Ganesan
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

background jobs

Hi, i have a problem with turning a job into backgrund. When i enter this at the shell: spice -b darlington.cir -r output.raw > screenout.tmp & and then let me show the currently running jobs, i get the following output: + Suspended (tty output) spice -b darlington.cir -r output.raw >... (4 Replies)
Discussion started by: qsi
4 Replies

2. UNIX for Dummies Questions & Answers

Checking background jobs from another session

Ok, so I'm comfortable backgrounding jobs in the shell, starting and stopping them, and bringing them to the fg and bg. What I can't figure out is how to monitor those background jobs from another shell (remote, or local). Example: - On a local console for MYHOST, I su to root - I then update... (3 Replies)
Discussion started by: vikingshelmut
3 Replies

3. Programming

Background jobs

Hi there, I'm quite new to UNIX for programming. I have a script that does this: Shows on screen real-time results taken from phone calls and logs them in a file. However, when I start my script, I want my script to start logging in the file in the background, so I can continue working on... (1 Reply)
Discussion started by: Jeremiorama
1 Replies

4. UNIX for Dummies Questions & Answers

background job finished notification

In my last job someone gave me the command to put in my .profile that let me know when a job I had running in the background finished. It was a word about 5 char long. I can't remember it! (4 Replies)
Discussion started by: nkeller
4 Replies

5. Shell Programming and Scripting

background jobs exit status and limit the number of jobs to run

i need to execute 5 jobs at a time in background and need to get the exit status of all the jobs i wrote small script below , i'm not sure this is right way to do it.any ideas please help. $cat run_job.ksh #!/usr/bin/ksh #################################### typeset -u SCHEMA_NAME=$1 ... (1 Reply)
Discussion started by: GrepMe
1 Replies

6. UNIX for Dummies Questions & Answers

Background jobs

If I run a job in the background and logoff. Will the job continue to run or will my processes be killed ? (1 Reply)
Discussion started by: jxh461
1 Replies

7. Shell Programming and Scripting

Problem with Background Jobs

We had a generic process where the jobs are scheduled to run sequentially and in background. We are noticing the problems with the background jobs. Error Message: /bin/ksh: /home/suren/bin/GenericReportScript.sh: cannot execute The same script is existing in bin and it had enough... (2 Replies)
Discussion started by: sureng
2 Replies

8. Shell Programming and Scripting

Nohup and background jobs

Hi All, Can someone help me in knowing the exact difference between nohup and &. The definition is quite clear but i only want to know if i run my job using & and in between i hung up my terminal. (10 Replies)
Discussion started by: Uinx_addic
10 Replies

9. Red Hat

shc utility for background jobs

I have used shc utillity to convert a shell script to it's compiled version.Inside this script i have called another shell script which is also in compled version. Example:- Main script:- main.sh.x child script:- child.sh.x (this is called inside main.sh.x) This child script will run in... (2 Replies)
Discussion started by: millan
2 Replies

10. AIX

Use of screen in running background jobs and how to use this

Hello, Please advise use of screen in running jobs in nohup background and how to use this Best regards, Vishal (1 Reply)
Discussion started by: Vishal_dba
1 Replies
snmp_view_based_acm_mib(3erl)				     Erlang Module Definition				     snmp_view_based_acm_mib(3erl)

NAME
snmp_view_based_acm_mib - Instrumentation Functions for SNMP-VIEW-BASED-ACM-MIB DESCRIPTION
The module snmp_view_based_acm_mib implements the instrumentation functions for the SNMP-VIEW-BASED-ACM-MIB, and functions for configuring the database. The configuration files are described in the SNMP User's Manual. EXPORTS
configure(ConfDir) -> void() Types ConfDir = string() This function is called from the supervisor at system start-up. Inserts all data in the configuration files into the database and destroys all old rows with StorageType volatile . The rows created from the configuration file will have StorageType nonVolatile . All snmp counters are set to zero. If an error is found in the configuration file, it is reported using the function config_err/2 of the error report module, and the function fails with the reason configuration_error . ConfDir is a string which points to the directory where the configuration files are found. The configuration file read is: vacm.conf . reconfigure(ConfDir) -> void() Types ConfDir = string() Inserts all data in the configuration files into the database and destroys all old data, including the rows with StorageType non- Volatile . The rows created from the configuration file will have StorageType nonVolatile . Thus, the data in the SNMP-VIEW-BASED-ACM-MIB, after this function has been called, is the data from the configuration files. All snmp counters are set to zero. If an error is found in the configuration file, it is reported using the function config_err/2 of the error report module, and the function fails with the reason configuration_error . ConfDir is a string which points to the directory where the configuration files are found. The configuration file read is: vacm.conf . add_sec2group(SecModel, SecName, GroupName) -> Ret Types SecModel = v1 | v2c | usm SecName = string() GroupName = string() Ret = {ok, Key} | {error, Reason} Key = term() Reason = term() Adds a security to group definition to the agent config. Equivalent to one vacmSecurityToGroup-line in the vacm.conf file. delete_sec2group(Key) -> Ret Types Key = term() Ret = ok | {error, Reason} Reason = term() Delete a security to group definition from the agent config. add_access(GroupName, Prefix, SecModel, SecLevel, Match, RV, WV, NV) -> Ret Types GroupName = string() Prefix = string() SecModel = v1 | v2c | usm SecLevel = string() Match = prefix | exact RV = string() WV = string() NV = string() Ret = {ok, Key} | {error, Reason} Key = term() Reason = term() Adds a access definition to the agent config. Equivalent to one vacmAccess-line in the vacm.conf file. delete_access(Key) -> Ret Types Key = term() Ret = ok | {error, Reason} Reason = term() Delete a access definition from the agent config. add_view_tree_fam(ViewIndex, SubTree, Status, Mask) -> Ret Types ViewIndex = integer() SubTree = oid() Status = included | excluded Mask = null | [integer()], where all values are either 0 or 1 Ret = {ok, Key} | {error, Reason} Key = term() Reason = term() Adds a view tree family definition to the agent config. Equivalent to one vacmViewTreeFamily-line in the vacm.conf file. delete_view_tree_fam(Key) -> Ret Types Key = term() Ret = ok | {error, Reason} Reason = term() Delete a view tree family definition from the agent config. Ericsson AB snmp 4.19 snmp_view_based_acm_mib(3erl)
All times are GMT -4. The time now is 10:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy