1826102 Members
4980 Online
109690 Solutions
New Discussion

Re: schedule Script

 
SOLVED
Go to solution
Karthick K S
Frequent Advisor

schedule Script

Hi all,

Is there any possible without using Cronjob there is any other shell script to run some commands every 1 min form 9am to 9pm
14 REPLIES 14
RAC_1
Honored Contributor

Re: schedule Script

at command
man at
man batch
There is no substitute to HARDWORK
Karthick K S
Frequent Advisor

Re: schedule Script

without using at command is there any script
Sandman!
Honored Contributor

Re: schedule Script

Sure you can always use job-scheduling software like Control-M if you don't want to use the Unix tools like at or cron.

:)
Arunvijai_4
Honored Contributor

Re: schedule Script

Use sleep and put it in a loop. It will work

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Karthick K S
Frequent Advisor

Re: schedule Script

OK Thanks Arun i did same like but its working but is there any possible to automatically to go exit after 6PM

i am using output to some file using print command but that output not in good format for eg:

i need like this

ID Name Time

xx yyy yyy
RAC_1
Honored Contributor

Re: schedule Script

some scripting can do it. But why not systems commands for it??-at or cron itself??

Script like follows will do it.
i=0900
while [$i -le 2100]
do
echo $i
((i+=1))
done >> /tmp/test.txt

while true
do
current_time=$(date "+%H%M")
file_time=$(grep -iq ${current_time} /tmp/tes.txt 2>/dev/null)
if [[ ${current_time} -eq ${file_time} ]];then
your_program to be excuted
else
exit 1
fi
done
There is no substitute to HARDWORK
RAC_1
Honored Contributor
Solution

Re: schedule Script

Some corrections.

Prepare a file with timestamps 1 min apart
type -i i=0900
while [ $i -le 2100 ]
do
printf "%.4d\n" $i
((i+=1))
done > /tmp/some_file

Now start this script.
while true
do
current_time=$(date "+%H%M")
file_time=$(grep -iq ${current_time} /tmp/some_file 2>/dev/null)
if [[ ${current_time} -eq ${file_time} ]];then
"execute_your_program"
sleep
fi
done
There is no substitute to HARDWORK
Sandman!
Honored Contributor

Re: schedule Script

Not sure what you mean by???

>> ID Name Time
>> xx yyy yyy
Karthick K S
Frequent Advisor

Re: schedule Script

hi sandman,

i generating some reports to file(report.txt)by using glance

Format should be

CPU Memory Disk
12 78 1

b
Sandman!
Honored Contributor

Re: schedule Script

Use printf instead of print in order to format it the way you want.

regards!
Karthick K S
Frequent Advisor

Re: schedule Script

HI,
Using printf is not formatting i am attached a file format
Yogeeraj_1
Honored Contributor

Re: schedule Script

hi karthick,
did you look into measureware and the extract utility?

i regularly generate a report with the following format:
| | | |Memory| |Cache | Peak | Pk FS |Pg Out | Swap |Memory|
Year| Date |Time |CPU % | % |Swap %|Hit % |Disk %| Sp % | Rate |Out Rt |Queue |
2005|11/01/05|00:00| 46.43| 60.30| 33.00| 66.36| 93.69| 93.63| 0.0| 0.0| 0.00|
2005|11/01/05|00:05| 41.50| 60.55| 33.00| 57.87| 94.81| 93.63| 0.0| 0.0| 0.00|
2005|11/01/05|00:10| 38.87| 59.77| 33.00| 54.34| 92.88| 93.64| 0.0| 0.0| 0.00|


of course, you can customize this...

hope this helps!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Karthick K S
Frequent Advisor

Re: schedule Script

Hi Yogee,
Thanks for your reply but

ur using glance plus or sar or extract utililty

if ur using extract pls tell how to execute becaue i am new in this utility
Arunvijai_4
Honored Contributor

Re: schedule Script

Karthik, Extract utility got very good user guide in-built. Just type
#extract

OVPA/UX Extract (C.03.86.00) (c) Copyright 2004 Hewlett-Packard Development Com
pany, L.P.
Current date and time: Wed Nov 2 07:55:26 2005
For help enter:

MENU or ? To get a list of available commands
HELP To invoke the HELP subsystem for more detailed help
GUIDE To select guided command mode for the novice user

extract> Enter Command: GUIDE


************************************************************
* Welcome to the Guided Command Interface for the OVPA *
* extract program. *
* *
* This interface provides assisted access to a subset of *
* the regular extract commands. *
* *
* The regular interface commands that are executed for *
* you will be listed following the "extract>" prompt. *
* *
* You can return to the regular interface by typing Q *
* in response to any "extract guide>" prompt. *
************************************************************

extract guide> Are you ready to continue ?

************************************************************
* The EXTRACT program performs two basic functions: *
* *
* EXTRACT - copies data from OVPA log files into a *
* single archival file (internal OVPA format) *
* *
* EXPORT - copies data from OVPA log files into a *
* format that can be used for reports or by *
* other programs. *
* *
* (Type Q to quit the guided command facility.) *
************************************************************

extract guide> Which function do you want ?
"A ship in the harbor is safe, but that is not what ships are built for"