<?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[Cronjob]]></title><description><![CDATA[<p dir="auto">Good evening</p>
<p dir="auto">I’d like to see my MagicMirror restart at a certain time each day. What should I enter in the crontrab? I have already tried x variants, but unfortunately it never worked.</p>
<pre><code>27 17 * * * Command pm2 restart mm
</code></pre>
<p dir="auto">The sudo reboot command works fine.</p>
<pre><code>27 17 * * 5 sudo poweroff
</code></pre>
]]></description><link>https://forum.magicmirror.builders/topic/10060/cronjob</link><generator>RSS for Node</generator><lastBuildDate>Tue, 11 Aug 2026 08:03:02 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/10060.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 15 Mar 2019 16:36:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Cronjob on Tue, 19 Mar 2019 05:15:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/evroom" aria-label="Profile: evroom">@<bdi>evroom</bdi></a> Many thanks for the detailed information.</p>
<p dir="auto">As you can see, I always executed the command as sudo<code> sudo crontab -e</code></p>
<p dir="auto">So I always executed the commands in the root directory. Which thus never led to success.</p>
<p dir="auto">Thanks again for the help and the detailed listing.</p>
<p dir="auto">Greeting</p>
]]></description><link>https://forum.magicmirror.builders/post/54540</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/54540</guid><dc:creator><![CDATA[CyruS1337]]></dc:creator><pubDate>Tue, 19 Mar 2019 05:15:07 GMT</pubDate></item><item><title><![CDATA[Reply to Cronjob on Mon, 18 Mar 2019 21:20:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cyrus1337" aria-label="Profile: CyruS1337">@<bdi>CyruS1337</bdi></a> said in <a href="/post/54505">Cronjob</a>:</p>
<blockquote>
<p dir="auto">I have always used the command sudo crontab -e and with this it did not work.</p>
</blockquote>
<p dir="auto">Just to clarify.</p>
<p dir="auto">Normally you are user <strong>pi</strong>: <code>$ who am I</code></p>
<p dir="auto">So <code>crontab -e</code> will work for the <strong>pi</strong> user.<br />
Using <code>sudo crontab -e</code> will change the crontab for the <strong>root</strong> user.</p>
<p dir="auto">Now how can you tell what is what ?</p>
<p dir="auto">For the user <strong>pi</strong>:<br />
<code>$ sudo crontab -l -u pi</code><br />
which is the same as<br />
<code>$ crontab -l</code><br />
For the user <strong>root</strong>:<br />
<code>$ sudo crontab -l -u root</code></p>
<p dir="auto">Furthermore, when you have activated the <strong>root</strong> crontab, then the command will run as <strong>root</strong>, in the <strong>root</strong> (<strong>/</strong>) directory.<br />
In this case <code>pm2 reload</code> command will search for the <code>mm.sh</code> script under <code>/</code> and will not find it.<br />
Whereas when activated the <strong>pi</strong> crontab, the <code>mm.sh</code> script will be searched in the <code>/home/pi</code> directory, where it should be, and it will work.</p>
<p dir="auto">Use <code>pm2 show mm</code>to show the details on mm under pm2.<br />
Then you will understand it better.</p>
<p dir="auto">Cron messages normally are directed to <code>/var/log/cron.log</code>, but on my system it is not directed:</p>
<pre><code>$ grep cron /etc/rsyslog.conf
#cron.*				/var/log/cron.log
</code></pre>
<p dir="auto">To see the cron messages, when not in cron.log:</p>
<pre><code>$ tail -F /var/log/syslog | grep CRON
</code></pre>
<p dir="auto">[ On my system I see CRON messages for root, although I do not have root crontab entries. There is a crond running that runs alongside <code>$ systemctl status cron</code>.]</p>
<p dir="auto">Have fun :-)</p>
]]></description><link>https://forum.magicmirror.builders/post/54518</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/54518</guid><dc:creator><![CDATA[evroom]]></dc:creator><pubDate>Mon, 18 Mar 2019 21:20:59 GMT</pubDate></item><item><title><![CDATA[Reply to Cronjob on Mon, 18 Mar 2019 19:18:05 GMT]]></title><description><![CDATA[<p dir="auto">Glad it worked! :smiling_face_with_open_mouth:</p>
]]></description><link>https://forum.magicmirror.builders/post/54507</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/54507</guid><dc:creator><![CDATA[MadScientist]]></dc:creator><pubDate>Mon, 18 Mar 2019 19:18:05 GMT</pubDate></item><item><title><![CDATA[Reply to Cronjob on Mon, 18 Mar 2019 18:46:12 GMT]]></title><description><![CDATA[<p dir="auto">Juhuiiiii, finally it worked. Many Thanks</p>
<p dir="auto">I have always used the command <code> sudo crontab -e</code> and with this it did not work.</p>
<p dir="auto">It works fine with the <code> crontab -e</code> command and then <code>0 6 * * * pm2 reload mm</code></p>
<p dir="auto">Once again, thank you very much for your help!!!</p>
]]></description><link>https://forum.magicmirror.builders/post/54505</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/54505</guid><dc:creator><![CDATA[CyruS1337]]></dc:creator><pubDate>Mon, 18 Mar 2019 18:46:12 GMT</pubDate></item><item><title><![CDATA[Reply to Cronjob on Mon, 18 Mar 2019 16:19:19 GMT]]></title><description><![CDATA[<p dir="auto">This is my crontab:</p>
<pre><code># daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
0 6 * * * pm2 reload mm



</code></pre>
<p dir="auto">Are you running <code>crontab -e</code>with sudo? Because you have to run it as the user that runs MM (= most likely without sudo).</p>
<p dir="auto">Edit: <a class="plugin-mentions-user plugin-mentions-a" href="/user/zwirbel" aria-label="Profile: Zwirbel">@<bdi>Zwirbel</bdi></a>: For me it works using a cronjob. See what I wrote above and if you have questions regarding crontab, just ask again.</p>
]]></description><link>https://forum.magicmirror.builders/post/54500</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/54500</guid><dc:creator><![CDATA[MadScientist]]></dc:creator><pubDate>Mon, 18 Mar 2019 16:19:19 GMT</pubDate></item><item><title><![CDATA[Reply to Cronjob on Mon, 18 Mar 2019 16:08:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/madscientist" aria-label="Profile: MadScientist">@<bdi>MadScientist</bdi></a> said in <a href="/post/54481">Cronjob</a>:</p>
<blockquote>
<p dir="auto">55 19 * * * pm2 reload mm</p>
</blockquote>
<p dir="auto">The command works in the console <code> pm2 reload mm</code></p>
<p dir="auto">If I add it in the cron job, it will not do any reload.</p>
<p dir="auto">Here is the excerpt from the crontab</p>
<pre><code># Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
#
#MONTAG BIS SONNTAG UM 17:02 MAGICMIRROR RELOAD
02 17 * * * pm2 reload mm
#

</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/54498</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/54498</guid><dc:creator><![CDATA[CyruS1337]]></dc:creator><pubDate>Mon, 18 Mar 2019 16:08:22 GMT</pubDate></item><item><title><![CDATA[Reply to Cronjob on Mon, 18 Mar 2019 12:37:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/madscientist" aria-label="Profile: MadScientist">@<bdi>MadScientist</bdi></a> : Is there a way to automatically reload MM once or twice a day? I have similar problems with the Netatmo module, which doesn’t pick up new data in the morning (as my WLAN is turned off during the night). A reload fixes this, but I would rather have this automatically (e.g. at 06:00 in the morning for example).</p>
<p dir="auto">Maybe a simple script would help, but I don’t know where to put it.</p>
]]></description><link>https://forum.magicmirror.builders/post/54488</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/54488</guid><dc:creator><![CDATA[Zwirbel]]></dc:creator><pubDate>Mon, 18 Mar 2019 12:37:19 GMT</pubDate></item><item><title><![CDATA[Reply to Cronjob on Mon, 18 Mar 2019 12:02:32 GMT]]></title><description><![CDATA[<p dir="auto">Perfect, did not know that I can reload the MagicMirror. Have always made a restart in the past. I’ll give feedback this evening on whether the cronjob works with the <code>pm2 reload mm</code> command</p>
]]></description><link>https://forum.magicmirror.builders/post/54487</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/54487</guid><dc:creator><![CDATA[CyruS1337]]></dc:creator><pubDate>Mon, 18 Mar 2019 12:02:32 GMT</pubDate></item><item><title><![CDATA[Reply to Cronjob on Mon, 18 Mar 2019 11:54:42 GMT]]></title><description><![CDATA[<p dir="auto">Depennding on the other modules you’re using it might be good to reload MM more than once a day. In my case once is enough. Without reloading the screen turns black after more than one day. Depending on your setup it could be better to reload it twice or 4 times a day. In the end the reload is very quick and you won’t notice anything.</p>
]]></description><link>https://forum.magicmirror.builders/post/54486</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/54486</guid><dc:creator><![CDATA[MadScientist]]></dc:creator><pubDate>Mon, 18 Mar 2019 11:54:42 GMT</pubDate></item><item><title><![CDATA[Reply to Cronjob on Mon, 18 Mar 2019 11:50:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/madscientist" aria-label="Profile: MadScientist">@<bdi>MadScientist</bdi></a> said in <a href="/post/54481">Cronjob</a>:</p>
<blockquote>
<p dir="auto">Are you using the GoogleMapsTraffic module? In that case the pm2 reload mm will do. Or a simple Ctrl+R on the mirror. The cronjob should then look something like 55 19 * * * pm2 reload mm (mine is 0 6 * * * pm2 reload mm and it works flawlessly).</p>
</blockquote>
<p dir="auto">Exactly, I use the modules GoogleMapsTraffi on these two monitors and these two monitors will not wake up after a while, if I turned off the monitors for several hours.</p>
<p dir="auto">Then tonight I will try <code>pm2 reload mm</code>. Unfortunately, the command <code> pm2 restart mm</code> did not work. Then I’m curious.</p>
]]></description><link>https://forum.magicmirror.builders/post/54484</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/54484</guid><dc:creator><![CDATA[CyruS1337]]></dc:creator><pubDate>Mon, 18 Mar 2019 11:50:39 GMT</pubDate></item><item><title><![CDATA[Reply to Cronjob on Mon, 18 Mar 2019 11:34:58 GMT]]></title><description><![CDATA[<p dir="auto">Are you using the GoogleMapsTraffic module? In that case the <code>pm2 reload mm</code> will do. Or a simple Ctrl+R on the mirror. The cronjob should then look something like <code>55 19 * * * pm2 reload mm</code> (mine is <code>0 6 * * * pm2 reload mm</code> and it works flawlessly).</p>
]]></description><link>https://forum.magicmirror.builders/post/54481</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/54481</guid><dc:creator><![CDATA[MadScientist]]></dc:creator><pubDate>Mon, 18 Mar 2019 11:34:58 GMT</pubDate></item><item><title><![CDATA[Reply to Cronjob on Mon, 18 Mar 2019 11:27:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/madscientist" aria-label="Profile: MadScientist">@<bdi>MadScientist</bdi></a> said in <a href="/post/54352">Cronjob</a>:</p>
<blockquote>
<p dir="auto">Why do you want to restart MM? Maybe pm2 reload mmis the better option.</p>
</blockquote>
<p dir="auto">Why … that’s actually a good question. The problem is that if I bring the screens for about 5-6 hours and then turn back on that no picture appears on the monitors. Therefore, I would like a regular restart of my MagicMirros.</p>
]]></description><link>https://forum.magicmirror.builders/post/54480</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/54480</guid><dc:creator><![CDATA[CyruS1337]]></dc:creator><pubDate>Mon, 18 Mar 2019 11:27:07 GMT</pubDate></item><item><title><![CDATA[Reply to Cronjob on Fri, 15 Mar 2019 20:27:33 GMT]]></title><description><![CDATA[<p dir="auto">Why do you want to restart MM? Maybe <code> pm2 reload mm</code>is the better option.</p>
]]></description><link>https://forum.magicmirror.builders/post/54352</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/54352</guid><dc:creator><![CDATA[MadScientist]]></dc:creator><pubDate>Fri, 15 Mar 2019 20:27:33 GMT</pubDate></item><item><title><![CDATA[Reply to Cronjob on Fri, 15 Mar 2019 19:29:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cyrus1337" aria-label="Profile: CyruS1337">@<bdi>CyruS1337</bdi></a> said in <a href="/post/54349">Cronjob</a>:</p>
<blockquote>
<p dir="auto">Thanks for the link, but it still does not work :(</p>
<pre><code># Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
#
#MONTAG BIS SONNTAG UM 19:55 MAGICMIRROR RESTART
55 19 * * * pm2 restart mm.sh &gt;/dev/null 2&gt;&amp;1
#
#SAMSTAG REBOOT UM 12:00 MAGICMIRROR REBOOT
24 17 * * * sudo reboot
#
</code></pre>
</blockquote>
<p dir="auto">Sounds strange. Maybe you first have to stop the pm2 process before restart, with pm2 stop <a href="http://mm.sh" target="_blank" rel="noopener noreferrer nofollow ugc">mm.sh</a>. Don’t forget to complete the line für den reboot am Samstag - sudo reboot &gt;/dev/null 2&gt;&amp;1<br />
regards Michael</p>
]]></description><link>https://forum.magicmirror.builders/post/54350</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/54350</guid><dc:creator><![CDATA[garbleflux]]></dc:creator><pubDate>Fri, 15 Mar 2019 19:29:24 GMT</pubDate></item><item><title><![CDATA[Reply to Cronjob on Fri, 15 Mar 2019 18:56:58 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for the link, but it still does not work :(</p>
<pre><code># Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
#
#MONTAG BIS SONNTAG UM 19:55 MAGICMIRROR RESTART
55 19 * * * pm2 restart mm.sh &gt;/dev/null 2&gt;&amp;1
#
#SAMSTAG REBOOT UM 12:00 MAGICMIRROR REBOOT
24 17 * * * sudo reboot
#
</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/54349</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/54349</guid><dc:creator><![CDATA[CyruS1337]]></dc:creator><pubDate>Fri, 15 Mar 2019 18:56:58 GMT</pubDate></item><item><title><![CDATA[Reply to Cronjob on Fri, 15 Mar 2019 18:19:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cyrus1337" aria-label="Profile: CyruS1337">@<bdi>CyruS1337</bdi></a> said in <a href="/post/54344">Cronjob</a>:</p>
<blockquote>
<p dir="auto">Good evening</p>
<p dir="auto">I’d like to see my MagicMirror restart at a certain time each day. What should I enter in the crontrab? I have already tried x variants, but unfortunately it never worked.</p>
<pre><code>27 17 * * * Command pm2 restart mm
</code></pre>
<p dir="auto">The sudo reboot command works fine.</p>
<pre><code>27 17 * * 5 sudo poweroff
</code></pre>
</blockquote>
<p dir="auto">Did you forget to write the full command? Try pm2 restart <a href="http://mm.sh" target="_blank" rel="noopener noreferrer nofollow ugc">mm.sh</a><br />
By the way: I prefere the online crontab generator (<a href="https://crontab-generator.org/" target="_blank" rel="noopener noreferrer nofollow ugc">https://crontab-generator.org/</a>). It’s very easy.<br />
Regards Mike</p>
]]></description><link>https://forum.magicmirror.builders/post/54347</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/54347</guid><dc:creator><![CDATA[garbleflux]]></dc:creator><pubDate>Fri, 15 Mar 2019 18:19:33 GMT</pubDate></item></channel></rss>