<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wikilegacy.armadeus.com/index.php?action=history&amp;feed=atom&amp;title=Scheduling_periodic_tasks</id>
	<title>Scheduling periodic tasks - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wikilegacy.armadeus.com/index.php?action=history&amp;feed=atom&amp;title=Scheduling_periodic_tasks"/>
	<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=Scheduling_periodic_tasks&amp;action=history"/>
	<updated>2026-09-15T18:08:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>http://wikilegacy.armadeus.com/index.php?title=Scheduling_periodic_tasks&amp;diff=11886&amp;oldid=prev</id>
		<title>JulienB: /* Usage */</title>
		<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=Scheduling_periodic_tasks&amp;diff=11886&amp;oldid=prev"/>
		<updated>2013-07-08T08:21:54Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Usage&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:21, 8 July 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l78&quot;&gt;Line 78:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 78:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;0 0 * * * poweroff&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;0 0 * * * poweroff&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* By defaults crontabs are stored in &#039;&#039;/var/spool/cron/crontabs/&#039;&#039; and &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;therfore &lt;/del&gt;are lost when you powerdown the APF (&#039;&#039;/var&#039;&#039; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;in &lt;/del&gt;in RAM on APF).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* By defaults crontabs are stored in &#039;&#039;/var/spool/cron/crontabs/&#039;&#039; and &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;therefore &lt;/ins&gt;are lost when you powerdown the APF (&#039;&#039;/var&#039;&#039; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;is located &lt;/ins&gt;in RAM &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;by default &lt;/ins&gt;on APF).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Links==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Links==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* http://en.wikipedia.org/wiki/Cron&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* http://en.wikipedia.org/wiki/Cron&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>JulienB</name></author>
	</entry>
	<entry>
		<id>http://wikilegacy.armadeus.com/index.php?title=Scheduling_periodic_tasks&amp;diff=11768&amp;oldid=prev</id>
		<title>JulienB: creation</title>
		<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=Scheduling_periodic_tasks&amp;diff=11768&amp;oldid=prev"/>
		<updated>2013-04-10T14:20:03Z</updated>

		<summary type="html">&lt;p&gt;creation&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;On Linux systems, when it&amp;#039;s a matter of programming periodic tasks, the utility of choice is: &amp;#039;&amp;#039;cron&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
* It should be done by default on your APF. If not:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
$ make busybox-menuconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre class=&amp;quot;config&amp;quot;&amp;gt;&lt;br /&gt;
Miscellaneous Utilities  ---&amp;gt;&lt;br /&gt;
    [*] crond&lt;br /&gt;
    [ ]   Support option -d to redirect output to stderr&lt;br /&gt;
    [ ]   Report command output via email (using sendmail)&lt;br /&gt;
    (/var/spool/cron) crond spool directory&lt;br /&gt;
    [*] crontab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==First usage==&lt;br /&gt;
* Create a script on your APF to automatically start cron daemon at each boot, for example &amp;#039;&amp;#039;/etc/init.d/S50crond&amp;#039;&amp;#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
 &lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
        start)&lt;br /&gt;
                echo -n &amp;quot;Starting crond: &amp;quot;&lt;br /&gt;
                mkdir -p /var/spool/cron/crontabs&lt;br /&gt;
                start-stop-daemon -S -q -b -m -p /var/run/crond.pid --exec /usr/sbin/crond&lt;br /&gt;
                [ &amp;quot;$?&amp;quot; -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;OK&amp;quot; || echo &amp;quot;KO&amp;quot;&lt;br /&gt;
        ;;&lt;br /&gt;
&lt;br /&gt;
        stop)&lt;br /&gt;
                echo &amp;quot;Stopping crond&amp;quot;&lt;br /&gt;
                start-stop-daemon -K -q -p /var/run/crond.pid&lt;br /&gt;
                [ &amp;quot;$?&amp;quot; -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;OK&amp;quot; || echo &amp;quot;KO&amp;quot;&lt;br /&gt;
        ;;&lt;br /&gt;
 &lt;br /&gt;
        restart)&lt;br /&gt;
                $0 stop&lt;br /&gt;
                $0 start&lt;br /&gt;
        ;;&lt;br /&gt;
 &lt;br /&gt;
        *)&lt;br /&gt;
                echo &amp;quot;Usage: $0 {start|stop|restart}&amp;quot;&lt;br /&gt;
                exit 1&lt;br /&gt;
        ;;&lt;br /&gt;
esac&lt;br /&gt;
 &lt;br /&gt;
exit 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Give it executable rights:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
 # chmod a+x S50crond &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
* When cron daemon is started you can ask it to do periodic tasks with the help of &amp;quot;crontabs&amp;quot;. To edit a crontab do:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
 # crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* crontabs format is given here: http://en.wikipedia.org/wiki/Cron#Examples&lt;br /&gt;
* for example to log something every minute of every hour of every day of every month of every year then type:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
 * * * * * logger -t CRON &amp;quot;Hello World !&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* then by looking at /var/log/messages you should see your message printed each minute:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
# tail -f /var/log/messages&lt;br /&gt;
...&lt;br /&gt;
Apr  9 21:42:01 armadeus cron.info crond[573]: crond: USER root pid 605 cmd logger -t CRON &amp;quot;Hello World !&amp;quot;&lt;br /&gt;
Apr  9 21:42:01 armadeus user.notice CRON: Hello World !&lt;br /&gt;
...&lt;br /&gt;
Apr  9 21:43:01 armadeus cron.info crond[573]: crond: USER root pid 607 cmd logger -t CRON &amp;quot;Hello World !&amp;quot;&lt;br /&gt;
Apr  9 21:43:01 armadeus user.notice CRON: Hello World !&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* another example to poweroff your APF everyday at midnight (if your APF can control its power supply):&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
0 0 * * * poweroff&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* By defaults crontabs are stored in &amp;#039;&amp;#039;/var/spool/cron/crontabs/&amp;#039;&amp;#039; and therfore are lost when you powerdown the APF (&amp;#039;&amp;#039;/var&amp;#039;&amp;#039; in in RAM on APF).&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
* http://en.wikipedia.org/wiki/Cron&lt;/div&gt;</summary>
		<author><name>JulienB</name></author>
	</entry>
</feed>