- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script to change date in my crontab
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
Forums
Discussions
Discussions
Discussions
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
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
12-19-2005 11:16 AM
12-19-2005 11:16 AM
##############
month=12
day=19
hour=`date |cut -c 12-13`
min=`date |cut -c 15-16`
min=`expr $min - 5`
year=2005
chardate=$month$day$hour$min$year
date $chardate
##############
how to make to date command not ask for time backwards?
date: do you really want to run time backwards?[yes/no]Only "yes" will make it take!
thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2005 11:18 AM
12-19-2005 11:18 AM
Re: script to change date in my crontab
why do you want to change the date / time using the cron.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2005 11:20 AM
12-19-2005 11:20 AM
Re: script to change date in my crontab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2005 11:23 AM
12-19-2005 11:23 AM
Re: script to change date in my crontab
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2005 11:32 AM
12-19-2005 11:32 AM
Re: script to change date in my crontab
To keep your servers with consistent, correct time, use 'xntpd' (NTP = Network Time Protocol).
You can configure this via SAM or by editing a few simple configuration files.
There is an excellent guide in the "Installing and Administering Internet
Services" manual in chapter-7.
You can find an external source to which to synchronize your server, here:
http://ntp.isc.org/bin/view/Servers/WebHome
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2005 03:22 PM
12-19-2005 03:22 PM
Re: script to change date in my crontab
Time Server is the way to go!
YOu must configure you servers to synchronize their date/times with that of the Time Server.
You will be more accurate/scientific
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2005 03:35 PM
12-19-2005 03:35 PM
Re: script to change date in my crontab
see also:
http://www.ntp.org
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2005 04:58 PM
12-19-2005 04:58 PM
Solution##############
month=12
day=19
hour=`date |cut -c 12-13`
min=`date |cut -c 15-16`
min=`expr $min - 5`
year=2005
chardate=$month$day$hour$min$year
date $chardate<<-EOF
yes
EOF
##############
will do it.
-Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2005 12:53 AM
12-20-2005 12:53 AM
Re: script to change date in my crontab
thank yuo all for the comments and solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2005 01:08 AM
12-20-2005 01:08 AM
Re: script to change date in my crontab
This script only will be executed one time, after will be removed from crontab...