Here is the explanation of code:
Basically we are setting a flag variable f to 1 when first pattern is matched & we set it to 0 when second is matched, the records are printed only if the flag is set to 1.
in the below .. i want to pick the latest logfile which is having JPS.PR inside..
that means i want particularly "spgport040408041223.log:@@@@@@@@ 04:13:09 Adding: JPS.PR."
which is latest among these..
is it possible to compare the current time with logfile time ?
reptm@xblr0758rop>... (4 Replies)
Hi, I have a problem I am trying to solve with bash.
I need to search in a file system (data base) with hundreds of directories and thousands of subdirectories and millions of files. The files have a specific format with a header that gives the properties. Directories are organized so... (1 Reply)
Hi All,
Need a small help. I have a log file which keeps updating for every Minute with multiple number of lines. I just want to grep few properties which has latest Date and Time to it. How do i do it?
I wanted to grep a property by name "Reloading cache with a maximum of" from the... (4 Replies)
To delete log files content older than 30 days and append the lastest date log file date in the respective logs
I want to write a shell script that deletes all log files content older than 30 days and append the lastest log file date in the respective logs
This is my script
cd... (2 Replies)
Plese help I need a urgent requirement.
Ex: test.log
requirement : using shell script I need to archive the log file and nil and the content of (test.log) file to 0 kb
and then in the archive folder log files are name to test.tar
test1.tar
test2.tar
EX:
/home/abc/
test.log ... (1 Reply)
Hello please help me on this,
pick the last one hour lines from the log, which have the prefix time format like this.
log message
log message
i tried to do grep, but that failed.
my code
grep '(date +)' log_file_path
This checking only the current time stamp. How to get the log... (16 Replies)
hi all,
i had the below script
x=`cat input.txt |wc -1`
awk 'NR>1 && NR<'$x' ' input.txt > output.txt
by using above script i am able to remove the head and tail part from the input file and able to append the output to the output.txt but if i run it for second time the output is... (2 Replies)
Hi all,
i have a logfile which is continuously being updated. I have built a script to check for a specific content and if it is found, it sends a string into a file. Here's the current script:
#!/bin/bash
logfile=/opt/jboss-eap-6.3/standalone/log/server.log
tail -fn0 $logfile | \... (7 Replies)
I have a shell script with 2 run time arguments. During the execution if i got any error, then it needs to redirected to a error file and in console. Also both error and output to be redirected to a log file.
Error output is getting copied to err file and getting displayed in console too. But... (2 Replies)
Discussion started by: sarathy_a35
2 Replies
LEARN ABOUT DEBIAN
dpkg::log::analyse
DPKG::Log::Analyse(3pm) User Contributed Perl Documentation DPKG::Log::Analyse(3pm)NAME
DPKG::Log::Analyse - Analyse a dpkg log
VERSION
version 1.20
SYNOPSIS
use DPKG::Log;
my $analyser = DPKG::Log::Analyse->new('filename' => 'dpkg.log'); $analyser->analyse;
DESCRIPTION
This module is used to analyse a dpkg log.
METHODS
$analser = DPKG::Log::Analyse->new('filename' => 'dpkg.log')
$analyser = DPKG::Log::Analyse->new('log_handle' => $dpkg_log)
Returns a new DPKG::Log::Analyse object. Filename parameter can be omitted, it defaults to /var/log/dpkg.log.
Its possible to specify an existing DPKG::Log object instead of a filename. This will be used and overrides any filename setting.
$analyser->analyse;
Analyse the debian package log.
$analyser->newly_installed_packages
Return all packages which were newly installed in the dpkg.log.
$analyser->upgraded_packages
Return all packages which were upgraded in the dpkg.log.
$analyser->removed_packages
Return all packages which were removed in the dpkg.log.
$analyser->unpacked_packages
Return all packages which are left in state 'unpacked'.
$analyser->halfinstalled_packages
Return all packages which are left in state 'half-installed'.
$analyser->halfconfigured_packages
Return all packages which are left in state 'half-configured'.
$analyser->installed_and_removed_packages
Return all packages which got installed and removed.
SEE ALSO
DPKG::Log, DPKG::Log::Analyse::Package
AUTHOR
Patrick Schoenfeld <schoenfeld@debian.org>.
COPYRIGHT AND LICENSE
Copyright (C) 2011 Patrick Schoenfeld <schoenfeld@debian.org>
This library is free software. You can redistribute it and/or modify it under the same terms as perl itself.
perl v5.10.1 2011-02-26 DPKG::Log::Analyse(3pm)