- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Perl Help
Operating System - Linux
1753753
Members
5538
Online
108799
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 10:46 AM
08-18-2005 10:46 AM
Perl Help
Hi,
I have a Perl script which executes hourly and generates some reports from the log files.
I send emails with the log data in case there are some errors in the logs.
Now the need is that I should not send the emails from 11PM till 6 AM in the morning since it is the maintenance window of some of our downstream systems.
The Perl script should get executed but the emails should not be send even if there are errors in the tiime between 11PM-6AM.
Can anyone please tell me how should I accomplish the task
Thanks,
Pat
I have a Perl script which executes hourly and generates some reports from the log files.
I send emails with the log data in case there are some errors in the logs.
Now the need is that I should not send the emails from 11PM till 6 AM in the morning since it is the maintenance window of some of our downstream systems.
The Perl script should get executed but the emails should not be send even if there are errors in the tiime between 11PM-6AM.
Can anyone please tell me how should I accomplish the task
Thanks,
Pat
- Tags:
- Perl
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 05:21 PM
08-18-2005 05:21 PM
Re: Perl Help
You can do this with localtime() to get the present time and check if it is 11PM to 6AM then, do not send mail.
Put check loop as,
my $hour=(localtime(time))[2];
if ( $hour => 23 || $hour <= 6 )
{
# Donot send mail
} else
{
# send mail
}
hth.
Put check loop as,
my $hour=(localtime(time))[2];
if ( $hour => 23 || $hour <= 6 )
{
# Donot send mail
} else
{
# send mail
}
hth.
Easy to suggest when don't know about the problem!
- Tags:
- localtime
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP