Sponsored Content
Top Forums UNIX for Advanced & Expert Users AIX idea needed to check the logs updated date and time Post 302832479 by millan on Monday 15th of July 2013 03:18:03 AM
Old 07-15-2013
There is no direct command in date to convert it to epoch timings in HP-UX.
You have to write a longer script which will do that.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help needed - Replacing all date & time occurrences in a file with a string using Sed

Hi, I am new to using Sed. I have a file containg lines like the following: INFORM----Test.pc:168:10/11/05 12:34:26 > some text goes here.. TRACE-----Test.pc:197:10/11/05 12:34:26 > some text goes here.. My requirement is to replace 10/11/05 12:34:26 with a string <RUNDATE> (including <... (4 Replies)
Discussion started by: Hema_M
4 Replies

2. Shell Programming and Scripting

Check Time/Date on a server

I have two servers which are not in sync. I need to write a script that checks the time on the corresponding server and another script to call the above script on both the servers simulataneously to check if there is a time difference. Can anyone provide me with such scripts as I am new to... (3 Replies)
Discussion started by: ravneet123
3 Replies

3. Shell Programming and Scripting

search on weblogic logs with date time ranges 2

Hi All, The developers want me to search and capture the weblogic log, you know this big logs of htmls. They want to me to have ranges on the date and time. Like from "2010-01-20 14:04:46,186" to "2010-01-20 15:00:12,490" I can only do this, cat /usr/local/bea/logs_prod1/debug.log |... (1 Reply)
Discussion started by: itik
1 Replies

4. Linux

search on weblogic logs with date time ranges

Hi All, The developers want me to search and capture the weblogic log, you know this big logs of htmls. They want to me to have ranges on the date and time. Like from "2010-01-20 14:04:46,186" to "2010-01-20 15:00:12,490" I can only do this, cat /usr/local/bea/logs_prod1/debug.log... (1 Reply)
Discussion started by: itik
1 Replies

5. Shell Programming and Scripting

How to check crontab edited date and time?

How to check when was the last time the crontab was updated and also what was the modification done ? (2 Replies)
Discussion started by: mail2sant
2 Replies

6. Shell Programming and Scripting

How to find last updated date and time of a folder in Perl?

Hi All, I have a process which after some time continues move a files to some folder(say the name of the folder is logdir) What i am trying to do is as the files are coming to the logdir folder, I want the latest updated time and date of the folder in PERL. (1 Reply)
Discussion started by: parthmittal2007
1 Replies

7. Shell Programming and Scripting

Search for logs traced between specific date and time from log file

HI, I want to search for a logs which are trace between specific date and time from logs file. My logs are generated like this :- Tue Jun 18 05:00:02 EEST 2013 | file_check.sh| Message:script has files to process. Thu Jun 20 05:00:02 EEST 2013 | file_check.sh| Message:script has files to... (5 Replies)
Discussion started by: ketanraut
5 Replies

8. UNIX for Dummies Questions & Answers

I need a Script to read Log string and check date at the same time

I need to check 1 log file, which is logging: 2014-08-18T09:10:39+02:00 user: XXXXX START FEATURE 2014-08-18T09:10:39+02:00 user: XXXXX FINISH FEATURE I first need to check that the START FEATURE starts and finish on the same time/date for the same user, which is different each time START... (2 Replies)
Discussion started by: TheBest43
2 Replies

9. Shell Programming and Scripting

Script to check response time from nginx logs

Hi, My goal is to monitor the response time from the access logs of nginx server. I am using gawk to print the needed fields - 'response time' and 'name of the service' from nginx logs. Command: gawk '($6 ~ /cloudservice/) {print $10, $6}' access.log Output: 0.645 /nc/cloudservice... (6 Replies)
Discussion started by: nshah11
6 Replies

10. Shell Programming and Scripting

If I ran perl script again,old logs should move with today date and new logs should generate.

Appreciate help for the below issue. Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt.............. 1)if logs exist it should move the logs with extention... (1 Reply)
Discussion started by: Sanjeev G
1 Replies
Time(3pm)						  LogReport's Lire Documentation						 Time(3pm)

NAME
Lire::Time - parses and prints date in formats common to many log files. SYNOPSIS
use Lire::Time qw/ syslog2cal /; my @ltime = localtime; while ( <LOGFILE> ) { #... my $time = syslog2cal( $m, $d, $t, @ltime ); } DESCRIPTION
This module supplies many functions to parse dates in formats that you are likely to encounter in log files. It also offers many functions to format epoch time in useful format. NOTE ABOUT FUNCTION EXPORT Altough all documented functions are exported by default to the caller namespace, you should explicitely import the functions you require since exporting by default isn't recommanded by the perl modules guidelines. DATE PARSING FUNCTIONS
This module includes several functions that convert between a more human readable date format and UNIX epoch time. All parsing functions will return the number of seconds since Jan 1 1970 00:00:00 UTC and will die() when passed invalid arguments. date2cal() my $time = date2cal( $year, $month, $day, $time, [$timezone] ); my $time = date2cal( "2001 Mar 20 09:32:29 +0100" ); This function will convert a date in the date(1) default output format to UNIX epoch time. The function accepts either the date in a string or splitted on whitespace. If the timezone component is omitted, the local timezone is assumed (usually based on the value of the TZ environment variable). syslog2cal() my $time = syslog2cal( $month, $day, $time, $local_tm_ref ); my $time = syslog2cal( "Mar 11 13:21:00", $local_tm_ref ); This function will convert a date in the syslog default output format to UNIX epoch time. The function accepts either the date in a string or splitted on whitespace. Since the syslog format doesn't contain timezone information, the local timezone is assumed (usually determined by the TZ environment variable). The last argument is a reference to an array returned by localtime(). my $local_tm_ref = [localtime()]; It is used to determine the year. clf2cal() my $time = clf2cal( "[18/Mar/2001:15:59:30 +0100]" ); This function will convert a date as found in Common Log Format to UNIX epoch time. DATE FORMATING FUNCTIONS
This module includes some functions to convert date in UNIX epoch time to some more human readable output. All functions will die() when passed invalid arguments. cal2rfc() print cal2rfc( $time ); This function will convert a date in UNIX epoch time to the RFC822 format (used in email, for example). A RFC822 date looks like Wed, 30 May 2001 12:45:13 +0000 The timezone offset specification will correspond to the local timezone (usually determined by the TZ environment variable). cal2ymdhms() print cal2ymdhms( $time ); This function converts a date in UNIX epoch time to a string of the form: YYYYMMDDHHMMSS This representation will correspond the time in the local timezone (usually determined by the TZ environment variable.) getMonthName() print getMonthName( 0 ); # Gives 'Jan' This function takes as parameter a number (0-11) representing the month (as returned by localtime() for example) and will return the English abbreviated name of that month ( Jan, Feb, etc. ). AUTHOR
Joost van Baal <joostvb@logreport.org> VERSION
$Id: Time.pm,v 1.10 2006/07/23 13:16:30 vanbaal Exp $ COPYRIGHT
Copyright (C) 2000-2002 Stichting LogReport Foundation LogReport@LogReport.org This file is part of Lire. Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html. Lire 2.1.1 2006-07-23 Time(3pm)
All times are GMT -4. The time now is 11:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy