- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script to know that server time has a new date
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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-09-2009 10:29 PM
тАО08-09-2009 10:29 PM
Script to know that server time has a new date
Please suggest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2009 10:58 PM
тАО08-09-2009 10:58 PM
Re: Script to know that server time has a new date
what about setting up a cron job for it?
- Tags:
- crontab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2009 11:35 PM
тАО08-09-2009 11:35 PM
Re: Script to know that server time has a new date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2009 11:45 PM
тАО08-09-2009 11:45 PM
Re: Script to know that server time has a new date
Usual crontab syntax would be:
0 0 * * *
for example insert a message to syslog.log:
0 0 * * * /usr/bin/echo "+++ Midnight +++" >> /var/adm/syslog/syslog.log
hth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2009 01:12 AM
тАО08-10-2009 01:12 AM
Re: Script to know that server time has a new date
1. The cron job should check that midnight(12 a.m.) occurs in the server,
2. The cron job should immediately print in the file /tmp/midnight.txt the current time of the server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2009 01:19 AM
тАО08-10-2009 01:19 AM
Re: Script to know that server time has a new date
But once you know about crontab, you should be able modify it to do what you want.
>2. The cron job should immediately print in the file /tmp/midnight.txt the current time of the server.
0 0 * * * date > /tmp/midnight.txt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2009 01:48 AM
тАО08-10-2009 01:48 AM
Re: Script to know that server time has a new date
Without any given information or requirements i can only answer with examples.
Perhaps a simple 'man cron' helps.
#man cron
NAME
cron - timed-job execution daemon
SYNOPSIS
/usr/sbin/cron
DESCRIPTION
cron executes commands at specified dates and times.
For the new requiremnts Dennis posted the correct answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2009 03:48 AM
тАО08-10-2009 03:48 AM
Re: Script to know that server time has a new date
> Need a script which will tell that the server time has the clock time 12 midnight. The script should check when the 12 midnight has occurred in the server and print a message as soon as the server has the new day with midnight 12 a.m.
And that's because you're not sure if midnight will come every day?
...JRF...