I'm trying to create a script using awk and if that will list all of our aws tapes that have archived date that is past 90 days from todays current date, so that I can pass that to my aws command to remove.
The fifth column is the creation date in epoch/seconds, so I'm trying to compare that with todays date minus 90 days, in seconds.
Without listing all of my tapes, I'll give a few example lines that aws storagegateway describe-tape-archives spits out
And then here's the command that I'm actually trying to use
I was also trying this but getting the same results
This should just return the WEEK587EF9 line, but instead it's returning both lines. I'm a little new to awk so I'm not sure if i have my comparisons messed up, or maybe I should be using another command.
Last edited by Scrutinizer; 01-06-2020 at 02:51 PM..
Reason: Code tags for input sample
I have below txt file
02.05.2014
10.05.2014
17.09.2014
My requirement is the user enter date field should compare the input file
if user enter date as 12.03.2013 it should compare with all date one by one from input file
12.03.2013 -ne 02.05.2014
12.03.2013 -ne 10.05.2014... (3 Replies)
Hi
Need some function or step to compare the date as given below.
Example:
Date_1: 25/04/2013
Date_2: 20/07/2012
if Date_1 is greater than Date_2 then
do...
else
do..
fi
Need exact unix steps to compare the above condition
Use code tags please, see PM. (5 Replies)
hi,
I have a file named user.cfg under /var/member/
#user.cfg file under /var/member/
login user: root #how are you
login pass: admin #where are you
M: user1 pass1 #20121008
M: user2 pass2 #20111230
M: user3 pass3 #20091220
M: user4 pass4 #20070210
M: user5 pass5 #20130708
M:... (3 Replies)
Hi friends,
I would like to compare two dates in an IF statement.
This is what I am trying, but it doesn't work.
date=20120122
minus=6
if ; then
...
fi
what would the IF clause looks like?
Thanks! :) (5 Replies)
Date comparison
Hello all
I am writing a scrip that will take action so long as the date with in the file is older than 3 months. The file will contain multiple rows of data. Each row will probably start with the date. My question... What is the exact code that should be used for date... (1 Reply)
1. The problem statement, all variables and given/known data:
I have standard web server log file. It contains different columns (like IP address, request result code, request type etc) including a date column with the format .
I have developed a log analysis command line utility that displays... (1 Reply)
Hi
I have this simple script:
#!/bin/bash
date1=2009:07:15:12:36
date2=2009:07:15:12:16
echo $date1
echo $date2
datediff=
#datediff=date1-date2
echo datediff is$datediff
How do i return the difference in seconds? (6 Replies)
Hi all,
I've a shell script which runs on Bourne shell. I've to do a date comparison. If the value of the supplied parameter(in format YYYYMMDD)is greater than todays's date(format YYYYMMDD), it should prompt the user that the supplied date is greater than today's date. The script is given... (6 Replies)