Top Forums Shell Programming and Scripting Logger command not working for one script Post 303039132 by ron323232 on Monday 23rd of September 2019 05:27:11 PM
This is even better, specific to application. But seems like, something is missing.
Am I using correct syntax ?
[root@test-servs ~]# cat /etc/rsyslog.conf | grep ercapi
ercapi.*                                                /var/adm/xymessages
[root@test-servs ~]# logger -p  "XY 6990 - ERC API on $(hostname) is restarted"
logger: unknown facility name: ercapi.
[root@test-servs ~]#

--- Post updated at 03:27 PM ---

local3 worked very well. Thanks you both of you.
Test Your Knowledge in Computers #293
Difficulty: Easy
Linux is the most popular operating system among supercomputers today (2019).
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Logger Command

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

2. UNIX for Dummies Questions & Answers

Copy Command in Script Not Working

Hi, I have about enough UNIX knowledge to fill a thimble, but when a co-worker left I inherited an interface that runs Informatica on a UNIX box. I like UNIX, but my lack of skill is a real hindrance right now and I need to be able to archive the 9 csv files that are put in a directory by the FTP... (10 Replies)
Discussion started by: JeffR
10 Replies

3. UNIX for Advanced & Expert Users

Q on <user> of syslog message generated by logger command

Generally(at least on AIX5.3, Solaris9, OS X)'logger' command would create syslog messages which carry <login name> . On Solaris9, I have experienced two circumstances in which 'logname' command fails. In this circumstance I saw the 'logger' command generated syslog messages which carry... (0 Replies)
Discussion started by: masaki
0 Replies

4. Shell Programming and Scripting

Need help! command working ok when executed in command line, but fails when run inside a script!

Hi everyone, when executing this command in unix: echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error. here is content of my script: tdbsrvr$ vi "" 22 lines, 509... (4 Replies)
Discussion started by: 4dirk1
4 Replies

5. Shell Programming and Scripting

help with shell script: cp command not working, but mv command works...

Hello. I would like to ask your help regarding the cp command. We are using a cp command to create a back-up copy of our file but to no avail. It's just not working. We already checked the file and directory permissions and all seems correct. We have a script (ftp.script) which calls on... (1 Reply)
Discussion started by: udelalv
1 Replies

6. Shell Programming and Scripting

CD command not working in shell script

Hello All, I have tried many permutaion combinations in my shell script but cd command is not working in shell script. Can any one help me out in this. Below is my script. ############ #!/bin/sh set -x on BASE_DIR=/etc/init.d export BASE_DIR cd $BASE_DIR ############# but its... (8 Replies)
Discussion started by: ajaincv
8 Replies

7. Shell Programming and Scripting

Mailx command not working in the script

when i am using Mailx command from AIX box, i am getting the following errors : uuencode: not found. mailx: not found. but when i executed the mailx command as shown below it worked cat /etc/hosts | mailx -v -s "test email" It works fine in the production server. ... (2 Replies)
Discussion started by: pyaranoid
2 Replies

8. Shell Programming and Scripting

Piping the "script" command through the logger command.

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

9. UNIX for Dummies Questions & Answers

Shell script not working but command works in command prompt

Hi everyone I have a problem with my script If I try directly this command /usr/bin/nice -n 19 mysqldump -u root --password="******" wiki_schneider -c | nice -n 19 gzip -9 > /point_de_montage/$(date '+%Y%m%d')-wiki-db.sql.gz It works But if I simply add this command in a script and... (8 Replies)
Discussion started by: picemma
8 Replies

10. Shell Programming and Scripting

Execute ssh command with additional terminal command to any remote user not working script

Hello i am having an issue with bash script and this is the code now=$(cat hosts1.txt | awk '{print $2;}') while read n ;do ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >> /etc/sudoers' When i execute only part with cat, it... (8 Replies)
Discussion started by: tomislav91
8 Replies
logger(1B)					     SunOS/BSD Compatibility Package Commands						logger(1B)

logger - add entries to the system log SYNOPSIS
/usr/ucb/logger [-f filename] [-i] [-p priority] [-t tag] mm [message]... DESCRIPTION
The logger utility 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 message is unspecified, either the file indicated with -f or the standard input is added to the log. Otherwise, a filename 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: -i Log the process ID of the logger process with each line. -f filename Use the contents of filename as the message to log. -p priority Enter the message with the specified priority. The message priority can be specified numerically, or as a facility.level pair. For example, `-p' assigns the message priority to the info level in the local3 facility. The default pri- ority is user.notice. -t tag Mark each line added to the log with the specified tag. EXAMPLES
Example 1 Logging a message The command: example% logger System rebooted will log the message `System rebooted' to the facility at priority notice to be treated by syslogd as other messages to the facility notice are. Example 2 Logging messages from a file The command: example% logger -p local0.notice -t HOSTIDM -f /dev/idmc will read from the file /dev/idmc and will log each line in that file as a message with the tag `HOSTIDM' at priority notice to be treated by syslogd as other messages to the facility local0 are. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscpu | +-----------------------------+-----------------------------+ SEE ALSO
syslogd(1M), syslog(3C), attributes(5) SunOS 5.11 14 Sep 1992 logger(1B)

Featured Tech Videos

All times are GMT -4. The time now is 06:42 AM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy