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 -- a shell command interface to the syslog(3) system log module
SYNOPSIS
logger [-dhisV] [-f file] [-n server] [-P port] [-p pri] [-t tag] [-u socket] [message]
DESCRIPTION
logger makes entries in the system log. It provides a shell command interface to the syslog(3) system log module.
Options:
-d, --udp
Use datagram (UDP) instead of the default stream connection (TCP).
-i, --id
Log the process ID of the logger process with each line.
-f, --file file
Log the contents of the specified file. This option cannot be combined with a command-line message.
-h, --help
Display a help text and exit.
-n, --server server
Write to the specified remote syslog server using UDP instead of to the builtin syslog routines.
-P, --port port
Use the specified UDP port. The default port number is 514.
-p, --priority priority
Enter the message into the log with the specified priority. The priority may be specified numerically or as a facility.level pair.
For example, -p local3.info logs the message as informational in the local3 facility. The default is user.notice.
-s, --stderr
Output the message to standard error as well as to the system log.
-t, --tag tag
Mark every line to be logged with the specified tag.
-u, --socket socket
Write to the specified socket instead of to the builtin syslog routines.
-V, --version
Display version information and exit.
-- End the argument list. This is to allow the message to start with a hyphen (-).
message Write the message to log; if not specified, and the -f flag is not provided, standard input is logged.
The logger utility exits 0 on success, and >0 if an error occurs.
Valid facility names are: auth, authpriv (for security information of a sensitive nature), cron, daemon, ftp, kern (can't be generated from
user process), lpr, mail, news, security (deprecated synonym for auth), syslog, user, uucp, and local0 to local7, inclusive.
Valid level names are: alert, crit, debug, emerg, err, error (deprecated synonym for err), info, notice, panic (deprecated synonym for
emerg), warning, warn (deprecated synonym for warning). For the priority order and intended purposes of these levels, see syslog(3).
EXAMPLES
logger System rebooted
logger -p local0.notice -t HOSTIDM -f /dev/idmc
logger -n loghost.example.com System rebooted
SEE ALSO
syslog(3), syslogd(8)
STANDARDS
The logger command is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible.
AVAILABILITY
The logger command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
util-linux August 2011 util-linux