From fe155fe1a3429d052c83383f6037931a2998794f Mon Sep 17 00:00:00 2001 From: Thibault Godouet Date: Fri, 24 Sep 2010 17:10:04 +0100 Subject: [PATCH] Updated doc: todo, FAQ entry on anacron, runatreboot example --- doc/en/faq.sgml | 31 ++++++++++++++++++++++--------- doc/en/fcrontab.5.sgml | 3 +++ doc/en/todo.sgml | 9 --------- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/doc/en/faq.sgml b/doc/en/faq.sgml index 375de75..52cc385 100644 --- a/doc/en/faq.sgml +++ b/doc/en/faq.sgml @@ -351,17 +351,30 @@ and set appropriately the paths: &fcrontab;(5), and choose the type of line which is the most appropriate for your needs (this is likely to be a @-line or a %-line). - However if you do want to emulate an anacron entry of the form: + On a Debian/Ubuntu, the default /etc/anacrontab looks like: +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 + + A close fcron equivalent would be (see &optserial;): +# 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 + Or you could go for something a bit more specific (see &optlavg;, &optnoticenotrun;): +# 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 + Also, if you do want to emulate an anacron entry of the form: 0 delay job-identity /your/command - then use something as: + then you can use something as: @runonce delay /your/command - 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;. - In any case, you could benefit from using fcron options such as - &optserial; or &optlavg;. diff --git a/doc/en/fcrontab.5.sgml b/doc/en/fcrontab.5.sgml index 3da0cb0..8f1f57a 100644 --- a/doc/en/fcrontab.5.sgml +++ b/doc/en/fcrontab.5.sgml @@ -766,6 +766,9 @@ permissions and environment (only root is allowed to use this option). boolean(false) 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. + For instance, if a program should be started automatically and run from 7am to 6pm, you could use the following dfcrontab definitions: + &runatreboot 0 6 * * 1-5 start_my_program.sh +& 0 7 * * 1-5 stop_my_program.sh &seealso; options &optvolatile;, &optrunonce;, &optrebootreset;. diff --git a/doc/en/todo.sgml b/doc/en/todo.sgml index e587fde..28ff393 100644 --- a/doc/en/todo.sgml +++ b/doc/en/todo.sgml @@ -24,18 +24,12 @@ A copy of the license is included in gfdl.sgml. High priority - - change copyright to ...,2008,2009,2010 - could be worth checking fcron for memory leaks using specialized library (just in case...) 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 - - @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 - 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) @@ -48,9 +42,6 @@ A copy of the license is included in gfdl.sgml. find way to have the non translated pages of the French translation be updated automatically (changes, todo, etc -> copied from the English doc) - - 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 ?) - -- 2.40.0