Error Logging

From Server Knowledge Base
Revision as of 12:07, 15 January 2013 by Rootadminacc (talk | contribs) (Created page with "<pre>#!/bin/bash DATE=`date +%Y%m%d` TIME=`date +%H%M%S` HOUR=`date +%H` mkdir -p /root/process/$DATE/$HOUR/ echo "Process List" > /root/process/$DATE/$HOUR/log.$TIME ps aux ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
#!/bin/bash

DATE=`date +%Y%m%d`
TIME=`date +%H%M%S`
HOUR=`date +%H`
mkdir -p /root/process/$DATE/$HOUR/
echo "Process List" > /root/process/$DATE/$HOUR/log.$TIME
ps aux >> /root/process/$DATE/$HOUR/log.$TIME
echo "===" >> /root/process/$DATE/$HOUR/log.$TIME
echo "netstat" >> /root/process/$DATE/$HOUR/log.$TIME
netstat -anp >> /root/process/$DATE/$HOUR/log.$TIME