<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[Resolved] Crontab task not running.]]></title><description><![CDATA[<p dir="auto">Hello Everyone,<br />
I am trying hard to make a script to run under crontab but for some reason, it doesn't work.</p>
<p dir="auto">Here the crontab entry (using GUI)</p>
<pre><code>1	*	*	*	*	root	/usr/bin/nice -n20 /etc/LCDmonitor.sh
</code></pre>
<p dir="auto">and here the script:</p>
<pre><code>-rwxr-xr-x  1 root  wheel  1277 May 10 18:28 /etc/LCDmonitor.sh
</code></pre>
<pre><code>#!/usr/bin/env sh

# Cheking if LCDd daemon service is installed.
if [ ! -d /usr/local/share/pfSense-pkg-LCDproc ]; then {
echo "Service not installed"; 
exit;
}
fi

#Checking if LCDd Daemon service is Running
if [ ! `/bin/pgrep -x "LCDd"` ]; then echo "LCD Daemon is not running - Start it from GUI"; exit
else
echo "The LCDd Daemon is running"
fi

# Checking if we have duplicated client processes
NOP=`/bin/ps -ax | /usr/bin/grep -I lcdproc_client.php | /usr/bin/grep -v "grep" |wc -l`
# If there are more than 1 process, then print message
if [ $NOP -gt 1 ] ; then echo "More than 1 process is running - Killing Processes and restarting the service";
/bin/ps -A | /usr/bin/grep lcdproc_client.php | /usr/bin/grep -v "grep" | /usr/bin/awk '{print $1}' | /usr/bin/xargs kill -9 $1 
/bin/sleep 2
#Restating the LCDd client
/usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php &amp;
fi

# If there is no client started, We start a single one.
if [ $NOP -eq 0 ] ; then echo "No client process is running - Starting one";
#Starting the LCDd client
/usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php &amp;
echo "A single LCDd client was started"
fi

# If there is a single client process then print message
if [ $NOP -eq 1 ] ; then echo "OK - A single client process is running";
fi
</code></pre>
<p dir="auto">Everything works fine using the Shell, but not under cron.<br />
I have checked an re-checked the paths for the commands. Just don't know what to do anymore.</p>
<p dir="auto">Any help is very welcome!</p>
<p dir="auto">Thanks<br />
Fabricio.</p>
]]></description><link>https://forum.netgate.com/topic/143264/resolved-crontab-task-not-running</link><generator>RSS for Node</generator><lastBuildDate>Sat, 10 Oct 2026 04:53:46 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/143264.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 10 May 2019 21:32:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [Resolved] Crontab task not running. on Mon, 13 May 2019 14:47:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kom">@<bdi>KOM</bdi></a>    hello KOM, ... Nice. that did the trick!  Not sure why, but it worked.<br />
Also, I got another issue on my script.  I was missing the full path for the wc command.<br />
Thanks!! Appreciate the tip!</p>
<p dir="auto">Fabricio.</p>
]]></description><link>https://forum.netgate.com/post/842649</link><guid isPermaLink="true">https://forum.netgate.com/post/842649</guid><dc:creator><![CDATA[fabricioguzzy]]></dc:creator><pubDate>Mon, 13 May 2019 14:47:55 GMT</pubDate></item><item><title><![CDATA[Reply to [Resolved] Crontab task not running. on Sat, 11 May 2019 01:20:47 GMT]]></title><description><![CDATA[<p dir="auto">Try running your script from /usr/local/bin instead of /etc.  I can get it to work from there with a 1/* for the minute instead of just 1.</p>
]]></description><link>https://forum.netgate.com/post/842299</link><guid isPermaLink="true">https://forum.netgate.com/post/842299</guid><dc:creator><![CDATA[KOM]]></dc:creator><pubDate>Sat, 11 May 2019 01:20:47 GMT</pubDate></item></channel></rss>