Sponsored Content
Operating Systems HP-UX Comparing the timestamp of the file to current time Post 302938948 by RudiC on Friday 20th of March 2015 07:39:43 AM
Old 03-20-2015
You don't need to create that file in the target dir, create it in your home dir. Or in /tmp.
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How can I create a file with current time - 60 minutes

I'm using k-shell in unix and I want to create a file with the current system time - 60 minutes. I know I can use touch to create the file, but I'm having trouble specifying how tell it to use the current time less 60 minutes. Any ideas??? (4 Replies)
Discussion started by: DaveyTN
4 Replies

2. UNIX for Dummies Questions & Answers

comparing timestamp of a file with its touched version

Hi, I'm new to unix,I wanna know how can I compare timestamp of a file with its touched version.i.e I want to be sure if the touch command has worked properly i.e if the file has been touched then a msg should be printed saying success else failure.All this to be incurred in a script. Any... (2 Replies)
Discussion started by: prince258
2 Replies

3. Shell Programming and Scripting

Reading Hours and Minutes from file and comparing with current

Hi, Time till when the application should run is indicated in a file. First line is hour and second line is minute. file: 10 55 Means my application should run till 10:55. Now in a shell script, i am trying to make that logic but with no luck. min=`tail -n 1 /file_with_time`... (1 Reply)
Discussion started by: SGD
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 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

5. 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

6. 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

7. 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

8. Shell Programming and Scripting

Based on the first & last timestamp of the file, need to calculate the time taken to complete

Below is the sample file: 287 DEBUG syndesis.pb.util.ITraceManager - syOID=ELntNetwork:1005Mon Oct 15 17:18:21 IST 2012 <ELClientManagerenEmsSession() > Setting Java Properties 287 DEBUG syndesis.pb.util.ITraceManager - syOID=ELntNetwork:1005Mon Oct 15 17:18:21 IST 2012... (1 Reply)
Discussion started by: ashok.kumar
1 Replies

9. Shell Programming and Scripting

To check timestamp in logfile and display lines upto 3 hours before current timestamp

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)
Discussion started by: srkmish
12 Replies

10. Shell Programming and Scripting

Grep lines between last hour timestamp and current timestamp

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
utc(1m) 																   utc(1m)

NAME
utc - A dcecp object that manipulates UTC timestamps SYNOPSIS
utc add timestamp relative_timestamp utc compare absolute_timestamp absolute_timestamp [-noinaccuracy] utc convert absolute_timestamp [-gmt] utc help [operation | -verbose] utc multiply relative_timestamp {integer | floating_point_factor} utc operations utc subtract timestamp timestamp ARGUMENTS
An International Organization for Standardization (ISO) compliant time format of the following form: CCYY-MMDD- hh:mm:ss.fff[+|-]hh:mmIsss.fff The Time Differential Factor (TDF) component [+|-]hh.mm, if present, indicates the offset from Universal Time Coordinated (UTC) time and implies local system time. The inaccuracy component Iss.fff, if present, specifies the duration of the time interval that contains the absolute time. A floating-point number such as 53.234. A whole number such as 79. The name of the utc operation for which to display help information. A Distributed Time Service (DTS) timestamp of the following form: [-]DD-hh:mm:ss.fff- Iss.fff Relative times often omit fractions of seconds (the leftmost .fff sequence) and generally lack an inaccuracy component (Iss.fff). For example, a relative time of 21 days, 8 hours, and 15 minutes is expressed as 21-08:15:00. A utc timestamp that can be a relative or absolute time. See the relative_timestamp and absolute_timestamp argument descriptions for the format of these timestamps. DESCRIPTION
The utc object lets you add, compare, and convert timestamps in DTS and ISO formats. OPERATIONS
utc add Adds two timestamps. The syntax is as follows: utc add timestamp relative_timestamp The add operation returns the sum of two timestamps. The timestamps can be two relative times or an absolute time and a relative time. Privileges Required No special privileges are needed to use the utc add command. Examples dcecp> utc add 1994-10-18-13:21:50.419-04:00I----- +0-00:02:00.000I----- 1994-10-18-13:23:50.419-04:00I----- dcecp> utc compare Compares two absolute timestamps indicating the temporal order. The syntax is as follows: utc compare absolute_timestamp absolute_time- stamp [-noinaccuracy] The compare operation compares two timestamps and returns -1 if the first is earlier, 1 if the second is earlier, and 0 if the difference is indeterminate. Specify the -noinaccuracy option to ignore inaccuracies in comparisons; in this case a return of 0 indicates the times are the same. Privileges Required No special privileges are needed to use the utc compare command. Examples dcecp> utc compare 1994-10-18-13:22:32.816-04:00I----- > 1994-10-18-13:21:50.419-04:00I----- -noinaccuracy 1 dcecp> utc convert Converts a timestamp from UTC to local time. The syntax is as follows: utc convert absolute_timestamp [-gmt] The convert operation accepts a timestamp and returns another timestamp that expresses the same time in the local time zone. If called with the -gmt option it returns a Greenwich mean time (GMT) formatted timestamp. Privileges Required No special privileges are needed to use the utc convert command. Examples dcecp> utc convert 1994-10-18-13:22:32.816-00:00I----- 1994-10-18-09:22:32.816-04:00I----- dcecp> dcecp> utc convert 1994-10-18-13:22:32.816-00:00I----- -gmt 1994-10-18-13:22:32.816I----- dcecp> utc help Returns help information about the utc object and its operations. The syntax is as follows: utc help [operation | -verbose] Options Displays information about the utc object. Used without an argument or option, the utc help command returns brief information about each utc operation. The optional operation argu- ment is the name of an operation about which you want detailed information. Alternatively, you can use the -verbose option for more detailed information about the utc object itself. Privileges Required No special privileges are needed to use the utc help command. Examples dcecp> utc help add Adds a relative and absolute, or two relative, timestamps. compare Compares two timestamps to determine which is earlier. convert Converts a timestamp into the local timezone or GMT. multiply Multiplies a relative timestamp by a number. subtract Returns the difference between two timestamps. help Prints a summary of command-line options. operations Returns a list of the valid operations for this command. dcecp> utc multiply Multiplies a relative time (a length of time) by an integer or floating-point factor. The syntax is as follows: utc multiply rela- tive_timestamp {integer | floating_point_factor} The multiply operation accepts two arguments: a relative timestamp and an integer or floating-point factor. It multiplies the length of time (specified by the relative timestamp) by the integer or floating-point factor, returning the product as a relative timestamp. Privileges Required No special privileges are needed to use the utc multiply command. Examples dcecp> utc multiply +0-00:00:05.000I----- 3 +0-00:00:15.000I----- dcecp> utc operations Returns a list of the operations supported by the utc object. The syntax is as follows: utc operations The list of available operations is in alphabetical order except for help and operations, which are listed last. Privileges Required No special privileges are needed to use the utc operations command. Examples dcecp> utc operations add compare convert multiply subtract help operations dcecp> utc subtract Subtracts one timestamp from another, returning the difference as a relative timestamp. The syntax is as follows: utc subtract timestamp timestamp The subtract operation returns the difference between two timestamps that express either an absolute time and a relative time, two relative times, or two absolute times. Subtracting an absolute timestamp from a relative timestamp, however, is not allowed. The return value is an absolute or relative timestamp, depending on how the command is used. Privileges Required No special privileges are needed to use the utc subtract command. Examples dcecp> utc subtract 1994-10-18-13:22:32.816-00:00I----- +0-00:00:15.000I----- 1994-10-18-13:22:17.816+00:00I----- dcecp> RELATED INFORMATION
Commands: dcecp(1m), dcecp_clock(1m), dcecp_dts(1m), dtsd(1m). utc(1m)
All times are GMT -4. The time now is 10:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy