Sponsored Content
Top Forums Shell Programming and Scripting need help in time manipulation Post 302174096 by manas_ranjan on Monday 10th of March 2008 04:56:20 AM
Old 03-10-2008
Quote:
Originally Posted by ali560045
i have a script that gives the last time the data is inserted in a file. i want to check the time difference b/w the sytem time and the time in file.

for e,g.

if script runs at 3.30
and the time in file is 3.00

then the time difference should be 30 min......


-------------------------------------------------

#!/bin/ksh

a=`date +"%H:%M"`
cd /ednadtu3/u01/pipe/logs

Time=`ls -ltr File1.log | tr -s " " | cut -d " " -f8`

if [ $time < 30 ]
then
echo "it is not processing data"
else
echo "it is processing data"
fi
--------------------------------------------------------------

plz help me in this
Please clarify above DarkRed variables....
 

9 More Discussions You Might Find Interesting

1. Programming

Time/date manipulation

hey folks, been awhile (actaully a long while) since i last touched C. And the 3 books i've read don't really have much about using time.h Question: How would i be able to assign a variable the value of the current date minus 2 mths, keeping in mind the yr. IE. would like to see Nov.31/2001... (1 Reply)
Discussion started by: choice
1 Replies

2. UNIX for Advanced & Expert Users

How To Provide Time Sync Using Nts-150 Time Server On Unix Network?

can anybody tel lme,how to instal NTS -150 on a unix network,it needs some patch to fetch time frm serve,,?? (2 Replies)
Discussion started by: pesty
2 Replies

3. Shell Programming and Scripting

Files manipulation with time comparison

Hi guys - I am new to Unix and learning some basics. I have to create a report of files that are in a specific directory and I have to list filenames with specific titles. This report will be created everyday early in the morning, say at 05:00 AM. (see output file format below) The 2 categories... (2 Replies)
Discussion started by: sksahu
2 Replies

4. Shell Programming and Scripting

Convert Epoch Time to Standard Date and Time & Vice Versa

Hi guys, I know that this topic has been discuss numerous times, and I have search the net and this forum for it. However, non able to address the problem I faced so far. I am on Solaris Platform and unable to install additional packages like the GNU date and gawk to make use of their... (5 Replies)
Discussion started by: DrivesMeCrazy
5 Replies

5. Shell Programming and Scripting

Time Manipulation in shell script

Hi all, I have a script that requires time comparisons and sending out an email alert only if the specified interval has been completed. The script runs in Cron tab every 5 mins. For ex: If the interval is set to 2 hrs (Dynamic & varies ) My script should execute and if it finds any error... (1 Reply)
Discussion started by: praseecg
1 Replies

6. Solaris

modifying date and time and time zone on solaris 5.10 with (redundant server) veritas

I have a cluster of two Solaris server (veritas cluster). one working and the other is standby I am going to change the date on them , and am looking for a secure solution as it is giving an important service. my opinion is that the active one doesn't need to be restarted (if I don't change the... (1 Reply)
Discussion started by: barry1946
1 Replies

7. Shell Programming and Scripting

Convert UTC time into current UNIX sever time zone

Hi guys thanks for the help for my previous posts.Now i have a requirement that i download a XMl file which has UTC time stamp.I need to convert UTC time into Unix server timezone. For ex if the time zone of unix server is CDT then i need to convert into CDT.whatever may be the system time... (5 Replies)
Discussion started by: mohanalakshmi
5 Replies

8. Programming

Find gaps in time data and replace missing time value and column 2 value by interpolation in awk

Dear all, I am kindly seeking assistance on the following issue. I am working with data that is sampled every 0.05 hours (that is 3 minutes intervals) here is a sample data from the file 5.00000 15.5030 5.05000 15.6680 5.10000 16.0100 5.15000 16.3450 5.20000 16.7120 5.25000... (4 Replies)
Discussion started by: malandisa
4 Replies

9. Shell Programming and Scripting

Calculate Time diff in milli milliseconds(Time format : HH:MM:SS,NNN)

Hi All, I have one file which contains time for request and response. I want to calculate time difference in milliseconds for each line. This file can contain 10K lines. Sample file with 4 lines. for first line. Request Time: 15:23:45,255 Response Time: 15:23:45,258 Time diff... (6 Replies)
Discussion started by: Raza Ali
6 Replies
STAP(1) 						      General Commands Manual							   STAP(1)

NAME
stapgraph - systemtap grapher SYNOPSIS
stapgraph [ OPTIONS ] FILENAME [ ARGUMENTS ] stapgraph [ OPTIONS ] - [ ARGUMENTS ] stapgraph [ OPTIONS ] -e SCRIPT [ ARGUMENTS ] DESCRIPTION
The stapgraph program is a simple frontend to stap that produces graphs from the output of stap scripts. This manual corresponds to version 1.7. OPTIONS
stapgraph accepts all options accepted by stap. They are passed through to the stap process running the script or probe points. USER INTERFACE
The script that produces results can be started from a dialog within the program, in addition to being launched using the program's command line arguments. This dialog allows arguments to be passed to stap and to the script. When running, a mouse left click on a graph pauses the display of data, even though it is still collected by the program. Dragging the mouse scrolls the graph backwards and forwards in time; clicking the displayed pause button restarts the display of new data. The scroll wheel can be used to zoom in and out on the graph. SCRIPT OUTPUT SYNTAX
Scripts can output Comma Separated Values (CSV) which will be interpreted by stapgraph. The first value is the X coordinate of the graph, usually a time value. stapgraph assumes that this value is constantly increasing. A different syntax allows the script to specify many details of the graph's appearance. %DataSet: DATA-SET-NAME SCALE COLOR GRAPHSTYLE The data set name identifies a data set that will be emitted by the script. "SCALE" is the overall vertical scale of the graph for this data set. "COLOR" is a red-green-blue hex color. "GRAPHSTYLE" is one of bar - a traditional bar graph dot - plotted points discreet - An event style timeline that records that an event happened at a certain time. %Title: TITLE A title for the whole graph. %XAxisTitle: TITLE The legend for the X axis %YAxisTitle: TITLE The legend for the Y axis. %YMax: MAX VALUE The maximum value displayed on the graph. GRAPH DATA
DATA SET TIME VALUE Each data point that is to be plotted is tagged with the data set name, followed by the time and value of the point. SEE ALSO
stap(3stap), staprun(3stap), BUGS
Use the Bugzilla link off of the project web page or our mailing list. http://sourceware.org/systemtap/,<systemtap@sourceware.org>. Red Hat 2013-05-14 STAP(1)
All times are GMT -4. The time now is 01:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy