Sponsored Content
Top Forums UNIX for Advanced & Expert Users Subtract millisecond Timestamps with awk Post 303025077 by sidnow on Tuesday 23rd of October 2018 05:00:54 PM
Old 10-23-2018
How should I do that? With the date command? The timestamps wont cross midnight, it begins from midnight until 23:59:59.xxx
 

10 More Discussions You Might Find Interesting

1. Programming

Help! Display Time with Millisecond

Hi All, Urgent! Just a newbie needing advice. Has anybody have a sample C script code in Unix to display time with milliseconds? Most of the research I'm doing is up to the seconds format only. Thanks! Leidail (3 Replies)
Discussion started by: rezlez
3 Replies

2. Shell Programming and Scripting

How to find date Difference in AWK/GAWK with millisecond precision

Hi, I have a log file that has the date in this format "2006-05-30_13:14:04,256". I need to find the time difference between two log entries in milliseconds. How to achieve this in AWK/GAWK script? :confused: (2 Replies)
Discussion started by: omprasad
2 Replies

3. Shell Programming and Scripting

AWK solution to subtract multiple columns of numbers

Hope somebody is happy. NR==1 { num_columns=split( $0, menuend ); next; } { split( $0, substrend ); for ( i=1; i<=NF; i++ ) { minuend -= substrend; } } END { print "Result:"; for ( i=1; i<=num_columns; i++ ) { printf(... (3 Replies)
Discussion started by: awkward
3 Replies

4. Shell Programming and Scripting

add and subtract specific row using awk

Hi Folks I have tried awk command to conditionally add or subtract value from specific row in a file. The test file looks like: # cat test.txt cont x y Max 0.3 0.9 Min 0.2 0.9 diff 0.1 0 # awk '{for (i=2; i <=NF; i++) if ($i== "0") $i=$i+0.2; print}' test.txt Output: cont... (1 Reply)
Discussion started by: dixits
1 Replies

5. Shell Programming and Scripting

Get timestamp with millisecond precision

Hi All, could any body let me know. how to get timestamp with millisecond precision in unix bash shell. example -->2005-12-06- 4-22-35-195 please help me. Thanks, Krupa:wall: (3 Replies)
Discussion started by: krupasindhu18
3 Replies

6. Shell Programming and Scripting

Compare & subtract lines in files by column using awk.

I have two files with similar column pattern as given below : 2 sample lines from file1 are given below. 18 12630 . G T 49.97 . AC=2;AF=1.00;AN=2;DP=3;Dels=0.00;FS=0.000;HRun=0;HaplotypeScore=0.0000;MQ=60.00;MQ0=0;NDA=1;QD=16.66;SB=-0.01 GT:AD:DP:GQ:PL ... (2 Replies)
Discussion started by: vaibhavvsk
2 Replies

7. Shell Programming and Scripting

To print lines between 2 timestamps using awk|sed and regex

Hi, I am using the following code to fetch lines that are generated in last 1 hr . Hence, I am using date function to calculate -last 1 hr & the current hr and then somehow use awk (or sed-if someone could guide me better) with some regex pattern. dt_1=`date +%h" "%d", "%Y\ %l -d "1 hour... (10 Replies)
Discussion started by: sarah-alikhan31
10 Replies

8. UNIX for Dummies Questions & Answers

awk to add/subtract an integer to/from each entry in columns?

---------- Post updated at 01:58 PM ---------- Previous update was at 01:48 PM ---------- For some reason my question is not getting printed. Here are the details: Greetings. I would like to add/subtact an integer to/from two columns of integers. I feel like this should be easy using awk... (3 Replies)
Discussion started by: Twinklefingers
3 Replies

9. Shell Programming and Scripting

awk to subtract from values in file

data.txt: 0,mq_conn_open_error,1444665949,734,/PROD/G/cicsitlp/sys/unikixmain.log,64K,mq_conn_open_error,62022,0,733--734 0,mq_conn_open_error,1444666249,734,/PROD/G/cicsitlp/sys/unikixmain.log,64K,mq_conn_open_error,62022,0,734--734... (7 Replies)
Discussion started by: SkySmart
7 Replies

10. HP-UX

awk command in hp UNIX subtract 30 days automatically from current date without date illegal option

current date command runs well awk -v t="$(date +%Y-%m-%d)" -F "'" '$1 < t' myname.dat subtract 30 days fails awk -v t="$(date --date="-30days" +%Y-%m-%d)" -F "'" '$1 < t' myname.dat awk command in hp unix subtract 30 days automatically from current date without date illegal option error... (20 Replies)
Discussion started by: kmarcus
20 Replies
BACKUP_DELETEDUMP(8)					       AFS Command Reference					      BACKUP_DELETEDUMP(8)

NAME
backup_deletedump - Deletes one or more dump records from the Backup Database SYNOPSIS
backup deletedump [-dumpid <dump id>+] [-from <date time>+] [-to <date time>+] [-port <TC port offset>] [-groupid <group ID>] [-dbonly] [-force] [-noexecute] [-localauth] [-cell <cell name>] [-help] backup dele [-d <dump id>+] [-fr <date time>+] [-t <date time>+] [-p <TC port offset>] [-g <group ID>] [-db] [-fo] [-n] [-l] [-c <cell name>] [-h] DESCRIPTION
The backup deletedump command deletes one or more dump records from the Backup Database. Either use the -dumpid argument to specify the dump ID number of one or more dumps, or use the -from and -to arguments to delete the records for all regular dumps created during the time period bracketed by the specified values. Use this command to remove dump records that are incorrect (possibly because a dump operation was interrupted or failed), or that correspond to dumps that are expired or otherwise no longer needed. CAUTIONS
The only way to remove the dump record for an appended dump is to remove the record for its initial dump, and doing so removes the records for all of the initial dump's associated appended dumps. The only way to remove the record for a Backup Database dump (created with the backup savedb command) is to specify its dump ID number with the -dumpid argument. Using the -from and -to arguments never removes database dump records. Removing records of a dump makes it impossible to restore data from the corresponding tapes or from any dump that refers to the deleted dump as its parent, directly or indirectly. That is, restore operations must begin with the full dump and continue with each incremental dump in order. If the records for a specific dump are removed, it is not possible to restore data from later incremental dumps unless the deleted records are restored by running the backup scantape command with the -dbadd flag. If a dump set contains any dumps that were created outside the time range specified by the -from and -to arguments, the command does not delete any of the records associated with the dump set, even if some of them represent dumps created during the time range. OPTIONS
-dumpid <dump id>+ Specifies the dump ID of each dump record to delete. The corresponding dumps must be initial dumps; it is not possible to delete appended dump records directly, but only by deleting the record of their associated initial dump. Using this argument is the only way to delete records of Backup Database dumps (created with the backup savedb command). Provide either this argument or the -to (and optionally -from) argument. -from <date time>+ Specifies the beginning of a range of dates; the record for any dump created during the indicated period of time is deleted. Omit this argument to indicate the default of midnight (00:00 hours) on 1 January 1970 (UNIX time zero), or provide a date value in the format mm/dd/yyyy [hh:MM]. The month (mm), day (dd), and year (yyyy) are required. The hour and minutes (hh:MM) are optional, but if provided must be in 24-hour format (for example, the value "14:36" represents 2:36 p.m.). If omitted, the time defaults to midnight (00:00 hours). The -to argument must be provided along with this one. -to <date time>+ Specifies the end of a range of dates; the record of any dump created during the range is deleted from the Backup Database. Provide either the value "NOW" to indicate the current date and time, or a date value in the same format as for the -from argument. Valid values for the year (yyyy) range from 1970 to 2037; higher values are not valid because the latest possible date in the standard UNIX representation is in February 2038. The command interpreter automatically reduces any later date to the maximum value. If the time portion (hh:MM) is omitted, it defaults to 59 seconds after midnight (00:00:59 hours). Similarly, the backup command interpreter automatically adds 59 seconds to any time value provided. In both cases, adding 59 seconds compensates for how the Backup Database and backup dumpinfo command represent dump creation times in hours and minutes only. For example, the Database records a creation timestamp of "20:55" for any dump operation that begins between 20:55:00 and 20:55:59. Automatically adding 59 seconds to a time thus includes the records for all dumps created during that minute. Provide either this argument, or the -dumpid argument. This argument is required if the -from argument is provided. Caution: Specifying the value "NOW" for this argument when the -from argument is omitted deletes all dump records from the Backup Database (except for Backup Database dump records created with the backup savedb command). -localauth Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. The backup command interpreter presents it to the Backup Server, Volume Server and VL Server during mutual authentication. Do not combine this flag with the -cell argument. For more details, see backup(8). -cell <cell name> Names the cell in which to run the command. Do not combine this argument with the -localauth flag. For more details, see backup(8). -help Prints the online help for this command. All other valid options are ignored. OUTPUT
At the conclusion of processing, the output lists the dump IDs of all dump records deleted in the following format: The following dumps were deleted: dump ID 1 dump ID 2 etc. EXAMPLES
The following command deletes the dump record with dump ID 653777462, and for any appended dumps associated with it: % backup deletedump -dumpid 653777462 The following dumps were deleted: 653777462 The following command deletes the Backup Database record of all dumps created between midnight on 1 January 1997 and 23:59:59 hours on 31 December 1997: % backup deletedump -from 01/01/1997 -to 12/31/1997 The following dumps were deleted: 598324045 598346873 ... ... 653777523 653779648 PRIVILEGE REQUIRED
The issuer must be listed in the /etc/openafs/server/UserList file on every machine where the Backup Server is running, or must be logged onto a server machine as the local superuser "root" if the -localauth flag is included. SEE ALSO
backup(8), backup_dumpinfo(8), backup_scantape(8) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 BACKUP_DELETEDUMP(8)
All times are GMT -4. The time now is 09:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy