Skip to content

Instantly share code, notes, and snippets.

@mitnk
Last active August 29, 2015 14:03
Embed
What would you like to do?
Tailf lastest PostgreSQL Log
path=`ps ax | grep -i 'postmaster' | grep -o '\-D\(/Library/Post.*\)' | awk -F D '{print $NF}'`
log_dir="${path}/pg_log"
log_name=`sudo ls -1t ${log_dir} | head -n1`
log_file="${log_dir}/${log_name}"
echo ""
echo "=========== $log_file =========="
echo ""
sudo tail -f "$log_file"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment