2

I look after various MySQL DB's which we have recently moved to Linux servers (from Windows). They run fine and everything is good. However, this morning i needed to check the error logs, but these are now written to /var/log/syslog.

My SysAdmin is off today, and I can't for the life of me see how to read this data.

I can get the latest data fine using

tail -f /var/log/syslog

But how do I access data from 1:00 am today? or from yesterday for that matter.

I tried:

grep mysqld /var/log/syslog | less

but that shows me data from 6am onwards

I then tried

grep '^Nov  4 01' /var/log/syslog | less

but that showed me nothing but a long list of ^

  • 6
    If head /var/log/syslog gives you dates that aren't early enough, maybe old logfiles have been rotated away. Are there any other syslog* files in /var/log (that you have access to)? – Ulrich Schwarz Nov 4 '15 at 11:44
  • 1
    you were spot on, it looks like the logs got rotated just after 6am this morning, so the one I wanted was /var/log/syslog.1 – IGGt Nov 4 '15 at 14:26
  • @UlrichSchwarz may as well make that into an answer. – terdon Nov 4 '15 at 14:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.