Bash Commands Execution Logging For Debugging

[Solved] Bash Commands Execution Logging For Debugging | Vb - Code Explorer | yomemimo.com
Question : Bash commands execution logging for debugging

Answered by : sunny-wjtd41mv2ggk

touch /tmp/diskusage
df -h | tee -a /tmp/diskusage
UStatus=`echo "$?"`
if [ $UStatus -eq 0 ]; then sudo logger "Successfully Execuated" -t DiskUsagePass -f /var/log/messages &>/dev/null
else sudo logger "Failed To Execuate df command" -t DiskUsageFailed -f /var/log/messages &>/dev/null
fi

Source : | Last Update : Sun, 31 Jul 22

Answers related to bash commands execution logging for debugging

Code Explorer Popular Question For Vb