Scheduling scheduling !!!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Scheduling scheduling !!!
# 8  
Old 02-01-2012
one problem. i executed SH script "sh common.sh".
then i opened another window and tried "jobs" command. But its not listing down any jobs. why ?

but, common.sh was still running.
# 9  
Old 02-01-2012
How about

Lets say we have jobs named j1, j2, j3, j4 .... j10

In Cron Entry we have:

* * * * * touch /tmp/jobs/j1; j1 && rm -f /tmp/jobs/j1
* * * * * touch /tmp/jobs/j2; j2 && rm -f /tmp/jobs/j2
* * * * * touch /tmp/jobs/j3; j3 && rm -f /tmp/jobs/j3
...
...
...
* * * * * touch /tmp/jobs/j10; j10 && rm -f /tmp/jobs/j10

In nutshell, when the script will execute successfully, then the flag files (/tmp/jobs/j1, etc) will get deleted.

Now the monitoring tool/script can have:

Code:
 
while [ 1 ]; do
    if [[ ! -f /tmp/jobs/j1 && ! -f /tmp/jobs/j2 && ! -f /tmp/jobs/j3 && ! -f /tmp/jobs/j4 && ! -f /tmp/jobs/j10 ]]; then
            break;
    else
            sleep 5
            continue
    fi
done

# 10  
Old 02-01-2012
Quote:
one problem. i executed SH script "sh common.sh".
then i opened another window and tried "jobs" command. But its not listing down any jobs. why ?

but, common.sh was still running.
The "jobs" command refers to background jobs running on the current terminal session. You did not background "common.sh" (with an & command) and therefore it ran in foreground.
Looking at "jobs" in another terminal window is irrelvant.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Scheduling a script

Hi, I have my script in below path in UNIX /storage/sas_source/SDTM-Development/FileWatcher/filewatcher.sh I want to schedule it to run every 30 secs. Please let me know the steps to do it. Thanks. (7 Replies)
Discussion started by: prats_7678
7 Replies

2. Shell Programming and Scripting

Scheduling issues

I AM ON SOLARIS I have a script it.sh which is running fine when i execute it from shell command. But when i schedule it in crontab it is throwing error. Why and how can i resolve it ?i am clueless IT.SH #!/bin/sh ORACLE_HOME=/var/opt/oracle/product/10g; export ORACLE_HOME... (1 Reply)
Discussion started by: rafa_fed2
1 Replies

3. Shell Programming and Scripting

help required on scheduling

hi I have a script, abc.sh first time user will start a script using <<abc.sh start >>, inside a script using " at " i am schduling same script for every one hour. so my script always running . total script execution time takes around 1sec for closing same << abc.sh stop>> here... (2 Replies)
Discussion started by: pvr_satya
2 Replies

4. Shell Programming and Scripting

Crontab scheduling

Hi all, My OS is Solaris 10. I want to schedule a job which i need to run between morining 6 to eve 6 once for every 2 hours. This is what i did. 0 6-18 * * 1-5 /monitor.sh It runs for every hour how to make it for every two hours ...... Thanks, Firestar. (1 Reply)
Discussion started by: firestar
1 Replies

5. Linux

Help with cronjob scheduling

Hi Everybody, How to schedule a job using cron that shouldn't run between working hrs 9am-5pm, while run in non working hrs every hour, every day of the month, month & week. I tried the following way, not sure I can use logical not operator(!). Please correct me if wrong or suggest other... (2 Replies)
Discussion started by: sudhirav
2 Replies

6. Programming

Time scheduling

Hello !!! i am trying to create a command scheduler (written in C). Basically i would like to do what the "at" command does , but without using "at" or "cron". I have tried using getitimer but i do not know how can i shcedule multiple commands. Any ideas ??? (2 Replies)
Discussion started by: mcnikolas
2 Replies

7. Shell Programming and Scripting

Job Scheduling

I am working on UNIX AIX system, with Oracle OS. We are not supposed to use any tools to schedule our unix shell scripts. Basically we have to make use of Oracle tables and Shell scripts to manage dependencies, restartability, scheduling, parallelizing,etc. If anyone has worked/ is working... (4 Replies)
Discussion started by: singhabhijit
4 Replies

8. UNIX and Linux Applications

Job Scheduling

I am working on UNIX AIX system, with Oracle OS. We are not supposed to use any tools to schedule our unix shell scripts. Basically we have to make use of Oracle tables and Shell scripts to manage dependencies, restartability, scheduling, parallelizing,etc. If anyone has worked/ is working... (1 Reply)
Discussion started by: singhabhijit
1 Replies

9. HP-UX

cron scheduling?

Hi all, i want a job to run first monday of every of month. (1 Reply)
Discussion started by: megh
1 Replies

10. UNIX for Dummies Questions & Answers

scheduling

i have tried to schedule my process at a certain time using the at command : the error says bad time specification can somebody help me i used at 2300 job thanks (2 Replies)
Discussion started by: prashantuc
2 Replies
Login or Register to Ask a Question