- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Time parameter in a script
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
Discussions
Discussions
Forums
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
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
тАО09-22-2003 02:29 AM
тАО09-22-2003 02:29 AM
I hope you understand what I'm asking for. Any help is greatly appreciated and points will be assigned.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2003 02:33 AM
тАО09-22-2003 02:33 AM
Re: Time parameter in a script
05 05 * * * /scriptpath/scriptname
then one for 1:15pm
15 13 * * * /scriptpath/scriptname
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2003 02:46 AM
тАО09-22-2003 02:46 AM
Re: Time parameter in a script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2003 03:15 AM
тАО09-22-2003 03:15 AM
Re: Time parameter in a script
#!/usr/bin/sh
calc_time() # converts hrs and mins to minutes since midnite
{
typeset -i10 HR=${1}
typeset -i10 MIN=${2}
shift 2
typeset -i10 TM=$(( (${HR} * 60) + ${MIN} ))
echo "${TM}"
return 0
} # calc_time
START=$(calc_time 5 5)
END=$(calc_time 13 15)
NOW=$(calc_time $(date '+%H %M'))
if [[ ${NOW} -ge ${START} && ${NOW} -le ${END} ]]
then
echo "Do your stuff; your commands go here".
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2003 03:35 AM
тАО09-22-2003 03:35 AM
Re: Time parameter in a script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2003 03:42 AM
тАО09-22-2003 03:42 AM
Solutiontypeset -i10 XX=30 declares XX to be a base 10 integer variable. Integer typesets become very important in some shells when leading zeroes may occur.
Man sh-posix for details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2003 03:47 AM
тАО09-22-2003 03:47 AM
Re: Time parameter in a script
1 #!/usr/bin/ksh
2
3 OPCMSG=/opt/OV/bin/OpC/opcmsg
4 PROC[1]="processManager"
5 PROC[2]="fbam"
6 PROC[3]="pcxsml"
7 PROC[4]="fbdm"
8 PROC[5]="fbpoetio"
9 PROC[6]="fbneonio"
10 PROC[7]="pcxrm"
11 PROC[8]="fbmoc"
12 PROC[9]="fbdbx"
13
14 calc_time() # converts hrs and mins since midnite
15 {
16 typeset -i10 HR=${1}
17 typeset -i10 MIN=${2}
18 shift 2
19 typeset -i10 TM=$(( (${HR}*60) + ${MIN} ))
20 echo "${TM}"
21 return 0
22 } # calc_time
23 START=$(calc_time 5 5)
24 END=$(calc_time 13 15)
25 NOW=$(calc_time $(date '+%H %M'))
26 if [[ ${NOW} -ge ${START} && ${NOW} -le ${END} ]]
27 then
28 ps -ef | grep -v grep | egrep '(processManager|fb[ad]m|pcxsml|fb.*io|pcx
rm|fbmoc|fbdbx)' | awk '{ print $8 }' | sed 's/\/..*\///g' > /var/tmp/fbhh_proc
29
30 for i in 1 2 3 4 5 6 7 8 9
31 do
32
33 grep -q ${PROC[i]} /var/tmp/fbhh_proc
34 if [ $? -ne 0 ]
35 then
36 ${OPCMSG} appl=FBHH s=critical msg_g=FBHH object=process \
37 msg_t="PROCESS ${PROC[i]} IS NOT WORKING!!!"
38 fi
39
40 done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2003 03:51 AM
тАО09-22-2003 03:51 AM
Re: Time parameter in a script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2003 03:59 AM
тАО09-22-2003 03:59 AM
Re: Time parameter in a script
grep -q ${PROC[i]} /var/tmp/fbhh_proc
should be
grep -q ${PROC[${i}]} /var/tmp/fbhh_proc
I also never saw where PROC was ever assigned a value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2003 04:03 AM
тАО09-22-2003 04:03 AM