10-21-2008
Hi jim, i used following command:
Quote:
[monti@blr ~]$ df -m /home/monti/log
Filesystem 1M-blocks Used Available Use% Mounted on
miacc:/export/home/monti/log
100827 62970 36849 64% /home/monti/log
I think, there is enough disk space for a log file.
i'm not sure how to use mtime to find out logfile is getting updated. I have little idea abt mtime, with that i think, it'll print same value if its getting updated by some function or printing same value again and again.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I would like to define a script in order to update a file with the last updated records:
I wrote :
#!/bin/sh
YEAR=$(date +%Y)
MONTH=$(date +%m)
DAY=$(date +%d)
COMM=/usr/bin/comm
for file in * ;
do
if ] ; then
FILE=${DPSTY}
UNIQUE=Unique_${FILE}
... (4 Replies)
Discussion started by: dbfree
4 Replies
2. UNIX for Dummies Questions & Answers
Hi all,
my problem is teh following:
I need to move a file from a folder to another and I usually do it by the get command but in this case I have a list of file in the source folder and I have to select only the lust updated one.
Ho to do this?
All the files have the same name followed... (4 Replies)
Discussion started by: callimaco0082
4 Replies
3. Shell Programming and Scripting
Put this together from somewhere else on the forums, just modified it and added the loop.
#!/bin/ksh
localFile=$1
remoteFile=$2
#source FTP parameters
. .ftp_put.cfg
mylog=ftp_session.log
echo "$(date "+%H:%M:%S") - Attempt to FTP $1 to $2" > $mylog
machine="server1 server2... (5 Replies)
Discussion started by: cbo0485
5 Replies
4. Shell Programming and Scripting
Hi,
I have a file, fileA, that consists of two fields. Field 1 has an old object name, and field 2 has a new object name. I would like to search and replace a master file, FileB, by substituting the old object name (field 1 in fileA) with the new object name ( field 2 in fileA).
FileA:... (16 Replies)
Discussion started by: pitccorp01
16 Replies
5. Shell Programming and Scripting
#!/bin/sh
#set -x
Current_Date=`date +"%b %e"`
Filepmdate=`ls -ltr /file/ | tail -5 | awk '{print $6,$7}'`
if ; then
echo " "
exit 0
else
echo "Log files are not updated please check"
exit 0
fi
done
> sh -x l12.sh
+ + date +%b %e
Current_Date=Aug... (2 Replies)
Discussion started by: arch12
2 Replies
6. Shell Programming and Scripting
Is there any command to know what updated last in file? (3 Replies)
Discussion started by: anuragpgtgerman
3 Replies
7. Shell Programming and Scripting
Hi ,
We have around 22 logs , each has different entries. I have to automate this using shell script. The ideas which am sharing is given below
1) We use only TAIL -100 <location and name of the log> Command to check the logs.
2) We want to check whether the log was updated before 24... (13 Replies)
Discussion started by: Kalaihari
13 Replies
8. Shell Programming and Scripting
Hello,
Iam running with one issue, since particular date looks like one of the script vanished from the system after restarting of the system.
I dont know which scrit it was but definatelt there should be one.
but might be some logs would be there which have not updated from that day.
so... (2 Replies)
Discussion started by: ajju
2 Replies
9. Shell Programming and Scripting
hi can any one please help on below .im new to shell scrpting
i need to write a shell script which will check particular log file is presented or not in specific location ,if yes how long it was not modified/not rolling ?if its not modified/log is not rolling script will have to send mail (9 Replies)
Discussion started by: 4Learning
9 Replies
LEARN ABOUT DEBIAN
dpkg::log
DPKG::Log(3pm) User Contributed Perl Documentation DPKG::Log(3pm)
NAME
DPKG::Log - Parse the dpkg log
VERSION
version 1.20
SYNOPSIS
use DPKG::Log;
my $dpkg_log = DPKG::Log->new('filename' => 'dpkg.log', 'parse' => 1);
DESCRIPTION
This module is used to parse a logfile and store each line as a DPKG::Log::Entry object.
METHODS
$dpkg_log = DPKG::Log->new()
$dpkg_log = DPKG::Log->new('filename' => 'dpkg.log')
$dpkg_log = DPKG::Log->new('filename' => 'dpkg.log', 'parse' => 1 )
Returns a new DPKG::Log object. If parse is set to a true value the logfile specified by filename is parsed at the end of the object
initialisation. Otherwise the parse routine has to be called. Filename parameter can be omitted, it defaults to /var/log/dpkg.log.
Optionally its possible to specify from or to arguments as timestamps in the standard dpkg.log format or as DateTime objects. This
will limit the entries which will be stored in the object to entries in the given timerange. Note that, if this is not what you want,
you may ommit these attributes and can use filter_by_time() instead.
By default the module will assume that those timestamps are in the local timezone as determined by DateTime::TimeZone. This can be
overridden by giving the argument time_zone which takes a timezone string (e.g. 'Europe/Berlin') or a DateTime::TimeZone object.
Additionally its possible to override the timestamp_pattern by specifying timestamp_format. This has to be a valid pattern for
DateTime::Format::Strptime.
$dpkg_log->filename
$dpkg_log->filename('newfilename.log')
Get or set the filename of the dpkg logfile.
$dpkg_log->parse
$dpkg_log->parse('time_zone' => 'Europe/Berlin')
$dpkg_log->parse('time_zone' => $dt_tz )
Call the parser.
The time_zone parameter is optional and specifies in which time zone the dpkg log timestamps are. If its omitted it will use the
default local time zone. Its possible to specify either a DateTime::TimeZone object or a string.
@entries = $dpkg_log->entries;
@entries = $dpkg_log->entries('from' => '2010-01-01.10:00:00', to => '2010-01-02 24:00:00')
Return all entries or all entries in a given timerange.
from and to are optional arguments, specifying a date before (from) and after (to) which entries aren't returned. If only to is
specified all entries from the beginning of the log are read. If only from is specified all entries till the end of the log are read.
$entry = $dpkg_log->next_entry;
Return the next entry.
@entries = $dpkg_log->filter_by_time(from => ts, to => ts)
@entries = $dpkg_log->filter_by_time(from => ts)
@entries = $dpkg_log->filter_by_time(to => ts)
@entries = $dpkg_log->filter_by_time(from => ts, to => ts, entry_ref => $entry_ref)
Filter entries by given from - to range. See the explanations for the new sub for the arguments.
If entry_ref is given and an array reference its used instead of $self->{entries} as input source for the entries which are to be
filtered.
($from, $to) = $dpkg_log->get_datetime_info()
Returns the from and to timestamps of the logfile or (if from/to values are set) the values set during object initialisation.
SEE ALSO
DPKG::Log::Entry, DateTime, DateTime::TimeZone
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(3pm)