<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: time operations in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907168#M405367</link>
    <description>&lt;BR /&gt;I make a script for scheduling jobs like in HP3000 (I recently migrated from this platform), and I called it stream.sh&lt;BR /&gt;&lt;BR /&gt;DIMPSG_HOME="/homes/dimpsg"&lt;BR /&gt;ORA_HOME="/homes/oracle"&lt;BR /&gt;JOBFI="$DIMPSG_HOME/CONFIG/personal_rescheduling.sh"&lt;BR /&gt;if [ "$2" = "-oracle" ]; then&lt;BR /&gt; JOBINI="$ORA_HOME/$1.job"&lt;BR /&gt;else&lt;BR /&gt;  JOBINI="$DIMPSG_HOME/JOBS/$1.job"&lt;BR /&gt;fi&lt;BR /&gt;if [ -f $JOBINI ]; then&lt;BR /&gt;  cat $JOBINI $JOBFI &amp;gt; arxiutmp&lt;BR /&gt;  at -qd now &amp;lt; arxiutmp&lt;BR /&gt;  rm arxiutmp&lt;BR /&gt;else&lt;BR /&gt;    echo "El job que intentes llenÃ§ar no existeix !!! BUUURROOOOOO. AnÃ³nimo"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;With this script I append at end of every job the personal_rescheduling.sh script and queue it. Every time a job finishes, it reschedule the rest of queued jobs to grant correct execution order.&lt;BR /&gt;&lt;BR /&gt;Like in HP3000, I make a script to change the job's limit for the queue, obiously I call it limit.sh:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;SUDOBIN=/opt/sudo/bin/sudo&lt;BR /&gt;COMUSUARI="root"&lt;BR /&gt;JLIMIT="$1"&lt;BR /&gt;PRI="0"&lt;BR /&gt;CONFDIR="/homes/dimpsg/CONFIG"&lt;BR /&gt;if [ $1 ]&lt;BR /&gt; then &lt;BR /&gt;  case $1 in&lt;BR /&gt;       0 ) QUEFEM="stop"&lt;BR /&gt;       $SUDOBIN -S -i -u $COMUSUARI $HOME/CONFIG/Squeue.sh $QUEFEM $JLIMIT $PRI;;&lt;BR /&gt;   [1-5] ) QUEFEM="start"&lt;BR /&gt;            $CONFDIR/personal_rescheduling.sh&lt;BR /&gt;       $SUDOBIN -S -i -u $COMUSUARI $HOME/CONFIG/Squeue.sh $QUEFEM $JLIMIT $PRI;;&lt;BR /&gt;       * ) echo "El lÃ­mit ha d'estar entre 0 i 5 marica!! NO HI HA MÃ S LLICÃ NCIES";;&lt;BR /&gt;  esac&lt;BR /&gt; else&lt;BR /&gt;  echo "M'INVENTO EL LIMIT QUE VOLS POSAR?, ES QUE....?"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;When argument is 0 I stop the queue and when argument between 1 and 5 (max limit for my queue) I reschedule all jobs for grant execution in correct order and start the queue with Squeue.sh script:&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/sh&lt;BR /&gt;#cua a arrancar-parar,nombre de jobs,prioritat&lt;BR /&gt;cd /var/adm/cron&lt;BR /&gt;OLD_LIMIT=`cat queuedefs | grep "^d."`&lt;BR /&gt;NEW_LIMIT=d.$2j$3n2w&lt;BR /&gt;sed -e 's/'$OLD_LIMIT'/'$NEW_LIMIT'/' queuedefs &amp;gt;queuedefsold #falla&lt;BR /&gt;mv queuedefsold queuedefs&lt;BR /&gt;chmod 664 queuedefs&lt;BR /&gt;chown bin:bin queuedefs&lt;BR /&gt;&lt;BR /&gt;This script only change the job limit for queue d.&lt;BR /&gt;&lt;BR /&gt;I'm sure there is a so easy way to do all I explain here, but I'm new in HP-UX and I'm so happy this works fine.&lt;BR /&gt;&lt;BR /&gt;Thank you so much!!&lt;BR /&gt;&lt;BR /&gt;Especial thanks to Pere Vidal i</description>
    <pubDate>Tue, 14 Jun 2005 14:35:20 GMT</pubDate>
    <dc:creator>Miquel_2</dc:creator>
    <dc:date>2005-06-14T14:35:20Z</dc:date>
    <item>
      <title>time operations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907154#M405353</link>
      <description>Hi everybody,&lt;BR /&gt;&lt;BR /&gt;Are there any expresion to add x seconds to current time ?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Jun 2005 04:22:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907154#M405353</guid>
      <dc:creator>Miquel_2</dc:creator>
      <dc:date>2005-06-14T04:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: time operations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907155#M405354</link>
      <description>Hi,&lt;BR /&gt;do you mean adding seconds to the system time? If yes, on 11.00 and onwards you can make the system clock tick faster until it has drifted a specified number of seconds ahead of it' prevoius time, e.g.&lt;BR /&gt;# date -a 45&lt;BR /&gt;which will slowly adjust the clock by addding 45 seconds. &lt;BR /&gt;Beware, that you get a prompt back immediately and you get no indication of when the "drift" has finished.&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Jun 2005 04:35:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907155#M405354</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2005-06-14T04:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: time operations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907156#M405355</link>
      <description>I don't want to move system time, I only need to operate with it for queue jobs at specified time.&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Jun 2005 04:41:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907156#M405355</guid>
      <dc:creator>Miquel_2</dc:creator>
      <dc:date>2005-06-14T04:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: time operations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907157#M405356</link>
      <description>If you want a time-of-day for calculation purposes, then you can calculate the time of day in seconds with:&lt;BR /&gt;&lt;BR /&gt;(( now = `date +%H` * 3600 + `date +%M` * 60 + `date +%S` ))&lt;BR /&gt;&lt;BR /&gt;This will set $now to be the time of day in seconds.  Add 45 to this to get the time in 45 seconds.&lt;BR /&gt;&lt;BR /&gt;Then if you want to compare "45 seconds time" with eg 18:00:00 (or any arbitrary time) you can calculate the time to compare with:&lt;BR /&gt;&lt;BR /&gt;(( comptime = 18*3600 + 0*60 + 0 ))&lt;BR /&gt;&lt;BR /&gt;Obviously if comparing against fixed times you don't need the formula above in your script just calculate it, but the above formula lets you use hours/minutes/seconds.</description>
      <pubDate>Tue, 14 Jun 2005 04:51:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907157#M405356</guid>
      <dc:creator>Simon Hargrave</dc:creator>
      <dc:date>2005-06-14T04:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: time operations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907158#M405357</link>
      <description>if you want to change the file modification time, take a look at the touch command.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Jun 2005 06:11:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907158#M405357</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2005-06-14T06:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: time operations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907159#M405358</link>
      <description>Hi Miquel&lt;BR /&gt;&lt;BR /&gt;Try this script:&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;H=`date +%H`&lt;BR /&gt;M=`date +%M`&lt;BR /&gt;SEC=`date +%S`&lt;BR /&gt;echo "Time is ${H}:${M}:${SEC}"&lt;BR /&gt;let HOUR=${H}*3600&lt;BR /&gt;let MIN=${M}*60&lt;BR /&gt;let TIME_IN_SECS=${HOUR}+${MIN}+${SEC}&lt;BR /&gt;let TIME_IN_SECS=${TIME_IN_SECS}+$1&lt;BR /&gt;let NEWHOUR=${TIME_IN_SECS}/3600&lt;BR /&gt;ADJ_HOUR=$NEWHOUR&lt;BR /&gt;LOOP=TRUE&lt;BR /&gt;while [ $LOOP = "TRUE" ]&lt;BR /&gt;do&lt;BR /&gt;if [ $ADJ_HOUR -gt 23 ]&lt;BR /&gt;then&lt;BR /&gt;  let ADJ_HOUR=$ADJ_HOUR-24&lt;BR /&gt;else&lt;BR /&gt;  LOOP=FALSE&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;let TMPHOUR=$NEWHOUR*3600&lt;BR /&gt;let TMPMIN=${TIME_IN_SECS}-$TMPHOUR&lt;BR /&gt;let NEWMIN=${TMPMIN}/60&lt;BR /&gt;let TMPSEC=${NEWMIN}*60&lt;BR /&gt;let NEWSEC=${TMPMIN}-$TMPSEC&lt;BR /&gt;typeset -Z2 HOUR=$ADJ_HOUR&lt;BR /&gt;typeset -Z2 MIN=$NEWMIN&lt;BR /&gt;typeset -Z2 SEC=$NEWSEC&lt;BR /&gt;echo "Wound time is ${HOUR}:${MIN}:${SEC}"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Save it to a file, give execute permissions and call it with an argument (e.g. /tmp/myscript 500)&lt;BR /&gt;&lt;BR /&gt;You will need to test though - if the time is wound to a subsequent day, the script won't tell you that, although it does report the time correctly!!&lt;BR /&gt;&lt;BR /&gt;HTH - Keith</description>
      <pubDate>Tue, 14 Jun 2005 06:16:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907159#M405358</guid>
      <dc:creator>Keith Bryson</dc:creator>
      <dc:date>2005-06-14T06:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: time operations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907160#M405359</link>
      <description>and yes, it is dirty (ksh) but I'm no perl expert...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;All the best - KB</description>
      <pubDate>Tue, 14 Jun 2005 06:20:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907160#M405359</guid>
      <dc:creator>Keith Bryson</dc:creator>
      <dc:date>2005-06-14T06:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: time operations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907161#M405360</link>
      <description>Note that if you are using this to queue jobs then you don't need to do anything. The "at" command understands expressions like "now + 90 seconds" or "now + 5 minutes" or "now + 2 hours". Man at for details.&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Jun 2005 09:15:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907161#M405360</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-06-14T09:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: time operations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907162#M405361</link>
      <description>Yes A.Clay Stephenson, this is what I want, but if try to queue jobs with "at now + n seconds" this error is reported:&lt;BR /&gt;&lt;BR /&gt;$ at -qd now + 3 seconds &amp;lt; JOBS/job1.job&lt;BR /&gt;bad date specification&lt;BR /&gt;&lt;BR /&gt;Looking at man at, the time specification seconds is not allowed, only minutes, hours, days.....&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Jun 2005 10:38:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907162#M405361</guid>
      <dc:creator>Miquel_2</dc:creator>
      <dc:date>2005-06-14T10:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: time operations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907163#M405362</link>
      <description>You are correct. The standard at command's smallest unit is the minute. It really never occurred to me that you nould want to schedule a job only 3 seconds into the future. If that's the case then I would add something like:&lt;BR /&gt;sleep 3&lt;BR /&gt;at -f /usr/local/bin/myjob.sh now &lt;BR /&gt;to my script.&lt;BR /&gt;&lt;BR /&gt;The "now" by itself is legal syntax for at.</description>
      <pubDate>Tue, 14 Jun 2005 10:45:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907163#M405362</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-06-14T10:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: time operations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907164#M405363</link>
      <description>Thanks, but I don't want to queue a job 3 seconds after now, I want all my queued jobs run in correct order and at the end of every queued job I need to add a script for reschedule the rest of jobs in queue with a difference of 3 seconds beacause the wait time for queue is 2 seconds and then I am sure jobs run in correct order.&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Jun 2005 10:52:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907164#M405363</guid>
      <dc:creator>Miquel_2</dc:creator>
      <dc:date>2005-06-14T10:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: time operations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907165#M405364</link>
      <description>What you need is something like "Control M"&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.bmc.com/products/proddocview/0,2832,19052_19429_23437_1521,00.html" target="_blank"&gt;http://www.bmc.com/products/proddocview/0,2832,19052_19429_23437_1521,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;or, have 1 "Master" job - that calls all the other jobs - which waits for each job to finish prior to starting the next one...&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Tue, 14 Jun 2005 11:29:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907165#M405364</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2005-06-14T11:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: time operations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907166#M405365</link>
      <description>Okay here's a quick Perl script which should do what you want and it formats the time specification in the format that at likes:&lt;BR /&gt;CCYYMMDDhhmm.ss&lt;BR /&gt;&lt;BR /&gt;Use it like this:&lt;BR /&gt;TM=$(inctime.pl 5)&lt;BR /&gt;echo "Time 5 seconds from now = ${TM}"&lt;BR /&gt;&lt;BR /&gt;------------------------------------------&lt;BR /&gt;#!/usr/bin/perl -w&lt;BR /&gt;&lt;BR /&gt;use strict;&lt;BR /&gt;use integer;&lt;BR /&gt;use English;&lt;BR /&gt;&lt;BR /&gt;sub Usage&lt;BR /&gt;{&lt;BR /&gt;  printf STDERR&lt;BR /&gt;    ("Usage: %s inc\n\n",$PROGRAM_NAME);&lt;BR /&gt;  printf STDERR&lt;BR /&gt;    ("Returns a timestring CCYYMMDDhhmm.ss differing by inc seconds from\n");&lt;BR /&gt;  printf STDERR&lt;BR /&gt;    ("the current time. Inc may be positive or negative.\n\n");&lt;BR /&gt;  return(255);&lt;BR /&gt;} # Usage&lt;BR /&gt;&lt;BR /&gt;sub Problem&lt;BR /&gt;{&lt;BR /&gt;  my $msg = $_[0];&lt;BR /&gt;  my $err = $_[1];&lt;BR /&gt;&lt;BR /&gt;  printf STDERR ("\n%s: %s (%d)\n",$PROGRAM_NAME,$msg,$err);&lt;BR /&gt;  return(1);&lt;BR /&gt;} # Problem&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;my $cc = 0;&lt;BR /&gt;if ($#ARGV &amp;gt;= 0)&lt;BR /&gt;  {&lt;BR /&gt;    if ($ARGV[0] =~ /^[+\-]{0,1}\d+$/)&lt;BR /&gt;      {&lt;BR /&gt;        my $inc = $ARGV[0];&lt;BR /&gt;        my $now = time();&lt;BR /&gt;        my ($seconds,$minutes,$hours,$mday,$month,$year,$wday,$yday,$isdst)&lt;BR /&gt;          = localtime($now + $inc);&lt;BR /&gt;        printf("%04d%02d%02d%02d%02d.%02d\n",$year + 1900,$month + 1,&lt;BR /&gt;               $mday,$hours,$minutes,$seconds);&lt;BR /&gt;      }&lt;BR /&gt;    else&lt;BR /&gt;      {&lt;BR /&gt;        $cc = 254;&lt;BR /&gt;        my $s_err = sprintf("Invalid increment '%s'",$ARGV[0]);&lt;BR /&gt;        Problem($s_err,$cc);&lt;BR /&gt;      }&lt;BR /&gt;  }&lt;BR /&gt;else&lt;BR /&gt;  {&lt;BR /&gt;    $cc = Usage();&lt;BR /&gt;  }&lt;BR /&gt;exit($cc);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------------------&lt;BR /&gt;&lt;BR /&gt;If I didn't make any booboo's that should be it and I made it accept positive or negative or zero increments.&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Jun 2005 11:49:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907166#M405365</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-06-14T11:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: time operations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907167#M405366</link>
      <description>Thank you very much every person who try to help me.&lt;BR /&gt;&lt;BR /&gt;I work with first shell script posted by Keith Bryson beacause when the perl script was posted I was working with it and I don't know how perl scripts works for receive external varibles and and this is the result:&lt;BR /&gt;&lt;BR /&gt;I have a script for rescheduling queued jobs named personal_rescheduling.sh:&lt;BR /&gt;&lt;BR /&gt;Hour=`date +'%H'`&lt;BR /&gt;Minute=`date +'%M'`&lt;BR /&gt;Second=`date +'%S'`&lt;BR /&gt;jobs_dir="/var/spool/cron/atjobs/"&lt;BR /&gt;ls -1 $jobs_dir | while read job_name&lt;BR /&gt;do&lt;BR /&gt;   execution_hour=`add_seconds.sh 3 $Hour $Minute $Second`&lt;BR /&gt;   at -qd -t $execution_hour &amp;lt; $jobs_dir$job_name&lt;BR /&gt;   if [ $? = 0 ]&lt;BR /&gt;   then&lt;BR /&gt;      at -r $job_name&lt;BR /&gt;   fi&lt;BR /&gt;   Hour=`add_seconds.sh 3 $Hour $Minute $Second | cut -c 9-10`&lt;BR /&gt;   Minute=`add_seconds.sh 3 $Hour $Minute $Second | cut -c 11-12`&lt;BR /&gt;   Second=`add_seconds.sh 3 $Hour $Minute $Second | cut -c 14-15`&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;This script reschedule all queued jobs from now every 3 seconds.&lt;BR /&gt;&lt;BR /&gt;The script used add_seconds.sh is the one posted by Keith Bryson only changed for accept time externaly:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;#&lt;BR /&gt;# Using: add_seconds.sh seconds_to_add hour minute second&lt;BR /&gt;# Return: date and time in at format CCYYMMDDhhmm.ss&lt;BR /&gt;#&lt;BR /&gt;H=$2&lt;BR /&gt;M=$3&lt;BR /&gt;SEC=$4&lt;BR /&gt;## Lines commented and rewrited beacause when hour, minute or second is 08 or 09 this sentence return error.&lt;BR /&gt;#let HOUR=${H}*3600&lt;BR /&gt;#let MIN=${M}*60&lt;BR /&gt;#let TIME_IN_SECS=${HOUR}+${MIN}+${SEC}&lt;BR /&gt;#let TIME_IN_SECS=${TIME_IN_SECS}+$1&lt;BR /&gt;#let NEWHOUR=${TIME_IN_SECS}/3600&lt;BR /&gt;HOUR=`expr ${H} \* 3600`&lt;BR /&gt;MIN=`expr ${M} \* 60`&lt;BR /&gt;TIME_IN_SECS=`expr ${HOUR} + ${MIN} + ${SEC}` &lt;BR /&gt;TIME_IN_SECS=`expr ${TIME_IN_SECS} + $1`&lt;BR /&gt;NEWHOUR=`expr ${TIME_IN_SECS} \/ 3600`&lt;BR /&gt;ADJ_HOUR=$NEWHOUR&lt;BR /&gt;LOOP=TRUE&lt;BR /&gt;while [ $LOOP = "TRUE" ]&lt;BR /&gt;do&lt;BR /&gt;  if [ $ADJ_HOUR -gt 23 ] &lt;BR /&gt;  then&lt;BR /&gt;    let ADJ_HOUR=$ADJ_HOUR-24&lt;BR /&gt;  else&lt;BR /&gt;    LOOP=FALSE&lt;BR /&gt;  fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;let TMPHOUR=$NEWHOUR*3600&lt;BR /&gt;let TMPMIN=${TIME_IN_SECS}-$TMPHOUR&lt;BR /&gt;let NEWMIN=${TMPMIN}/60&lt;BR /&gt;let TMPSEC=${NEWMIN}*60&lt;BR /&gt;let NEWSEC=${TMPMIN}-$TMPSEC&lt;BR /&gt;typeset -Z2 HOUR=$ADJ_HOUR&lt;BR /&gt;typeset -Z2 MIN=$NEWMIN&lt;BR /&gt;typeset -Z2 SEC=$NEWSEC&lt;BR /&gt;execution_date=`date +%Y%m%d`&lt;BR /&gt;echo "${execution_date}${HOUR}${MIN}.${SEC}"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Jun 2005 14:35:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907167#M405366</guid>
      <dc:creator>Miquel_2</dc:creator>
      <dc:date>2005-06-14T14:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: time operations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907168#M405367</link>
      <description>&lt;BR /&gt;I make a script for scheduling jobs like in HP3000 (I recently migrated from this platform), and I called it stream.sh&lt;BR /&gt;&lt;BR /&gt;DIMPSG_HOME="/homes/dimpsg"&lt;BR /&gt;ORA_HOME="/homes/oracle"&lt;BR /&gt;JOBFI="$DIMPSG_HOME/CONFIG/personal_rescheduling.sh"&lt;BR /&gt;if [ "$2" = "-oracle" ]; then&lt;BR /&gt; JOBINI="$ORA_HOME/$1.job"&lt;BR /&gt;else&lt;BR /&gt;  JOBINI="$DIMPSG_HOME/JOBS/$1.job"&lt;BR /&gt;fi&lt;BR /&gt;if [ -f $JOBINI ]; then&lt;BR /&gt;  cat $JOBINI $JOBFI &amp;gt; arxiutmp&lt;BR /&gt;  at -qd now &amp;lt; arxiutmp&lt;BR /&gt;  rm arxiutmp&lt;BR /&gt;else&lt;BR /&gt;    echo "El job que intentes llenÃ§ar no existeix !!! BUUURROOOOOO. AnÃ³nimo"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;With this script I append at end of every job the personal_rescheduling.sh script and queue it. Every time a job finishes, it reschedule the rest of queued jobs to grant correct execution order.&lt;BR /&gt;&lt;BR /&gt;Like in HP3000, I make a script to change the job's limit for the queue, obiously I call it limit.sh:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;SUDOBIN=/opt/sudo/bin/sudo&lt;BR /&gt;COMUSUARI="root"&lt;BR /&gt;JLIMIT="$1"&lt;BR /&gt;PRI="0"&lt;BR /&gt;CONFDIR="/homes/dimpsg/CONFIG"&lt;BR /&gt;if [ $1 ]&lt;BR /&gt; then &lt;BR /&gt;  case $1 in&lt;BR /&gt;       0 ) QUEFEM="stop"&lt;BR /&gt;       $SUDOBIN -S -i -u $COMUSUARI $HOME/CONFIG/Squeue.sh $QUEFEM $JLIMIT $PRI;;&lt;BR /&gt;   [1-5] ) QUEFEM="start"&lt;BR /&gt;            $CONFDIR/personal_rescheduling.sh&lt;BR /&gt;       $SUDOBIN -S -i -u $COMUSUARI $HOME/CONFIG/Squeue.sh $QUEFEM $JLIMIT $PRI;;&lt;BR /&gt;       * ) echo "El lÃ­mit ha d'estar entre 0 i 5 marica!! NO HI HA MÃ S LLICÃ NCIES";;&lt;BR /&gt;  esac&lt;BR /&gt; else&lt;BR /&gt;  echo "M'INVENTO EL LIMIT QUE VOLS POSAR?, ES QUE....?"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;When argument is 0 I stop the queue and when argument between 1 and 5 (max limit for my queue) I reschedule all jobs for grant execution in correct order and start the queue with Squeue.sh script:&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/sh&lt;BR /&gt;#cua a arrancar-parar,nombre de jobs,prioritat&lt;BR /&gt;cd /var/adm/cron&lt;BR /&gt;OLD_LIMIT=`cat queuedefs | grep "^d."`&lt;BR /&gt;NEW_LIMIT=d.$2j$3n2w&lt;BR /&gt;sed -e 's/'$OLD_LIMIT'/'$NEW_LIMIT'/' queuedefs &amp;gt;queuedefsold #falla&lt;BR /&gt;mv queuedefsold queuedefs&lt;BR /&gt;chmod 664 queuedefs&lt;BR /&gt;chown bin:bin queuedefs&lt;BR /&gt;&lt;BR /&gt;This script only change the job limit for queue d.&lt;BR /&gt;&lt;BR /&gt;I'm sure there is a so easy way to do all I explain here, but I'm new in HP-UX and I'm so happy this works fine.&lt;BR /&gt;&lt;BR /&gt;Thank you so much!!&lt;BR /&gt;&lt;BR /&gt;Especial thanks to Pere Vidal i</description>
      <pubDate>Tue, 14 Jun 2005 14:35:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907168#M405367</guid>
      <dc:creator>Miquel_2</dc:creator>
      <dc:date>2005-06-14T14:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: time operations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907169#M405368</link>
      <description>Hi Miquel&lt;BR /&gt;&lt;BR /&gt;Glad we could help.  Are you finished with this thread now?  If so, can you allocate some points to all our responses and close it down.  If you need any more help, let us know.&lt;BR /&gt;&lt;BR /&gt;All the best - Keith</description>
      <pubDate>Wed, 15 Jun 2005 01:42:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907169#M405368</guid>
      <dc:creator>Keith Bryson</dc:creator>
      <dc:date>2005-06-15T01:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: time operations</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907170#M405369</link>
      <description>Thanks All!!</description>
      <pubDate>Wed, 15 Jun 2005 02:32:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/time-operations/m-p/4907170#M405369</guid>
      <dc:creator>Miquel_2</dc:creator>
      <dc:date>2005-06-15T02:32:22Z</dc:date>
    </item>
  </channel>
</rss>

