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) BSD General Commands Manual LOGGER(1)
NAME
logger -- make entries in the system log
SYNOPSIS
logger [-is] [-d SD] [-f file] [-m msgid] [-p pri] [-t tag] [message ...]
DESCRIPTION
logger provides a shell command interface to the syslog(3) system log module.
Options:
-d sd Log this in the structured data (SD) field. (sd has to be passed as one argument and will require careful quoting when used from
the shell.)
-f file Log the specified file.
-i Log the process id of the logger process with each line.
-m msgid The MSGID used for the message.
-p pri Enter the message with the specified priority. The priority may be specified numerically or as a ``facility.level'' pair. For
example, ``-p local3.info'' logs the message(s) as informational level in the local3 facility. The default is ``user.notice''.
-s Log the message to standard error, as well as the system log.
-t tag Mark every line in the log with the specified tag.
message Write the message to log; if not specified, and the -f flag is not provided, standard input is logged.
EXIT STATUS
The logger utility exits 0 on success, and >0 if an error occurs.
EXAMPLES
logger System rebooted
logger -p local0.notice -t HOSTIDM -f /dev/idmc
SEE ALSO
syslog(3), syslogd(8)
STANDARDS
The logger utility conforms to IEEE Std 1003.2-1992 (``POSIX.2'').
BSD
May 14, 2010 BSD