Parsing the date output


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Parsing the date output
# 1  
Old 05-27-2011
Parsing the date output

Hi fellows,
I need to define a notification for SSL certificate expiration.

My Command output is below: (this is the "Expiration Date")
Tue Mar 15 09:30:01 2012

So, at 15th Feb (1 month before the expiration), a notification has to be triggered by a script or sth else. How can i set an alert? The key point is manipulating the date part Smilie
# 2  
Old 05-27-2011
you can have crontab

you can have crontab entry for one month interval and it will remaind you by send mail to your mail id.
# 3  
Old 05-27-2011
on which plateform are you ?
# 4  
Old 05-27-2011
Am working in message Queueing(IBM MQ)

Am working in message Queueing(IBM MQ) and i write some script to automate the process in my work...The crontab will run every month on 15th and you will get remainder mail.


0 0 15 * * /home/your_script.ksh


The script should have below code:

echo -e "Hello,/n/nTime to renew your SSL certificate\n\nThanks,\nyour_name" | mail -s "SSL certificate" your_mailID@yyy.xxxx
# 5  
Old 05-27-2011
System is Solaris.
Actually, what i am trying to do is develope a script which is integrated with HP Openview. Notification part is easy, i can handle that by using sendmail. However, i don't know how to parse the date in config file in order to see what the date is; Because i have to compare actual date with SSL Certificate's expiration date.
# 6  
Old 05-27-2011
One idea: if you have access to a database (Sybase or Oracle) they have good functions for manipulating dates and comparing dates.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Really need some help with Parsing files by date

Hi, I am new to Unix and need some help with a problem I have. I have been asked to ftp a file(s) from a directory to another system. I need to be able to allow the current days file to build and only send any other file across that is in the directory. I need a peice of code that will read... (3 Replies)
Discussion started by: darrenwg99
3 Replies

2. Shell Programming and Scripting

New to UNIX ... Date parsing

Hi ... extremely new to Unix scripting ... I have to get a date field from mm/dd/yyyy to yyyy/mm/dd format ... I have a variable that I want parsed. I don't seem to be doing it right?? Thanks. (19 Replies)
Discussion started by: MJKeeble
19 Replies

3. Shell Programming and Scripting

Parsing of TOP output

Hi , i am trying to set up an alert, when CPU usage (0.2%us in below output) is more than 40% top | head | grep '^Cpu' Cpu(s): 0.2%us, 0.2%sy, 0.0%ni, 99.1%id, 0.6%wa, 0.0%hi, 0.0%si, 0.0%st using CUT, i pulled the value 0.2 and assigned to CPU (variable) CPU=$(expr `top | head -10... (5 Replies)
Discussion started by: Prateek007
5 Replies

4. UNIX for Dummies Questions & Answers

Comparing Output Date to Current System Date

Hi Guys, Anyone who knows how to compare the current date with the a file containing a date, say for example I have a file that looks like this: Command was launched from partition 0. ------------------------------------------------ Executing command in server server6 Fri Dec 16... (7 Replies)
Discussion started by: rymnd_12345
7 Replies

5. Shell Programming and Scripting

parsing output

Can somebody provide a solution to parse the following; cat /tmp/xxx Name: QUE_REQU (o.mtaseast-o.dmart) (MTPost queue) Number of messages: 66446 (Age 686 min; Size 214 mb) Backlog (messages): 0 (Age 0 min) Name: QUE_REQU... (6 Replies)
Discussion started by: BeefStu
6 Replies

6. Shell Programming and Scripting

parsing output of system()

Hi, From the above output of df command I need to parse only 43G (available space) and display it. root@localhost:> df -h /vol1/joy Filesystem Size Used Avail Capacity Mounted on /vol1/joy 180G 137G 43G 76% ... (3 Replies)
Discussion started by: cjjoy
3 Replies

7. UNIX for Dummies Questions & Answers

Parsing Date to a file name

Hi All There is a file "apple_2008-08-15.log". I have to use grep on this file to collect my test log. There are 45 such files. Is there a command that I can use to dynamically substitute the daily date as part of the file name? As of now Iam renaming the file to the new date and running my... (6 Replies)
Discussion started by: pk_eee
6 Replies

8. Shell Programming and Scripting

Parsing output

I need to parse the following out put and determine if the USB is a DISK and whether or not it's External. If an HBA line contains "USB" then does the next line contain "DISK" and "External". 0:0,31,0: HBA : (aacraid,1) AAC SCSI 0,0,0: DISK : Adaptec ASR4800SAS Volu0001 ... (6 Replies)
Discussion started by: lochraven
6 Replies

9. Shell Programming and Scripting

parsing output

I have a file that contains the output of the ls -iR command, something like this: ./results: 2504641011 result_1410 2500957642 result_525 2504641012 result_1425 2500957643 result_540 ./tests/1: 2500788755 1 2500788743 1000 ./tests/2: 2500788759 3 2500788758 999 ... (6 Replies)
Discussion started by: looza
6 Replies

10. Shell Programming and Scripting

Date parsing into string, help!

I have a file that was created yesterday that I want to access... daily.log2008-02-16 I am using... curr_time=`date +"%Y %m %d"` yesterday=`./datecalc.ksh -a $curr_time - 1` the value for yesterday is now "2008 2 16" in ksh, how do I transform the string "2008 2 16" into "2008-02-16" (5 Replies)
Discussion started by: martyb555
5 Replies
Login or Register to Ask a Question