lsof catch.log

#!/bin/bash

log=catch.log
while [ 1 ]; do
dt=`date +'%F %T'`
echo "======== $dt ======" >> $log
lsof -i >> $log
ps aux >> $log
sleep 1
done

Leave a Reply

Your email address will not be published. Required fields are marked *