Hello Team .
I am working a health check script ( bash) to run on linux server ( RedHat) and requirements are
- The o/p of script need to be send to two diff files . I am testing with
tee
command . But I am not successful yet , any recommendations if that is the right approach ? - The same script need to run by itself just before power off and right after power on . If I keep the script under
/etc/init.d
, it will run right after power on OR to set up a cron with@reboot
. But what I am looking is if I can have a logic in script which need to identify whether the state of the server is power off or on , If so send the output from one of the o/p files generated(from #1) .
Hope it makes sense.