- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to wite a unix shell script to execute a unix ...
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
08-31-2005 07:26 AM
08-31-2005 07:26 AM
Thanks a lot!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2005 07:27 AM
08-31-2005 07:27 AM
Re: How to wite a unix shell script to execute a unix script at 8:00 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2005 07:44 AM
08-31-2005 07:44 AM
Re: How to wite a unix shell script to execute a unix script at 8:00 PM
at -f /filesystem/script -t200508312000.00
that command runs the script /filesystem/script at 8:00pm on 08/31/2005
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2005 07:49 AM
08-31-2005 07:49 AM
SolutionThe simplest approach is to use 'at' given that your account has been granted permission in '/var/adm/cron/at.allow'. Then, simply do:
# at -f /your_script -t 08312000
If you don't have permisssion to do 'at' jobs (nor 'cron' tasks) then for a one time script you could launch this:
#!/usr/bin/sh
typeset CMD=date #...replace with your executable name
while true
do
WHEN=`date +"%H%M`
echo ${WHEN}
[ "${WHEN}" -ge 2000 ] && { ${CMD}; exit 0; }
sleep 60
done
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2005 07:49 AM
08-31-2005 07:49 AM
Re: How to wite a unix shell script to execute a unix script at 8:00 PM
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2005 07:50 AM
08-31-2005 07:50 AM
Re: How to wite a unix shell script to execute a unix script at 8:00 PM
DONE=0
while [[ $DONE != 1 ]]
if [[ `date` = "Wed Aug 31 20:00:00 CDT 2005"]]
then
#execute script
DONE=1
else
sleep 5
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2005 07:50 AM
08-31-2005 07:50 AM
Re: How to wite a unix shell script to execute a unix script at 8:00 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2005 07:56 AM
08-31-2005 07:56 AM
Re: How to wite a unix shell script to execute a unix script at 8:00 PM
I am on sun box.
DONE=0
while [[ $DONE != 1 ]]
if [[ `date` = "Wed Aug 31 16:00:00 CDT 2005"]]
then
exec1.sh
DONE=1
else
sleep 5
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2005 08:03 AM
08-31-2005 08:03 AM
Re: How to wite a unix shell script to execute a unix script at 8:00 PM
#!/usr/bin/ksh
DONE=0
while [[ $DONE != 1 ]]
do
if [[ `date` = "Wed Aug 31 16:00:00 CDT 2005"]]
then
exec1.sh
DONE=1
else
sleep 5
fi
done
(SORRY, forgot to close the while loop)
you might also have to watch the date format on solaris. We are lamely looking at the textual date format and there are much better ways to do this.
You can even just go after the time i.e. date +%T or some fashion of that.
I hope this gives you the idea.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2005 09:17 AM
08-31-2005 09:17 AM
Re: How to wite a unix shell script to execute a unix script at 8:00 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2005 09:27 AM
08-31-2005 09:27 AM
Re: How to wite a unix shell script to execute a unix script at 8:00 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2005 10:10 AM
08-31-2005 10:10 AM
Re: How to wite a unix shell script to execute a unix script at 8:00 PM
It can be done if you have access to "at" otherwise not. Here's a template you can use to create a script that schedules another:
=============================================
#!/bin/sh
echo Schedules another script to run on August 31st at 800pm
at 8:00 pm August 31 <