10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
On RHEL 7.2, I created below script in cronjob for every minute. If this process is found to be not running, it should record message in /var/adm/xymessages, start it and send email.
#!/bin/bash
source /export/home/prodadm/.bash_profile
if ;
then
... (8 Replies)
Discussion started by: ron323232
8 Replies
2. Shell Programming and Scripting
Hi All,
I have created a unix script to mail the xls file.This is being done using mailx command
fdate=`tail -1 abc.xls | cut -c1-8`
SUBJECT="CARD GL Exceptions : ${ENV} for ${fdate}"
destname=CARD_GL_Exceptions_$fdate
sed 's/#BUSINESS/BUSINESS/1' abc.xls > abc2.xls
mv abc2.xls abc.xls... (2 Replies)
Discussion started by: karthik adiga
2 Replies
3. Shell Programming and Scripting
I use the snippet below in /etc/profile on RHEL Linux to capture command line logging and it all works well and good.
Now I'd like to pipe the same output from script through the logger command so it all gets logged to syslog.
The only additional code I've added is in bold below (|... (4 Replies)
Discussion started by: woodson2
4 Replies
4. Shell Programming and Scripting
Hi
I have the following files generated by different users on a directory
-rw-rw-r-- 1 NAME1 database03 809 Nov 17 10:41 PCAS_CARD_TRANS_OFF.1111171041.lg
-rw-rw-r-- 1 richard ccsdba 10968411 Nov 17 10:43 load_123_RX0_0.1111171016.lg
-rw-rw-r-- 1 DEV db03 10713 Nov 17... (5 Replies)
Discussion started by: bobby1015
5 Replies
5. Shell Programming and Scripting
HI All,
I have a log file where the logs will be in the format as given below:
2011-05-25 02:32:51 INFO PROCESS STARTING
2011-05-25 02:32:52 INFO PROCESS STARTED
.
.
.
I want to retrieve only the logs which are less than 5 mins older than current time using grep... (3 Replies)
Discussion started by: rvhg16
3 Replies
6. Shell Programming and Scripting
Hi,
I have a directory named (/output). this directory has files in the below format
abc.* ,
xyz*,
djj*,
iwe*,
weewe*,
rier*,
3948903ddfgf*
these files are generated at random. what i need to do is. delete all the files of all kinds but keep only the last generated file of... (5 Replies)
Discussion started by: dazdseg
5 Replies
7. Shell Programming and Scripting
Hello friends,
I have a C source code containing sql statements. I use the following sed command to print all the sql blocks in the source code....
sed -n "/exec sql/,/;/p" Sample.cpp
The above sed command will print the sql blocks based on the pattern "exec sql" & ";"... (2 Replies)
Discussion started by: frozensmilz
2 Replies
8. UNIX for Advanced & Expert Users
How could I get the name of user of a file in a file path ?
OR
Who i accessing the particular file in a file path ?
Any Idea ??
Please help !!
Thanks :) (1 Reply)
Discussion started by: varungupta
1 Replies
9. Shell Programming and Scripting
Hi I have a command in a script .
/usr/bin/iostat -E
I would like to place an entry in /var/adm/messages (via syslog) as a daemon.notice using the logger command but i just cant work out the syntax for this , do I pipe the output of iostat into logger? or is it redirected...can somebody give me... (1 Reply)
Discussion started by: hcclnoodles
1 Replies
10. Post Here to Contact Site Administrators and Moderators
There are some common tasks and best practices that could be shared with the group by all the good people on the board. Having a admin approved/user generated section of this sort might be nice. Often there are lots of tidbits that could be grown into a useful document. Just a thought.
... (5 Replies)
Discussion started by: kduffin
5 Replies
logger(1) User Commands logger(1)
NAME
logger - add entries to the system log
SYNOPSIS
logger [-i] [-f file] [-p priority] [-t tag] [message] ...
DESCRIPTION
The logger command provides a method for adding one-line entries to the system log file from the command line. One or more message argu-
ments can be given on the command line, in which case each is logged immediately. If this is unspecified, either the file indicated with -f
or the standard input is added to the log. Otherwise, a file can be specified, in which case each line in the file is logged. If neither
is specified, logger reads and logs messages on a line-by-line basis from the standard input.
OPTIONS
The following options are supported:
-ffile Uses the contents of file as the message to log.
-i Logs the process ID of the logger process with each line.
-ppriority Enters the message with the specified priority. The message priority can be specified numerically, or as a facility.level
pair. For example, `-p local3.info' assigns the message priority to the info level in the local3 facility. The default
priority is user.notice.
-ttag Marks each line added to the log with the specified tag.
OPERANDS
The following operand is supported:
message One of the string arguments whose contents are concatenated together, in the order specified, separated by single space
characters.
EXAMPLES
Example 1: Examples of the logger command
The following example:
example% logger System rebooted
logs the message `System rebooted' to the default priority level notice to be treated by syslogd as are other messages to the facility
user.
The next example:
example% logger -p local0.notice -t HOSTIDM -f /dev/idmc
reads from the file /dev/idmc and logs each line in that file as a message with the tag `HOSTIDM' at priority level notice to be treated by
syslogd as are other messages to the facility local0.
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of logger: LANG, LC_ALL, LC_CTYPE, LC_MES-
SAGES, and NLSPATH.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
>0 An error occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO
mailx(1), write(1), syslogd(1M), syslog(3C), attributes(5), environ(5), standards(5)
SunOS 5.10 1 Feb 1995 logger(1)