- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- running commands at selected time
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
01-02-2006 07:52 PM
01-02-2006 07:52 PM
i have a commands under the application admin to stop the oracle application and another commands under the database user to stop and restart the oracle database.
and after that i want to select a time to run a backup.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2006 07:54 PM
01-02-2006 07:54 PM
Re: running commands at selected time
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2006 07:56 PM
01-02-2006 07:56 PM
Re: running commands at selected time
You have to use sudo to run the application from that user without using password.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2006 07:57 PM
01-02-2006 07:57 PM
Re: running commands at selected time
:(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2006 07:57 PM
01-02-2006 07:57 PM
Re: running commands at selected time
u may use "cron" or "at" to schedule the job.
for root to run the script as another user:
# su -
regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2006 07:58 PM
01-02-2006 07:58 PM
Re: running commands at selected time
The process of executing a command at a particular time can be done by both at and cron. But best to do for this sort of scenario will be to create a script which checks for the status of completion of first command and only after successful completion of the first command executes the later part.
HTH,
Devender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2006 07:58 PM
01-02-2006 07:58 PM
Re: running commands at selected time
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=726079
http://www2.itrc.hp.com/service/james/search.do?todo=search&admit=-1335382922+1136278644729+28353475&searchtext=oracle+scheduling&from=forums&origin=0&submit.x=0&wpa=forums1.itrc.hp.com%3A80&submit.y=0&searchcategory=ALL&hpl=1&searchcriteria=allwords&rn=25&source=7000&presort=rank&chkServStor=on&esc=us.support.itrc.hp.com
scheduling oracle script(s).
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2006 07:58 PM
01-02-2006 07:58 PM
Re: running commands at selected time
You can write your own script and put it in crontab or at to run at selected time.
# man crontab
# man at
for more details.
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2006 08:00 PM
01-02-2006 08:00 PM
Re: running commands at selected time
"at" or "crontab" are for running jobs
automatically.Normally "at" is using for to run only 1 ,cron is for to run a processes,script more than 1 as permanently
Good Luck,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2006 08:00 PM
01-02-2006 08:00 PM
Re: running commands at selected time
login with that user which you want to run the commands,
crontab -e
and use the format of,
minute hour monthday month weekday command
Change this format to suit your requirement. My previous reply is having more examples.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2006 08:03 PM
01-02-2006 08:03 PM
Re: running commands at selected time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2006 08:05 PM
01-02-2006 08:05 PM
Re: running commands at selected time
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=821853
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=31119
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2006 08:17 PM
01-02-2006 08:17 PM
Re: running commands at selected time
First of all you must create a script for each of the following operations:
a. Stop the Oracle Application
b. Shutdown the Oracle database
c. Startup of the Oracle Database
d. Perform a database backup
e. Startup of the Oracle Application
(nb. a & e can be one script as well as b &c.
You can then use "cron" or "at" to schedule the execution at the required times.
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2006 06:54 PM
01-03-2006 06:54 PM
Re: running commands at selected time
1- ./stopappl for shutdown the application.
2- ./stoporadb for shutdown the database.
so if i want to run this to scripts at 18:00pm evrey day exept weekends.
what is the full command to do it?
remark: ./stopappl under applmgr user and the ./stoporadb under oracle user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2006 08:02 PM
01-03-2006 08:02 PM
Re: running commands at selected time
you should put in place something like this:
###########################################################
#
###########################################################
###########################################################
# BACKUP ON ....... ..:.. AM ... - ..: PM server time
###########################################################
# ---------------------------------------------------------
# Daily
# ---------------------------------------------------------
# minute hour monthday month weekday (0=Sunday) command
# 0-59 0-23 1-31 1-12 0-6
03 00 * * * crontab -l > file_cron
00 18 * * 1-5 stopappl >/tmp/stopapl.log 2>&1
10 18 * * 1-5 remsh $(hostname) -l oracle -n stoporadb >/tmp/stoporadb.log 2>&1
#eof
the stopradb is executed from the same user but connecting via remsh to oracle user.
Take care to load the profile and the right Oracle envirinemt in your script because crontab doesn't load the porofile for you.
HTH,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2006 11:50 PM
01-03-2006 11:50 PM
Re: running commands at selected time
# cd /oracle
#at -f ./stopappl -m aalshafiy@host -t 0601041500.00
then i get a message to the root user:
bad time specification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2006 12:02 AM
01-04-2006 12:02 AM
SolutionThe error message from 'at' is misleading. The problem is that the '-m' switch cannot have an argument with it. Instead of:
# at -f ./stopappl -m aalshafiy@host -t 0601041500.00
...you should have written:
# at -f ./stopappl -m -t 0601041500.00
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2006 12:20 AM
01-04-2006 12:20 AM
Re: running commands at selected time
# cd /oracale
# at -f ./startappl -m -t 0601041610.00
i get this tow messages sent to root:
1- Cron: cron|at job completed: 1136416200.a 21091 a Wed Jan 4 16:10:02 MST 2006
2- Not a terminal
stty: : Not a typewriter
stty: : Not a typewriter
[3g
H H H H H H H H H
You are running addbctl.sh version 115.3
Starting the database NAS ...
SQL*Plus: Release 8.1.7.0.0 - Production on Wed Jan 4 16:10:00 2006
(c) Copyright 2000 Oracle Corporation. All rights reserved.
ERROR:
ORA-01031: insufficient privileges
ORA-01031: insufficient privileges
addbctl.sh: exiting with status 0
You are running addlnctl.sh version 115.2
Starting listener process NAS ...
addlnctl.sh: exiting with status 0
logout
*************************************************
Cron: The previous message is the standard output
and standard error of one of your at commands.
how i can run the job?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2006 01:20 AM
01-04-2006 01:20 AM
Re: running commands at selected time
Some oracle scripts needs to be run only after logging in as oracle user, the .profile and the privilleges are customised for that.
Try
#su -
as the COMMAND in the "at" command.
With Regards,
Siva.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2006 01:28 AM
01-04-2006 01:28 AM
Re: running commands at selected time
you are not authorized to use at. Sorry.
how i can give authoriz to oracle user to use at and corntab to other users than root.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2006 01:33 AM
01-04-2006 01:33 AM
Re: running commands at selected time
To authorize any user to be able to use 'at' or 'cron' you need to add the user to the appropriate 'allow' file:
# /var/adm/cron/at.allow
# /var/adm/cron/cron.allow
For example:
# cat /var/adm/at.allow
root
sys
adm
oracle
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2006 01:58 AM
01-04-2006 01:58 AM