i have this code in my script :
check() { if [ $? -eq 0 ] then DATA=`date +%Y%m%d_%H.%M.%S` echo "O script $DATA Executou com sucesso" >>$log else DATA=`date +%Y%m%d_%H.%M.%S` echo "O script $DATA Executou com erro"; >>$log fi } but i want to put it in another script and when i execute in crontab once every 15 minutes. I want to check if the script executed successfully or not.
My question is in this first if section, how can I put the script ex3.sh for example
if script ex3.sh sucess then DATA=`date +%Y%m%d_%H.%M.%S` echo "O script $DATA Executou com sucesso" >>$log else DATA=`date +%Y%m%d_%H.%M.%S` echo "O script $DATA Executou com erro"; >>$log fi }