Sponsored Content
Top Forums Shell Programming and Scripting Script for checking yesterday's log Post 302420575 by Franklin52 on Wednesday 12th of May 2010 03:52:52 AM
Old 05-12-2010
There are a bunch of threads regarding this stuff, search for yesterday with the Google Custom Search function right above the page.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

log file checking

Hi, I want to write a script which will count the occurence of several different strings in a log file? Can anyone help me with this? Thanks in advance! (1 Reply)
Discussion started by: mpang_
1 Replies

2. Shell Programming and Scripting

Yesterday date script

Hello All, I am using the below script to get yesterday date, but it is giving date of day before yesterday. Right now its 080906 but this code is giving 080904. And my requirement is 080905. #!/bin/sh CurrentDate=`TZ="GMT+24" date +'%y%m%d'` echo $CurrentDate; WHY? Please help.. ... (7 Replies)
Discussion started by: wakhan
7 Replies

3. Shell Programming and Scripting

Problem to get yesterday's date flatfile with shell script

hi, i was required to write a shell script to get yesterday's date flatfile. but i only know how to get today's date flatfile. Please observed my below scripting: Please help! Thanks ================================================= #!/bin/sh HOST='192.168.1.200' USER='ftp1'... (19 Replies)
Discussion started by: lifeseries
19 Replies

4. Shell Programming and Scripting

Script to Grep column 3 from csv file generated yesterday

Hello, Can any one please assist how to scirpt it: Every day a new log file is create and I want to process only the one generated yesterday and get the data of column 3 and 6. For example today's date is 24 then I want to get the data of log file created on 23rd. Log Files in... (7 Replies)
Discussion started by: sureshcisco
7 Replies

5. Shell Programming and Scripting

Getting yesterday's date in shell script

Im in EST, and im using the command CurrentDate=`TZ="EST+24" date +'%y%m%d'` to get the yesterday's date. Does this work perfectly for the boundary conditions of month end or year end(leap year) etc ? (2 Replies)
Discussion started by: prasperl
2 Replies

6. Shell Programming and Scripting

Need help in Shell Script comparing todays date with Yesterday date from Sysdate

Hi, I want to compare today's date(DDMMYYYY) with yesterday(DDMMYYYY) from system date,if (today month = yesterday month) then execute alter query else do nothing. The above requirement i want in Shell script(KSH)... Can any one please help me? Double post, continued here. (0 Replies)
Discussion started by: kumarmsk1331
0 Replies

7. Shell Programming and Scripting

Need script to compress the file for yesterday.

Hi, I want to write script for the last 5 files to compress. #!/bin/sh a= ls -ltr | awk '{print $9}' | head -5 | tail -3 echo `compress $a` exit 0 but this was telling "not found" please modify the script if i am wrong. (5 Replies)
Discussion started by: victory
5 Replies

8. Shell Programming and Scripting

Script to zip the files of yesterday

Hi I've the following requirement, where i need to zip the yesterday files every day . Yesterday's Files touch AB_XYZA_20130930183017.log touch AB_DY_XYZA_20130930183017.log touch AB_GZU_20130930183017.log touch AB_XYZA_20130930180023.log touch AB_DY_XYZA_20130930180023.log touch... (1 Reply)
Discussion started by: smile689
1 Replies

9. Shell Programming and Scripting

Script will keep checking running status of another script and also restart called script at night

I am using blow script :-- #!/bin/bash FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not if then # echo "process found" exit 0; else echo "process not found" exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
Discussion started by: ketanraut
1 Replies

10. Shell Programming and Scripting

Shell script to compare two files of todays date and yesterday's date

hi all, How to compare two files whether they are same are not...? like i had my input files as 20141201_file.txt and 20141130_file2.txt how to compare the above files based on date .. like todays file and yesterdays file...? (4 Replies)
Discussion started by: hemanthsaikumar
4 Replies
LOGWATCH(8)							   User Manuals 						       LOGWATCH(8)

NAME
logwatch - system log analyzer and reporter SYNOPSIS
logwatch [--detail level ] [--logfile log-file-group ] [--service service-name ] [--print] [--mailto address ] [--archives] [--range range ] [--debug level ] [--save file-name ] [--logdir directory ] [--hostname hostname ] [--help|--usage] DESCRIPTION
LogWatch is a customizable, pluggable log-monitoring system. It will go through your logs for a given period of time and make a report in the areas that you wish with the detail that you wish. Easy to use - works right out of the package on almost all systems. OPTIONS
--detail level This is the detail level of the report. level can be high, med, low. --logfile log-file-group This will force LogWatch to process only the set of logfiles defined by log-file-group (i.e. messages, xferlog, ...). LogWatch will therefore process all services that use those logfiles. This option can be specified more than once to specify multiple logfile- groups. --service service-name This will force LogWatch to process only the service specified in service-name (i.e. login, pam, identd, ...). LogWatch will there- fore also process any log-file-groups necessary to process these services. This option can be specified more than once to specify multiple services to process. A useful service-name is All which will process all services (and logfile-groups) for which you have filters installed. --print Print the results to stdout (i.e. the screen). --mailto address Mail the results to the email address or user specified in address. --archives Each log-file-group has basic logfiles (i.e. /var/log/messages) as well as archives (i.e. /var/log/messages.? or /var/log/mes- sages.?.gz). This option will make LogWatch search through the archives in addition to the regular logfiles. The entries must still be in the proper date range (see below) to be processed, however. --range range You can specify a date-range to process. This option is currently limited to only Yesterday, Today and All. --debug level For debugging purposes. level can range from 0 to 100. This will really clutter up your output. You probably don't want to use this. --save file-name Save the output to file-name instead of displaying or mailing it. --logdir directory Look in directory for log files instead of the default directory. --hostname hostname Use hostname for the reports instead of this system's hostname. In addition, if HostLimit is set in /etc/log.d/logwatch.conf, then only logs from this hostname will be processed (where appropriate). --usage Displays usage information --help same as --usage. FILES
/etc/log.d/logwatch.conf Really a symlink to /etc/log.d/conf/logwatch.conf. This file sets the default values of all the above options. These defaults are used when LogWatch is called without any parameters (i.e. from cron.daily). The file is well-documented, but the explanations above also apply to this config file. /etc/log.d/conf/services/* Configuration files for the various services whose log entries LogWatch can process. /etc/log.d/conf/logfiles/* Configuration files for the various logfiles that the above service's log entries are stored in. /etc/log.d/scripts/shared/* Filters common to many services and/or logfiles. /etc/log.d/scripts/logfiles/* Filters specific to just particular logfiles. /etc/log.d/scripts/services/* Actual filter programs for the various services. EXAMPLES
logwatch --service ftpd-xferlog --range all --detail high --print --archives This will print out all FTP transfers that are stored in all current and archived xferlogs. logwatch --service pam_pwdb --range yesterday --detail high --print This will print out login information for the previous day... MORE INFORMATION
For information on adding your own filter, please see the file HOWTO-Make-Filter which should have been included with Logwatch. If you installed from an RPM, it is probably under /usr/share/doc/logwatch-XXX. BUGS
The --range option is very weak... this will be fixed in the future. AUTHOR
Kirk Bauer <kirk@kaybee.org> http://www.kaybee.org/~kirk ftp://ftp.kaybee.org/pub/redhat/RPMS Linux MARCH 1998 LOGWATCH(8)
All times are GMT -4. The time now is 07:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy