1846858 Members
8359 Online
110256 Solutions
New Discussion

Re: script problem

 
SOLVED
Go to solution
jimmy_39
Advisor

script problem

hi gurus
i have a problem with a shell script

i want know the difference hours beetwen the
start backup and finish backup .

post the my script in attachment ..

the output of the script is :

Backup Name is : UNIX_CAMBI
START BACKUP 01:00
END BACKUP 09:22
La Durata Del Backup e' di = 502.00
$


the time in minute is good but I dont succeed to convert all in " hours: minute "
help me
how I must make?

help GURUS


2 REPLIES 2
Dietmar Konermann
Honored Contributor
Solution

Re: script problem

Example:

sec=502
echo $((sec/60)) hours
echo $((sec%60)) seconds

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Michael D'Aulerio
Regular Advisor

Re: script problem

I think your time is in minutes so Dietmar probably meant:

min=502
echo $((min/60)) hours
echo $((min%60)) minutes

or echo $((min/60)):$((min%60)) for hours:minutes

Also, if you use a temp file you won't have to run the omnidb command so often. I modified your script a little and attached it.

Saluti
Email: michael.n.daulerio@lmco.com