You are trying to set up something that allows process synchronization. This is usually achieved using some kind of IPC mechanism (Inter-process communication). You can use a lockfile.
Let's have three scripts: SA, SB, SC. you need to have a shell function or a bit of code to implement this. It is easier to control if each process uses PRECISELY the same mechanism to control its successors. Consider a lockfile.
crontab: run all three scripts at 2:20 am (example)
SA:
SB:
SC:
This User Gave Thanks to jim mcnamara For This Post:
Hello All.
I'm get the following messages posted to the /var/adm/syslog file ever second and not sure on how to stop the process.
May 14 15:50:52 a3360 bootpgw: version 2.3.5
May 14 15:50:52 a3360 inetd: /etc/bootpgw exit 0x1
As said about this gets logged every second only thing that... (4 Replies)
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
heya,
can someone help me with following problem.
i am not sure how far you know the catalina.sh script from tomcat. when i start my tomcat with "catalina.sh run" then the startup-process-output will be printed out on the console, but the tomcat process is started in current shell/session, so... (1 Reply)
Hello.
I have a slackware system running cups with an HP laserJet 2100 connected via parallel port in ECP mode. Print jobs are working. Very slowly.
15K test print out of cups takes about 2 minutes to complete.
When the printout is on the way to the printer, the process "parallel" uses... (0 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
logs:
"/home/abc/public_html/index.php"
"/home/abc/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
how to use "cut" or "awk" or "sed" to get the following result:
abc
abc
xyz
xyz
xyz (8 Replies)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Hi 2 all,
i have had AIX 7.2
:/# /usr/IBMAHS/bin/apachectl -v
Server version: Apache/2.4.12 (Unix)
Server built: May 25 2015 04:58:27
:/#:/# /usr/IBMAHS/bin/apachectl -M
Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
mpm_worker_module (static)
... (3 Replies)
Discussion started by: penchev
3 Replies
LEARN ABOUT CENTOS
dotlockfile
DOTLOCKFILE(1) Cistron Utilities DOTLOCKFILE(1)NAME
dotlockfile - Utility to manage lockfiles
SYNOPSIS
/usr/bin/dotlockfile [-p] [-c] [-m] [-l|-u|-t] [-r retries] [lockfile]
DESCRIPTION
Dotlockfile is a command line utility to safely create, test and remove lockfiles. Lockfiles are created in an NFS-safe way. Dotlockfile
can can also be used to lock and unlock mailboxes even if the mailspool directory is only writable by group mail.
The name dotlockfile comes from the way mailboxes are locked for updates on a lot of UNIX systems. A lockfile is created with the same
filename as the mailbox but with the string ".lock" appended.
The names dotlock and lockfile were already taken - hence the name dotlockfile :).
OPTIONS -l Create a lockfile. This is the default.
-u Remove a lockfile.
-c Check for the existence of a valid lockfile.
-t Touch an existing lockfile (update the timestamp).
-p Write the process-id of the calling process into the lockfile. Also when testing for an existing lockfile, check the contents for a
process-id to find out if the lockfile is still valid.
-r retries
The number of times dotlockfile retries to acquire the lock if it failed the first time before giving up. The initial sleep after
failing to acquire the lock is 5 seconds. After each next try, a sleep of 5 seconds extra occurs up to a maximum sleep of 60 seconds
between tries. The default number of retries is 5.
-m Lock or unlock the current users mailbox. The path to the mailbox is the default system mailspool directory (usually /var/mail) with
the username as gotten from getpwuid() appended. If the environment variable $MAIL is set, that is used instead. Then the string
".lock" is appended to get the name of the actual lockfile.
lockfile
The lockfile to be created/removed, unless the -m option is in effect.
RETURN VALUE
Zero on success, and non-zero on failure. For the -c option, sucess means that a valid lockfile is already present. When locking (the
default, or the -l option) dotlockfile returns the same values as the library function lockfile_create(3). Unlocking a non-existant lock-
file is not an error.
NOTES
The lockfile is created exactly as named on the command line. The extension .lock is not automatically added.
This utility is a lot like the lockfile(1) utility included with procmail, and the mutt_dotlock(1) utility included with mutt. However the
command-line arguments differ, and so does the return status. It is believed that dotlockfile is the most flexible implementation, since it
automatically detects when it needs to use priviliges to lock a mailbox, and does it safely.
The above mentioned lockfile_create(3) manpage is present in the liblockfile-dev package.
BUGS
None known.
SEE ALSO lockfile_create(3), maillock(3)AUTHOR
Miquel van Smoorenburg, miquels@cistron.nl
15 May 2003 DOTLOCKFILE(1)