how can i compare the latest log file with the current time..
consider i am running a script "a.sh" at 09:00
( function of the script a.sh is to update the database )
this script is going to create logfile if the script is sucess
in case of failure it is not going to create logfile..
... (0 Replies)
Hi, I wondered if we could do this with shell script?
How to compare the mtime of a file with the current time and check whether its less than 24 hours.
Thanks.:b: (2 Replies)
I want to read a log file from a particular location.In the logfile , lines contains timestamp.I need to compare the timestamp in the logfile with the current date.If the timpestamp in the log file is less than 4 hours then i need to read the file from that location.Below is the file format.Please... (1 Reply)
I want to read a log file from a particular location.In the log file each line starts with timestamp.I need to compare the timestamp in the logfile with the current date.If the timpestamp in the log file is less than 4 hours then i need to read the file from that location.Below is the file... (1 Reply)
Hello,
I've created the script below to compare the content of two files with a delay of an hour. After an hour, the lines that exist in both files, will be printed and executed.
The script now uses a counter to countdown 50 minutes. But what I would prefer is to check the file timestamp of... (3 Replies)
Hi all,
I have a simple script follow:
-------------
#!/bin/bash
echo -n " Enter the date of today: "
read dateoftoday
-------------
Now I want to compare the variant $dateoftoday with date of the system (now) in order to prevent user inputs the past date to $dateoftoday. I want to make... (3 Replies)
Hi All,
I am new to unix programming. I am trying for a requirement and the requirement goes like this.....
I have a test folder. Which tracks log files. After certain time, the log file is getting overwritten by another file (randomly as the time interval is not periodic). I need to preserve... (2 Replies)
Hi Friends,
I have the following logfile. Currently time in india is 07/31/2014 12:33:34 and i have the following content in logfile. I want to display only those entries which contain string 'Exception' within last 3 hours. In this case, it would be the last line only
I can get the... (12 Replies)
I have a file like this
-rwxr-xr-x 1 rewq other 168 Jan 13 07:05 check_files.sh
I want to compare (check_files.sh time) with the current time to see if its is older than 2 hours or not
if it is not older than 2 hrs then do something.can someone help me on this?.I dont... (7 Replies)
So basically I have a log file and each line in this log file starts with a timestamp:
MON DD HH:MM:SS
SEP 15 07:30:01
I need to grep all the lines between last hour timestamp and current timestamp. Then these lines will be moved to a tmp file from which I will grep for particular strings. ... (1 Reply)
Discussion started by: nms
1 Replies
LEARN ABOUT DEBIAN
data::formvalidator::constraints::dates
Data::FormValidator::Constraints::Dates(3pm) User Contributed Perl Documentation Data::FormValidator::Constraints::Dates(3pm)NAME
Data::FormValidator::Constraints::Dates - Validate Dates and Times
SYNOPSIS
use Data::FormValidator::Constraints::Dates qw(date_and_time);
# In a DFV profile...
constraint_methods => {
# 'pp' denotes AM|PM for 12 hour representation
my_time_field => date_and_time('MM/DD/YYYY hh:mm:ss pp'),
}
DESCRIPTION
date_and_time
Note: This is a new module is a new addition to Data::FormValidator and is should be considered "Beta".
This constraint creates a regular expression based on the format string passed in to validate your date against. It understands the
following symbols:
Y year (numeric)
M month (numeric)
D day (numeric)
h hour
m minute
s second
p AM|PM
Other parts of the string become part of the regular expression, so you can do perlish things like this to create more complex expressions:
'MM?/DD?/YYYY|YYYY-MM?-DD?'
Internally Date::Calc is used to test the functions.
BACKWARDS COMPATIBILITY
This older, more awkward interface is supported:
# In a Data::FormValidator Profile:
validator_packages => [qw(Data::FormValidator::Constraints::Dates)],
constraints => {
date_and_time_field => {
constraint_method => 'date_and_time',
params=>['MM/DD/YYYY hh:mm:ss pp'], # 'pp' denotes AM|PM for 12 hour representation
},
}
SEE ALSO
o Data::FormValidator
o Data::FormValidator::Constraints::DateTime - This alternative features returning dates as DateTime objects and validating against the
date formats required for the MySQL and PostgreSQL databases.
AUTHOR
Mark Stosberg, <mark@summersault.com>
Featuring clever code by Jan Krynicky.
COPYRIGHT AND LICENSE
Copyright 2003-2005 by Mark Stosberg
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2011-11-25 Data::FormValidator::Constraints::Dates(3pm)