- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Scheduling jobs using at command
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
03-21-2007 08:35 PM
03-21-2007 08:35 PM
Scheduling jobs using at command
I have a list of scripts to be run on batch and I have a menu to start/stop them.
For e.g. On executing the menu_script, it displayes as following:
******************************
List of batches
1. script 1
2. script 2
3. script 3
.
.
10. stop batch jobs
99. exit
Enter option:
***********************************
On entering the option I want to put the script in the scheduler(run the script at some time interval - . ./script | at "now + 30 minutes").
This makes the script to run after 30 minutes, but it is not repating again.
I will be passing arguments from the menu_script to script1 and so I cannot give
echo ". $0" | at "
How do I repeat run the script using at command? I don't want to use crontab.
Thanks,
Vidhya.
P.S. This time I'll be very generous in giving points ;O)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 08:41 PM
03-21-2007 08:41 PM
Re: Scheduling jobs using at command
you could include in your script1/script2.. files the at command, which would then trigger the repeat run.
Problem is, if the system is shut down, you will lose your at jobs, that is why cron was invented.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 08:59 PM
03-21-2007 08:59 PM
Re: Scheduling jobs using at command
>How do I repeat run the script using at command?
If you can't edit the script, you can't repeat them. That is where you need to add the "at now + 30".
I suppose you could pass a parm -r ## to your script that tells it to optionally reschedule itself using at(1).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 09:14 PM
03-21-2007 09:14 PM
Re: Scheduling jobs using at command
How do u want to repeat it?
After certain interval OR after finishing running instance of script?
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 09:54 PM
03-21-2007 09:54 PM
Re: Scheduling jobs using at command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 10:04 PM
03-21-2007 10:04 PM
Re: Scheduling jobs using at command
echo "/script1" | at now + 30 minutes
That way, every time the script is run, it tells at to do it again in 30 minutes.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 10:12 PM
03-21-2007 10:12 PM
Re: Scheduling jobs using at command
U can do like this,
create a file say JOB_PARAM
Enter following to it.
---------------------------
#! /usr/bin/ksh
JOB_REPEAT=TRUE
# Repeat interval in seconds
REPEAT_INTERVAL=1800 # 30 mins
--------------------------------
At the beginning of ur script add following
-------------------------------------------
.
while [ JOB_REPEAT="TRUE" ]
do
at -f
sleep REPEAT_INTERVAL
done
-----------------------------------------
Thats all.
If u want to stop the job set
JOB_REPEAT=FALSE in JOB_PARAM
If u want to change repeat interval
change REPEAT_INTERVAL value in JOB_PARAM.
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 10:15 PM
03-21-2007 10:15 PM
Re: Scheduling jobs using at command
below a quote from "man at" which clear explains how to achieve this:
Add a command to the file named weekly-run in directory jobs in the home directory so that it automatically reschedules itself every time it runs. This example reschedules itself every Thursday at 1900 (7:00 p.m.):
echo "sh $HOME/jobs/weekly-run" | at 1900 thursday next week
hope this helps!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 10:24 PM
03-21-2007 10:24 PM
Re: Scheduling jobs using at command
I assume the reason for the silly echo instead of doing "at -f file", is to allow changes to the file between "now" and that future date?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 10:28 PM
03-21-2007 10:28 PM
Re: Scheduling jobs using at command
**I will be passing arguments from the menu_script to script1 and so I cannot give
echo ". $0" | at "
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 10:58 PM
03-21-2007 10:58 PM
Re: Scheduling jobs using at command
sh
in place of
at -f
try this
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 11:23 PM
03-21-2007 11:23 PM
Re: Scheduling jobs using at command
echo ". $0" | at "
Can you or can't you edit script1?? Passing args to script1 has nothing to do with editing it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 11:28 PM
03-21-2007 11:28 PM