Ah ok, so you want to remember which last status it had. Yep you could just create a lock file, that keeps the latest status in it which will be tested against the actual status. Also I would set a lock to avoid running the script more than 1 times. If you stop it with a kill, you will have to manually remove the .lck file - maybe can put a trap in there for this.
Hi all,
I want to know how to send an email using shell script .....
I tried a command call mail but it did not work..
Please any one reply.. With example if you know thanks..
Madhu (4 Replies)
Hi All
i am writing a shell script which will search for a string "expires". once the search string is found it has to give the email address as the output and send an email to the person
This is basically to find the encrypetd keys which are loaded in the unix server
Below are sample... (10 Replies)
Hi,
Someone Knows how to obtein a chain from a unix file, but not all the line, for exemple, for this file ,obtein only 902111111 and to keep the value, this value will be used to make a mailx.
NF=ALL,
SUBJ=
FROM: SN=CD, SE=TOPCALL, NA=, N=902111111, N=TCLFI
TO: SE=FAX, NA=, C1=... (0 Replies)
hi,
i have to send an email once a day at ceratin time say 22.
i have tried with date commad, but not working.:(
HOUROFTHEDAY=`date +'%H'`
if ; then
mailx -s "Info" emailid@org.com < $ProcessStatisticsFile
fi
Please help me... (5 Replies)
Hi All,
I am new to the unix , i have to deliver one script very urgently
I have to write a shell script where i have i want to send email to specific email id
in this script i want
FROM to be parameterized and stored in a variable
TO to be parameterized and stored in a variable... (3 Replies)
Hello ,
I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them .
I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Hi Friends,
Could you guys help me out of this problem... I need to send an email to all the users and the email has to be picked from the text file.
text file contains the no. of records like:
giridhar
224285
847333
giridhar276@gmail.com
ramana
84849
33884
venkata.ramana@gmail.com... (6 Replies)
This is my below script which is working fine as it send only plain text email.
So My question is- How can I modify my below script to send this as an HTML formatted email? I want to show the text color of this expression `(echo "100*$TEST2/$TEST1" | bc -l)` as `RED` in an email and that can be... (3 Replies)
Hello Experts,
Greeting to all of you.
I have a requirement, that we have a shell script status.sh
that check the status of server and server status shows as status.sh
Enterprise Server - Running
Admin Server - Shutdown
Requirement is like whenever the output shows shutdown it should... (2 Replies)
HI Team,
I am working on reading hive table and send email in email body using shell script, can you please help on fixing the errors: I have 6 columns in my hive table and trying to send the email in the mail body.
below script:
#!/bin/bash
hive -e 'SELECT count(*) from db.table' >... (4 Replies)
Discussion started by: Mi4304
4 Replies
LEARN ABOUT DEBIAN
shlock
SHLOCK(1) General Commands Manual SHLOCK(1)NAME
shlock - create lock files for use in shell scripts
SYNOPSIS
shlock -p pid -f name [ -b ] [ -u ] [ -c ]
DESCRIPTION
Shlock tries to create a lock file named name and write the process ID pid into it. If the file already exists, shlock will read the
process ID from the file and test to see if the process is currently running. If the process exists, then the file will not be created.
Shlock exits with a zero status if it was able to create the lock file, or non-zero if the file refers to currently-active process.
OPTIONS -b Process IDs are normally read and written in ASCII. If the ``-b'' flag is used, then they will be written as a binary int. For
compatibility with other systems, the ``-u'' flag is accepted as a synonym for ``-b'' since binary locks are used by many UUCP pack-
ages.
-c If the ``-c'' flag is used, then shlock will not create a lock file, but will instead use the file to see if the lock is held by
another program. If the lock is valid, the program will exit with a non-zero status; if the lock is not valid (i.e., invoking
shlock without the flag would have succeeded), then the program will exit with a zero status.
EXAMPLES
The following example shows how shlock would be used within a shell script:
LOCK=/var/run/innd/LOCK.send
trap 'rm -f ${LOCK} ; exit 1' 1 2 3 15
if shlock -p $$ -f ${LOCK} ; then
# Do appropriate work
else
echo Locked by `cat ${LOCK}`
fi
HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> after a description of HDB UUCP locking given by Peter Honeyman. This is revision 1.9, dated
1996/10/29.
SHLOCK(1)