Sponsored Content
Top Forums Shell Programming and Scripting How to compare the mtime of a file with the current time? Post 302277965 by mehrdad68 on Monday 19th of January 2009 02:02:20 AM
Old 01-19-2009
Hi,
This script find file less then 24 hour and delete them:

#!/bin/bash
find /export/home/urpath * -type f -mtime -24 -exec rm {}

Mehrdad
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

to compare latest logfile with the current running time of the script

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)
Discussion started by: mail2sant
0 Replies

2. Shell Programming and Scripting

to write a script to compare the file size in the current directory and previous dir

hi, i am new to this site. i want to write a script to compare the file size of the files in the current dir with the files in the previous directory. the files name will be same, but the filename format will be as xyzddddyymm.txt. the files will arrive with the month end date(i want to... (5 Replies)
Discussion started by: tweety
5 Replies

3. AIX

how to grep and compare timestamp in a file with the current date

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)
Discussion started by: achu
1 Replies

4. AIX

how to grep and compare timestamp in a file with the current date

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)
Discussion started by: achu
1 Replies

5. Shell Programming and Scripting

Compare file timestamp with current date. Diff must be 1 hour.

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)
Discussion started by: taipan
3 Replies

6. Shell Programming and Scripting

Compare current time to timestamp on a file

I'm trying to compare 2 dates between current time and the timestamp on a file. The date format is mmdd Both return Apr 1 but when using if statement line 11: Apr 1: command not found error is returned #!/bin/sh log="DateLog" Current_Date=`date +%b%e` Filepmdate=`ls -l /file.txt |... (1 Reply)
Discussion started by: cillmor
1 Replies

7. UNIX for Dummies Questions & Answers

How to compare current time with the input to variant?

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)
Discussion started by: axn_boy
3 Replies

8. Shell Programming and Scripting

How do i find a file with the current time stamp in it??

I want to find a file using find or any utility having the current date time stamp..... I have an alternate way to do that.... but that is too way out of logic... so looking out something with find itself (5 Replies)
Discussion started by: nikhil jain
5 Replies

9. UNIX for Advanced & Expert Users

Need mtime with time stamp

hi all find /folder1 -mtime 1 >folder1 with the above command , I can get the output of all the files which are modified(within folders and sub folders of folder1) in the last 24 hours. but the listed files output , does not contain the time stamp with it. I request you to give... (4 Replies)
Discussion started by: sidharthmellam
4 Replies

10. HP-UX

Comparing the timestamp of the file to current time

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)
Discussion started by: haadiya
7 Replies
TM::ResourceAble(3pm)					User Contributed Perl Documentation				     TM::ResourceAble(3pm)

NAME
TM::ResourceAble - Topic Maps, abstract trait for resource-backed Topic Maps SYNOPSIS
package MyNiftyMap; use TM; use base qw(TM); use Class::Trait ('TM::ResourceAble'); 1; my $tm = new MyNiftyMap; $tm->url ('http://nirvana/'); warn $tm->mtime; # or at runtime even: use TM; Class::Trait->apply ('TM', qw(TM::ResourceAble)); my $tm = new TM; warn $tm->mtime; DESCRIPTION
This traits adds methods to provide the role resource to a map. That allows a map to be associated with a resource which is addressed by a URL (actually a URI for that matter). Predefined URIs The following resources, actually their URIs are predefined: "io:stdin" Symbolizes the UNIX STDIN file descriptor. The resource is all text content coming from this file. "io:stdout" Symbolizes the UNIX STDOUT file descriptor. "null:" Symbolizes a resource which never delivers any content and which can consume any content silently (like "/dev/null" under UNIX). Predefined URI Methods "inline" An inlined resource is a resource which contains all content as part of the URI. Currently the TM content is to be written in AsTMa=. Example: inlined:donald (duck) INTERFACE
Methods url $url = $tm->url $tm->url ($url) Once an object of this class is instantiated it keeps the URL of the resource to which it is associated. With this method you can retrieve and set that. No special further action is taken otherwise. mtime $time = $tm->mtime This function returns the UNIX time when the resource has been modified last. 0 is returned if the result cannot be determined. All methods from LWP are supported. Special resources are treated as follows: "null:" always has mtime 0 "io:stdin" always has an mtime 1 second in the future. The idea is that STDIN always has new content. "io:stdout" always has mtime 0. The idea is that STDOUT never changes by itself. SEE ALSO
TM AUTHOR INFORMATION
Copyright 200[67], Robert Barta <drrho@cpan.org>, All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. http://www.perl.com/perl/misc/Artistic.html perl v5.10.1 2010-08-04 TM::ResourceAble(3pm)
All times are GMT -4. The time now is 07:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy