I've seen several examples of scripts in thise forum about having a script generate a log file. I have a script that is run from cron and that monitors a file system for a specfic filename(s) and then performs some actions on them. Normally I call this script from another script (which the one actually called from cron) that generates the log file from the output of the first script. I've found that just looking at the output of the first script is too detailed for most purposes so I want to modify it to create its own log file and then just have specific parts of the script create lines for the log. The script looks like:
...I searched for some type of function to call to create the lof and found this:
How would I go about using a function to create and append the log file? I want to be able to place a line like:
Hi,
Can anyone pls let me know how can i modify the file contents thru script.
Eg.
I have file abc.dat that contains below lines
Merge.resync.cycleFlag
Merge.resync.logFlag
Merge.resync.maxByteRate
Merge.resync.maxSearch
Merge.resync.rate
Merge.resync.tickLog ... (2 Replies)
Hi All,
I have a file like below, how can i insert one line after line 1 without using a temporary file in perl?
line 1
line 2
line 3
expected result
line 1
new line <---insert here
line 2
line 3 (2 Replies)
Dear unix forum members,
I'm working on a script that will parse a mail machine's logs and print a list of email addresses in this format:
authen@domain.com | sender@domain | recipient@domain
exam
account1@domain1.com | sender2@domain2.com |... (3 Replies)
This is my log file and this is live log.
Any abnormal error other than following
I need to generate the email.
Log path : /DER/app/admin/ABC/bdump/erg.log
Current log# 2 seq# 103046 mem# 0: /ora2/oradata/ABC/redo02a.log
Current log# 2 seq# 103046 mem# 1:... (1 Reply)
This is my log file and this is live log.
Any abnormal error other than following
I need to generate the email.
Log path : /DER/app/admin/ABC/bdump/erg.log
Current log# 2 seq# 103046 mem# 0: /ora2/oradata/ABC/redo02a.log
Current log# 2 seq# 103046 mem# 1:... (7 Replies)
Hi All the Helpers!
I have a text file which looks like input.txt.I would request to please suggest me how can I make this file look like output.txt
input.txt
VOP 111 0 1 2
DEM 111 0 222 333 444 555
DEM 879 888 987 888 989
DEM 879 888 987 888 989
VOP 118 0 12 3 6... (7 Replies)
Hello,
How to tail -f logfile. if log file is gennerate every 1 HR.
I want it works automatically all the time. never changes it by manual.
Thank
ls -trl CybertonTransaction.*
-rw-r--r-- 1 autobot robot 617071 Jul 9 00:02 CybertonTransaction.20130709-00.log
-rw-r--r-- 1 autobot ... (12 Replies)
Hi
I have a file "test" with data as below
1,APRIL,NEW,"New market,delhi,pune,India",RECENT, 254664
2,MARCH,OLD,"New Area,Mumbai,UP,India",CURRENT, 152483
So I want a script which provides output as below
1,APRIL,RECENT,254664
2,MARCH,CURRENT,152483
I am aware we can use awk/sed... (9 Replies)
Hello Friends,
I would like my script to display date timestamps in the file name for every script execution.
Below is the scenario: (just for testing purpose)
I scheduled a cron job, lets say it runs every 5 min and record/logs output in to a log file.
0,5,10,15,20,25,30,35,40,45,50,55 *... (5 Replies)
Discussion started by: System Admin 77
5 Replies
LEARN ABOUT DEBIAN
newslog
NEWSLOG(5) File Formats Manual NEWSLOG(5)NAME
newslog - description of Usenet log files
DESCRIPTION
Most log files created by Usenet programs reside in the /var/log/news directory and have a ``.log'' extension. Several versions are usu-
ally kept with an additional extension such as ``.1'', ``.2'', etc. -- the higher the number, the older the log. The older versions are
compressed.
The scanlogs script and related utilities (see newslog(8)) are responsible for rotating and compressing these files.
Some log files always have data, others only have data if there is a problem, and others are only created if a particular program is used
or configuration parameter is set. The innstat script (see newslog(8)) monitors the size of all log files.
The following files will only accumulate data under the direction of control.ctl(5):
control.log miscctl.log newgroup.log rmgroup.log unwanted.log
In order to create these files, the ``message'' and ``action'' fields of control.ctl should be chosen from the following table:
Message Action Meaning
all log=miscctl Log all messages by default
default log=miscctl Log unknown messages
newgroup doit=newgroup Create group and log message
newgroup log=newgroup Log message
rmgroup doit=rmgroup Remove group and log message
rmgroup log=rmgroup Log message
``other'' doit=miscctl log and process the message
``other'' log=miscctl Log message
Here, ``other'' refers to any other control message such as:
checkgroups ihave sendme sendsys senduuname version
The following is a list of log files.
control.log
This file maintains a count of the number of newgroup and rmgroup control messages seen for each newsgroup. The count is of the
number of control messages with identical arguments, regardless if they were actually processed. All control arguments, including
invalid ones, are counted. This file is updated by tally.control, which is invoked by scanlogs if either the newgroup or rmgroup
logs exist. This file is not rotated.
errlog This file contains the standard output and standard error of any program spawned by innd(8). The most common programs are the con-
trol-message handlers found in /usr/lib/news/control. This file should be empty. Scanlogs will print the entire contents of this
log file if it is non-empty.
expire.log
By default, when news.daily is going to expire old news articles, it writes the date to this file, followed by any output from
expire(8) and the ending date. All lines but the first are indented four spaces.
miscctl.log
When control.ctl is configured as described above, all control messages except newgroup and rmgroup are appended to this file by
writelog. There will be a summary line describing the message and the action taken, followed by the article indented by four spa-
ces, and a blank line.
newgroup.log
When control.ctl is configured as described above, all newgroup messages are appended to this file using the same format as for mis-
cctl.log.
news This file logs articles received by innd. Scanlogs summarizes the rejected articles reported in this file.
news.crit
All critical error messages issued by innd are appended to this file via syslog(3). This log file should be empty. Scanlogs will
print the entire contents of this log file if it is non-empty. You should have the following line in your syslog.conf(5) file:
news.crit /var/log/news/news.crit
news.err
All major error messages issued by innd are appended to this file via syslog. This log file should be empty. Scanlogs will print
the entire contents of this log file if it is non-empty. You should have the following line in your syslog.conf file:
news.err /var/log/news/news.err
news.notice
All standard error messages and status messages issued by innd are appended to this file via syslog. Scanlogs uses the awk(1)
script innlog.awk to summarize this file. You should have the following line in your syslog.conf file:
news.notice /var/log/news/news.notice
nntpsend.log
The nntpsend(8) programs appends all status messages to this file.
rmgroup.log
When control.ctl is configured as described above, all rmgroup messages are appended to this file using the same format as for misc-
ctl.log.
unwanted.log
This log maintains a count of the number of articles that were rejected because they were posted to newsgroups that do not exist at
the local site. This file is updated by tally.unwanted and maintained in reverse numeric order (the most popular rejected group
first). This file is not rotated.
HISTORY
Written by Landon Curt Noll <chongo@toad.com> and Rich $alz <rsalz@uunet.uu.net> for InterNetNews. This is revision 1.6, dated 1996/09/10.
SEE ALSO control.ctl(5), ctlinnd(8), expire(8), innd(8), news.daily(8), nntpsend(8), newslog(8).
NEWSLOG(5)