<link linkend="fcrontab.5">&fcrontab;(5),</link> and choose the
type of line which is the most appropriate for your needs (this is
likely to be a @-line or a %-line).</para>
- <para>However if you do want to emulate an anacron entry of the form:</para>
+ <para>On a Debian/Ubuntu, the default /etc/anacrontab looks like:<para>
+<programlisting>1 5 cron.daily nice run-parts --report /etc/cron.daily
+7 10 cron.weekly nice run-parts --report /etc/cron.weekly
+@monthly 15 cron.monthly nice run-parts --report /etc/cron.monthly
+</programlisting>
+ <para>A close fcron equivalent would be (see &optserial;):<para>
+<programlisting># Run once a day/week/month, and ensure only one of those tasks is run at a time:
+!reset
+!serial,nice(10)
+%daily * * run-parts --report /etc/cron.daily
+%weekly * * run-parts --report /etc/cron.weekly
+%monthly * * * run-parts --report /etc/cron.monthly</programlisting>
+ <para>Or you could go for something a bit more specific (see &optlavg;, &optnoticenotrun;):<para>
+<programlisting># Only run the tasks out of office-hours when the system load is low
+# and send an email to the user if fcron couldn't run the job:
+!reset
+!serial,lavg(0.5,1,1.5),noticenotrun,nice(10),mailto(admin@yourdomain.com)
+%daily * 0-9,18-23 run-parts --report /etc/cron.daily
+%weekly * 0-9,18-23 run-parts --report /etc/cron.weekly
+%monthly * 0-9,18-23 * run-parts --report /etc/cron.monthly</programlisting>
+ <para>Also, if you do want to emulate an anacron entry of the form:</para>
<programlisting>0 delay job-identity /your/command</programlisting>
- <para>then use something as:</para>
+ <para>then you can use something as:</para>
<programlisting>@runonce delay /your/command</programlisting>
- <para>If you use a non-zero anacron period/period_name (i.e. if you
- don't want your task to be run every day), then
- you should use a %daily, %monthly or %weekly line. If
- this doesn't emulate an anacron entry as closely as you would like,
- you may want to try a %hours or %days line, and/or &optrunfreq;.</para>
- <para>In any case, you could benefit from using fcron options such as
- &optserial; or &optlavg;.</para>
</answer>
</qandaentry>
<qandaentry>
<listitem>
<para><emphasis><type>boolean</type></emphasis>(<constant>false</constant>)</para>
<para>If set to true, the task will be run at system startup (i.e. immediately after the &argfirstsleep; delay -- by default, &firstsleep; seconds -- when the &fcron; daemon starts the first time after the OS has booted). This is in addition to the regular schedule which won't be modified by this option.</para>
+ <para>For instance, if a program should be started automatically and run from 7am to 6pm, you could use the following dfcrontab definitions:</para>
+ <programlisting>&runatreboot 0 6 * * 1-5 start_my_program.sh
+& 0 7 * * 1-5 stop_my_program.sh</programlisting>
<para>&seealso; options &optvolatile;, &optrunonce;, &optrebootreset;.</para>
</listitem>
</varlistentry>
<sect2>
<title>High priority</title>
<itemizedlist>
- <listitem>
- <para>change copyright to ...,2008,2009,2010</para>
- </listitem>
<listitem>
<para>could be worth checking fcron for memory leaks using specialized library (just in case...)</para>
</listitem>
<listitem>
<para>option to put a maximum limit on the execution time of a task + terminate it if not finished yet + send email to let the user know</para>
</listitem>
- <listitem>
- <para>@reboot: don't run the job the first time it is loaded by fcron after having been created -- otherwise we can't use fcron as a 'rc' start/stop script for users without root privileges</para>
- </listitem>
<listitem>
<para>jitter feature: if 100 jobs to be started at the same minute, then make them start at a random second of that minute to limit load spikes (see BSD cron jitter feature)</para>
</listitem>
<listitem>
<para>find way to have the non translated pages of the French translation be updated automatically (changes, todo, etc -> copied from the English doc)</para>
</listitem>
- <listitem>
- <para>add support Vixie cron's @reboot, @yearly, ... (in fileconf.c:read_file(), add a strncmp() at the beginning of the while() to do s/@reboot/@volatile,first(1) big value/, s/@yearly/0 0 1 1 */, ...) (+ add sthg such as a period of 0 so as a @reboot line can never be run again ?)</para>
- </listitem>
</itemizedlist>
</sect2>
<sect2>