I wrote code to read a file text with contents of expiration dates and products. The products expire in thirty days and each day an email message is send as a reminder of the number of days left before the license expires.
The code generates errors when executed .
Here is part of the code. Please see attachment:
Code:
# Convert date to check in seconds
current_date='date "+%s"'
#foo5.txt
expires=' /path/to/ foo5.txt
-noout -enddate | grep | awk '{print $1, $2, $3}''date_to_check=date -d | awk -v expires="$expires" '{print $2 expires}'expires "+%s"'#calculate the datediffdatediff='expr $date_to_check - $current_date'#30 days left - send email: 30 days in seconds(2592000)
if [ 'expr $date_diff - 2592000' -gt 0 ]
then
echo | awk expires="$expires"'{print "30 days left. Product and Expiration date: " $1, $3 }'expires'| mail -s "Product Expiring" mary@rer.com# 29 days left - send email- 29 days in seconds(2505600)
elif [ 'expr $date_diff - 2505600' -gt 0 ]
then
echo | awk expires="$expires"'{print "29 days left. Product and Expiration date: " $1, $3}'expires'| mail -s "Product Expiring" mary@rer.com# 28 days left send email. 28 days in seconds(2419200)
elif [ 'expr $date_diff - 2419200' -gt 0 ]
then
echo | awk expires="$expires"'{print "28 days left. Product and Expiration date:" $1, $3}'expires'| mail -s "Product Expiring" mary@rer.com# 27 days left - send email 27 days in seconds (233200)
elif [ 'expr $date_diff - 233200' -gt 0 ]
then
echo | awk expires="$expires"'{print "27 days left. Product and Expiration date:" $1, $3}'expires'| mail -s "Product Expiring" mary@rer.com
fi
login: TEST7
TEST7's Password:
Your password will expire: Wed Feb 19 14:28:08 2003
How can I the same information become in a script (as example
in the .profile)?????????
My login starts with .profile. These File is a menue with 24 lines and the message " Your password ....." disappear
to... (8 Replies)
Hi,
Is there any way to find out the UNIX user's password expire date?. It'll we helpful to inform the users to change the password before it get expires.(FYI - I am not having only admin previlege.) (1 Reply)
Hello
I want to set the password for user never expire through the command line. For your information the box is running under Solaris 8 platform. (2 Replies)
Hi
when i do a swlist on my HP-UX machine it displays the software packages ..How do i know whether those packages are licensed or freeware
can any 1 help me
best Regards
vasanth (0 Replies)
Hi ,
I am trying to execute the ipl file as below :
my $user="iwadmin";
chomp $user;
system("passwd -x 29 $user");
The ipl file executes with out any issues when i have logged in as root in solaris .but when when i try to execute the same file with other user id ie iwadmin ,it says... (3 Replies)
Hi All,
I have Solaris 9 and there is user created in that server called appuser
That user should to be never expire..
can anyone advice me how can I modify that user to be never expire thru the command line without using GUI tool. (1 Reply)
Hi All,
I have a XML file : System.xml in which I want to update the license tag with the new data from file licence.xml.
The content of files is in following format:
System.xml:
<?xml version="1.0"?>
<!DOCTYPE Configuration SYSTEM "SystemVariables.dtd">
<usageConfiguration... (2 Replies)
I have a program that outputs a file on the number days left before software license expired. It reads in a text file name expiredt.txt.
expiredt.txt contents are as follows:
EM software 30NOV2015 11/30/2015
ABM software 30NOV2015 11/30/2015
ABM software ... (2 Replies)
Discussion started by: dellanicholson
2 Replies
LEARN ABOUT DEBIAN
plack::middleware::expires
Plack::Middleware::Expires(3pm) User Contributed Perl Documentation Plack::Middleware::Expires(3pm)NAME
Plack::Middleware::Expires - mod_expires for plack
SYNOPSIS
use Plack::Builder;
builder {
enable 'Expires',
content_type => qr!^image/!i,
expires => 'access plus 3 months';
$app;
}
DESCRIPTION
Plack::Middleware::Expires is Apache's mod_expires for Plack. This middleware controls the setting of Expires HTTP header and the max-age
directive of the Cache-Control HTTP header in server responses. Note: Expires works only for successful response and If exists Expires
HTTP header already, this middleware does not override.
CONFIGURATIONS
content_type
content_type => qr!^image!,
content_type => 'text/css',
content_type => [ 'text/css', 'application/javascript', qr!^image/! ]
Content-Type header to apply Expires
Expires
Same format as the Apache mod_expires
expires => 'M3600' # last_modified + 1 hour
expires => 'A86400' # access + 1 day
expires => 'modification plus 3 years 3 month 3 day'
expires => 'access plus 3 days'
AUTHOR
Masahiro Nagano <kazeburo {at} gmail.com>
SEE ALSO
<http://httpd.apache.org/docs/2.2/en/mod/mod_expires.html>
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2010-11-11 Plack::Middleware::Expires(3pm)