Difference between revisions of "SUNScholar/Optimisations/Error Logs"

From Libopedia
Jump to navigation Jump to search
Line 1: Line 1:
 
To inform ourselves of errors on a daily basis, a script was written and is run daily to email us the error output of the logs.
 
To inform ourselves of errors on a daily basis, a script was written and is run daily to email us the error output of the logs.
  
 +
Follow the procedure below to perform the same.
 +
 +
#Login as the dspace user.
 +
#Type the following:
 +
nano /home/dspace/scripts/error-logs
 +
#Copy and paste the following:
 
<pre>
 
<pre>
 
#!/bin/bash
 
#!/bin/bash
Line 15: Line 21:
 
rm -f /tmp/cocoon-error.log
 
rm -f /tmp/cocoon-error.log
 
</pre>
 
</pre>
 +
{{NANO}}

Revision as of 15:04, 1 April 2013

To inform ourselves of errors on a daily basis, a script was written and is run daily to email us the error output of the logs.

Follow the procedure below to perform the same.

  1. Login as the dspace user.
  2. Type the following:
nano /home/dspace/scripts/error-logs
  1. Copy and paste the following:
#!/bin/bash

TODAY=`date +%F`
LIST="root,ismith@sun.ac.za,plt@sun.ac.za"

cd /home/dspace/log
cat dspace.log.$TODAY | grep -v INFO > /tmp/dspace-error.log
cat cocoon.log.$TODAY | grep -v INFO > /tmp/cocoon-error.log
cat /tmp/dspace-error.log | mail -s "Error log for SUNScholar" $LIST
cat /tmp/cocoon-error.log | mail -s "Error log for SUNScholar XMLUI" $LIST
rm -f /tmp/dspace-error.log
rm -f /tmp/cocoon-error.log

NANO Editor Help
CTL+O = Save the file and then press Enter
CTL+X = Exit "nano"
CTL+K = Delete line
CTL+U = Undelete line
CTL+W = Search for %%string%%
CTL+\ = Search for %%string%% and replace with $$string$$
CTL+C = Show line numbers

More info = http://en.wikipedia.org/wiki/Nano_(text_editor)