snipt

Ctrl+h for KB shortcuts

Bash

bash timestamp variable

$ timestamp=`date +%Y-%m-%d`
https://snipt.net/embed/eb10fc5079f4c1c18ce8a178759f8f36/
https://snipt.net/raw/eb10fc5079f4c1c18ce8a178759f8f36/
eb10fc5079f4c1c18ce8a178759f8f36
bash
Bash
1
2016-09-21T13:18:46
True
False
False
/api/public/snipt/20779/
bash-timestamp-variable
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nv">$ timestamp</span><span class="o">=</span><span class="sb">`</span>date +%Y-%m-%d<span class="sb">`</span> </span></pre></div> </td></tr></table>
backup, logs, script, time, timestamp

Bash

path, dv2

Logs -/home/httpd/vhosts/mt-example.com/statistics/logs
https://snipt.net/embed/9645920c361eac524c170d09a64089ae/
https://snipt.net/raw/9645920c361eac524c170d09a64089ae/
9645920c361eac524c170d09a64089ae
bash
Bash
1
2016-09-22T02:26:25
True
False
False
/api/public/snipt/5083/
path-dv2
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>Logs -/home/httpd/vhosts/mt-example.com/statistics/logs </span></pre></div> </td></tr></table>
dv, dv2, logs, path

Bash

commandline search server logs for activity in time frame

1
2
3
4
5
# following date/time is day/month/year:hour:min:sec
# as in 02/Feb/2009:23:59:59
# leave off more for a broader range like:
# 02/Feb/2009:0   ...here's mine:   [your structure may vary]
grep -rn "26/Sep/2008:01:" /usr/local/apache/domlogs/*
https://snipt.net/embed/e1d88fde101d30ce6e6fe8f747167b5c/
https://snipt.net/raw/e1d88fde101d30ce6e6fe8f747167b5c/
e1d88fde101d30ce6e6fe8f747167b5c
bash
Bash
5
2016-09-22T00:49:45
True
False
False
/api/public/snipt/3179/
commandline-search-server-logs-for-activity-in-time-frame
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="c"># following date/time is day/month/year:hour:min:sec</span> </span><span id="L-2"><a name="L-2"></a><span class="c"># as in 02/Feb/2009:23:59:59</span> </span><span id="L-3"><a name="L-3"></a><span class="c"># leave off more for a broader range like:</span> </span><span id="L-4"><a name="L-4"></a><span class="c"># 02/Feb/2009:0 ...here&#39;s mine: [your structure may vary]</span> </span><span id="L-5"><a name="L-5"></a>grep -rn <span class="s2">&quot;26/Sep/2008:01:&quot;</span> /usr/local/apache/domlogs/* </span></pre></div> </td></tr></table>
commandline, date, grep, linux, logs, range, server, web, webserver

Text only

Watch Apache Error Log

tail -f /usr/local/apache/logs/error_log
https://snipt.net/embed/66b0347c6206fcc7bb7085751a8e1d71/
https://snipt.net/raw/66b0347c6206fcc7bb7085751a8e1d71/
66b0347c6206fcc7bb7085751a8e1d71
text
Text only
1
2016-09-22T04:38:27
True
False
False
/api/public/snipt/2218/
watch-apache-error-log
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>tail -f /usr/local/apache/logs/error_log </span></pre></div> </td></tr></table>
apache, logs

Text only

View MySQL Log

less /var/log/mysqld.log
https://snipt.net/embed/28489622a5ac00bad95d6df2bc2f72e0/
https://snipt.net/raw/28489622a5ac00bad95d6df2bc2f72e0/
28489622a5ac00bad95d6df2bc2f72e0
text
Text only
1
2016-09-22T11:32:25
True
False
False
/api/public/snipt/2215/
view-mysql-log
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>less /var/log/mysqld.log </span></pre></div> </td></tr></table>
logs, mysql

Text only

For a typical qmail installation with Plesk, you can monitor the logs with the following command:

tail -f /usr/local/psa/var/log/maillog
https://snipt.net/embed/d783deaa222dfbb18c8740b16d23a479/
https://snipt.net/raw/d783deaa222dfbb18c8740b16d23a479/
d783deaa222dfbb18c8740b16d23a479
text
Text only
1
2016-09-24T06:40:12
True
False
False
/api/public/snipt/2203/
for-a-typical-qmail-installation-with-plesk-you-can-monitor-the-logs-with-the-following-command
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>tail -f /usr/local/psa/var/log/maillog </span></pre></div> </td></tr></table>
logs, mail, plesk, qmail
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.