01-16-2001
Then use a wrapper.
Create another script like launch.scr1;
#!/bin/sh
touch /tmp/scr1.lock
/path/to/SCR1
wait
rm -f /tmp/scr1.lock
------------------
And then create the wrapper for SCR2 called launch.scr2
#!/bin/sh
if [ -e /tmp/scr1.lock ]
then exit
else /path/to/SCR2
fi
------------------
Than change your cron entries to execute the wrapper scripts instead of the actual scripts/executables.
[Edited by 98_1LE on 01-16-2001 at 10:13 AM]
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
what command can i use to tell if a script is running under different users? (1 Reply)
Discussion started by: csnewbie
1 Replies
2. Shell Programming and Scripting
Hi,
Iam having the scripts as follows. i jus want to run those in parallel.
main aim is to minimise the time for overall execution of the script.
now out.txt is having 1 lac records.
script1(split.sh)
split -1000 out.txt splitout
ls -A splitout* > filelist.txt
cat filelist.txt... (6 Replies)
Discussion started by: nivas
6 Replies
3. Shell Programming and Scripting
Hi All,
My input file name is 1.sh
the contents of file are
cat status2.txt | while read filename
do
echo "$filename"
echo "first content of the file is ${filename}"
echo "second content of the file is ${filename}"
echo "second content of the file is ${filename}"
if } -eq 0 -a... (1 Reply)
Discussion started by: sunitachoudhury
1 Replies
4. Shell Programming and Scripting
Hello everybody,
I'm trying to run a shell script in crontab file. But anyhow it's not getting executed. Following is the command that I've used in crontab.
30 07 * * * . ./.cronprofile;/om/reports/reportscripts/jitu/prod/prd_pre_to_post.sh
35 11 * * * .... (3 Replies)
Discussion started by: jitu.jk
3 Replies
5. UNIX for Dummies Questions & Answers
I am checking one until loop with the following logic
until ||
||||
do
sleep 30
done
before running this i am exporting above variables to SUCCESS.But the loop is running in infinite loop.My requirement is to make the loop run until
all the 3 variables are SUCCESS or any of the 3... (2 Replies)
Discussion started by: dr46014
2 Replies
6. Shell Programming and Scripting
Hi All,
Am using the below command to start my application using the root user
su - bin -c "/home/bin/test/start.sh"
but am getting the error becaue i have set some environment varibales in bin .profile
when i execute the command start.sh by logging directly into bin account it's... (8 Replies)
Discussion started by: ravi.sri24
8 Replies
7. Shell Programming and Scripting
Hi all,
I have set up a cron job which calls another shell script shell script which in turn calls a Java process. The cron tab looks so.
0,30 7-18 * * 1-5 /u01/home/weblogic/brp/bin/checkstatus.sh >> /u01/home/weblogic/logs/checkstatus.log
The checkstatus.sh scripts looks like this.
... (4 Replies)
Discussion started by: sirbrian
4 Replies
8. Solaris
I need to run a script (from cron) that runs a second script.
What worries me is that second script, when run from bash, upon finishing doesn't return to bash unless I press the 'Enter' key.
I presume that's because last command in that script ends with &
Could that be a problem for cron?... (2 Replies)
Discussion started by: orange47
2 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I need a script (ksh) on ServerAdmin that will run an archive scripts from different several Servers through ssh. The problem is that how can i switch user when before running the archive script. I already configured password-less connection on the servers.
server 1... (1 Reply)
Discussion started by: chococrunch6
1 Replies
10. Shell Programming and Scripting
I have an if condition. If that condition is true then one script will be run and after that I need to check another condition based on the output value of first script.
i tried like below :
cd lock
if ; then
rm exitup
if ; then
kb_shutdown
kb_startup
if ; then
rm exitup
if ;... (3 Replies)
Discussion started by: charanarjun
3 Replies
LEARN ABOUT PHP
wincache_lock
WINCACHE_LOCK(3) 1 WINCACHE_LOCK(3)
wincache_lock - Acquires an exclusive lock on a given key
SYNOPSIS
bool wincache_lock (string $key, [bool $isglobal = false])
DESCRIPTION
Obtains an exclusive lock on a given key. The execution of the current script will be blocked until the lock can be obtained. Once the
lock is obtained, the other scripts that try to request the lock by using the same key will be blocked, until the current script releases
the lock by using wincache_unlock(3).
Warning
Using of the wincache_lock(3) and wincache_unlock(3) can cause deadlocks when executing PHP scripts in a multi-process environment
like FastCGI. Do not use these functions unless you are absolutely sure you need to use them. For the majority of the operations on
the user cache it is not necessary to use these functions.
PARAMETERS
o $key
- Name of the key in the cache to get the lock on.
o $isglobal
- Controls whether the scope of the lock is system-wide or local. Local locks are scoped to the application pool in IIS FastCGI
case or to all php processes that have the same parent process identifier.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Using wincache_lock(3)
<?php
$fp = fopen("/tmp/lock.txt", "r+");
if (wincache_lock("lock_txt_lock")) { // do an exclusive lock
ftruncate($fp, 0); // truncate file
fwrite($fp, "Write something here
");
wincache_unlock("lock_txt_lock"); // release the lock
} else {
echo "Couldn't get the lock!";
}
fclose($fp);
?>
SEE ALSO
wincache_unlock(3), wincache_ucache_set(3), wincache_ucache_get(3), wincache_ucache_delete(3), wincache_ucache_clear(3), win-
cache_ucache_exists(3), wincache_ucache_meminfo(3), wincache_ucache_info(3), wincache_scache_info(3).
PHP Documentation Group WINCACHE_LOCK(3)