I have below script and for a requirement I have to place some function for each of these script to get time information for each script and at last show total time.
My main scripts looks like below:
/u01/scripts/stop.sh ${1} | tee ${stop_log}
/u01/scripts/kill_proc.sh ${1} | tee ${kill_log}
/u01/scripts/detach.sh ${1}| tee ${detach_log}
/u01/scripts/copy.sh ${1} | tee ${copy_log}
I want to use something like below function to get every script execution time and at last with a global variable I can show Total time taken by all the scripts.
I created below but unfortunately I could not use properly , if you have something kindly help here.
time_check()
{
export time_log=${log}/time_log_${dts}.log
echo 'StartingTime:'date +%s > ${time_log}
echo 'EndingTime:'date +%s >> ${time_log}
}
I want to use something like above function to get every script execution time and at last with a global variable I can show total time taken by all the scripts . Could anyone please guide how to get the desired result.