Hi,
Please help me to cross verify the post reboot time.
I want to execute some script after every reboot, which will happen only post 20-30 mins of reboot.
If uptime is >24hrs, script should not execute.
I tried with below command, but seems no luck.
>>
uptime | sed 's/^.*up//' | awk -F, '{ if ( $3 ~ /user/ ) { print $1 $2 } else { print $1 }}' | sed -e 's-/-:-/-\- hours\
/' -e 's/ min//' -e 's/$/\ minutes/' | sed 's/^ *//'
>>
It works fine if uptime < 24 hrs. But what, if system is up for days?
Please help..!!!