]> granicus.if.org Git - fcron/commitdiff
updated
authorthib <thib>
Sun, 27 Jan 2002 16:36:28 +0000 (16:36 +0000)
committerthib <thib>
Sun, 27 Jan 2002 16:36:28 +0000 (16:36 +0000)
doc/en/faq.sgml

index 3d31818515b789fb08ee814a32bd48c4a458ce71..9f262d41717b748bce5e7c904a6286e4c642d572 100644 (file)
@@ -8,23 +8,66 @@ Foundation.
 A copy of the license is included in gfdl.sgml.
 -->
 
-<!-- $Id: faq.sgml,v 1.1 2002-01-03 14:26:53 thib Exp $ -->
+<!-- $Id: faq.sgml,v 1.2 2002-01-27 16:36:28 thib Exp $ -->
 
 <sect1 id="faq">
     <title>Frequently Asked Questions</title>
-    <para>This FAQ intends to complete the man pages by providing a more practical approach.</para>
+    <para>This FAQ intends to complement the man pages by following
+          a more practical approach.</para>
     <para>If you think a QA should be added, please mail me it !</para>
     <qandaset>
        <qandaentry>
            <question>
-               <para>How does fcron handle system clock adjusts (daylight savings, etc) ?</para>
+               <para>How does fcron handle system clock adjustments (daylight savings, etc) ?</para>
            </question>
            <answer>
-               <para>First, you must know that fcron determines for each job the next time and date of execution, and then, sleep until a job should be run. In other words, fcron doesn't wake up like Vixie cron each minute to check all job in case one should be run ... and it avoids some problems concerning the clock adjusts.</para>
-               <para>That means that if the new time value is in the past, fcron won't run jobs twice. For instance it is 3:00, so the next job cannot be schedule before 3:00 (it would already has been run and re-scheduled), and you put your clock at 2:00 : fcron will just sleep until the next job should be executed, so after (and including) 3:01.</para>
-               <para>Now if you set the new time value in the future, fcron will run every jobs between the old and the new time value once. When fcron wakes up to run a job after the time value has changed, it runs all the jobs which  should have run during the interval because they are scheduled to run in a past time.</para>
-               <para>You must also know that the @-jobs will run at "adjust-interval" too early or too late depending of the nature of the adjust.</para>
-               <para>To conclude, fcron behaves quite well for small clock adjusts : each job which should have run do run once, but not exactly at the correct time if the job was scheduled in the interval of the adjust. But if you have to make a big change in the time and date, you should probably reset all the scheduled "nextexe" by running "fcrontab -z" on all the fcrontabs.</para>
+               <para>
+       First, you must understand that fcron determines, for each job,
+       its next time and date of execution.
+       It then determines which of those jobs would be the next to 
+       run and then, sleeps until that job should be run.
+       In other words, fcron doesn't wake up like Vixie cron each
+       minute to check all job in case one should be run ... 
+       and it avoids some problems associated with clock adjusts.</para>
+               <para>
+       This means that if the new time value is set into the past,
+       fcron won't run a particular job again.
+       For instance, suppose the real time and system clock are
+       3:00, so the next job cannot be scheduled to run before 3:00,
+       as it would have already been run and re-scheduled.</para>
+    <para>
+       First, suppose you set your system clock into the past, say to 2:00,
+       Presuming that the last run was shortly before 3:00.
+       then fcron will sleep until the next job should be executed.
+       The execution time for a job is determined by identifying the 
+       last time that the job ran and computing the next scheduled time.
+       This means that the next scheduled time must be
+       on or after 3:01.
+       Therefore, in this example, fcron will not run a job for at
+       least one hour.</para>
+               <para>
+       Next, if you set the system time into the future, say to 4:00, fcron will
+       run every job scheduled between the old and the new time value once,
+       regardless of how many times it would have been scheduled.
+       When fcron wakes up to run a job after the time value has changed,
+       it runs all the jobs which should have run during the interval
+       because they are scheduled to run in a past time.</para>
+               <para>
+       As special case is when "@xxx" style scheduling rules are involved,
+       you must consider the "adjustment-interval".
+       The "adjustment-interval" is the time difference between the
+       original system time and the new system time.
+       If the ... <!-- I need some help here.  What would happen? -->
+       run at "adjust-interval" too early or too late depending
+       of the nature of the adjust.</para>
+               <para>
+       To conclude, fcron behaves quite well for small clock adjusts.
+       Each job which should have run does so once, but not exactly
+       at the correct time as if the job were scheduled within the 
+       adjustment interval.
+       But, if you have to make a big change in the time and date,
+       you should probably reset all the scheduled "nextexe"
+       by running "fcrontab -z" on all the fcrontabs.</para>
            </answer>
        </qandaentry>
        <qandaentry>
@@ -32,34 +75,91 @@ A copy of the license is included in gfdl.sgml.
                <para>How can I use fcrontab in scripts ?</para>
            </question>
            <answer>
-               <para>You can use pipes with "<command>fcrontab -l</command>" (list the fcrontab) and "<command>fcrontab -</command>" (read the new fcrontab from input). For example : </para>
+               <para>
+      You can use pipes with "<command>fcrontab -l</command>" 
+      (list the fcrontab) and "<command>fcrontab -</command>"
+      (read the new fcrontab from input).
+      For example : </para>
                <screen><command>echo -e "`fcrontab -l | grep -v exim`\n0 * * * *       /usr/sbin/exim -q" | fcrontab -</command></screen>
                <para>
-                   can be used to add a line. Another way to do it would be to  list the fcrontab to a tmp file ("<command>fcrontab -l > tmpfile</command>"), then modify that file ("<command>echo $LINE >> tmpfile</command>") and finally replace the existing fcrontab by that one and remove the tmp file ("<command>fcrontab tmpfile ; rm -f tmpfile</command>").
+                 can be used to add a line.
+      Another way to do it would be to:
+      list the fcrontab settings into a temporary file 
+      ("<command>fcrontab -l > tmpfile</command>");
+      modify the temporary file ("<command>echo $LINE >> tmpfile</command>");
+      replace the original fcrontab by the temporary; and finally,
+      remove the temporary file ("<command>fcrontab tmpfile ; rm -f tmpfile</command>").
                </para>
            </answer>
        </qandaentry>
        <qandaentry>
            <question>
-               <para>How can I prevent fcrontab from considering the first word of my command line as "runas(word)" ?</para>
+               <para>How can I prevent fcrontab from considering the first "word"
+      of my command line as a user name i.e. "runas(word)" ?</para>
            </question>
            <answer>
-               <para>Suppose you have an user called "echo" (weird idea ... :)) ). If you use the line '* * * * * echo "Hello !"' in root's fcrontab,
+               <para>
+      Suppose you have an user called "echo" (weird idea ... :)) ).
+      If you use the line '* * * * * echo "Hello !"' in root's fcrontab,
       "echo" will be interpreted as "runas(echo)".</para>
-               <para>To avoid that, put your command in quotes :
+               <para>To suppress that, put your command in quotes :
                    <programlisting>* * * * * 'echo "Hello !"'</programlisting>
-      will work as expected (quotes are allowed for the shell command but not  for the user name).</para>
+      will work as expected as quotes are allowed for the shell command
+      but not for the user name.</para>
            </answer>
        </qandaentry>
+
        <qandaentry>
            <question>
-               <para>I have a job which usually terminates with a non-zero status, and I receive a mail with the exit status even if the command had no output : how can I avoid that ?</para>
+               <para>
+       I have a job which usually terminates with a non-zero status.
+       When it does, I receive a mail with the exit status even if the command had no output.
+       How can I avoid the mail?</para>
            </question>
            <answer>
-               <para>The easiest way is sure to set the option "mail" to "no". But if you still want to receive the output if there is one, you can add a command like "/bin/true" after your job to force the status to be 0, without affecting your job nor creating an output. For instance :</para>
+               <para>
+      You could disable mail entirely by setting the "mail" option to "no".
+      But, if you still want to receive the standard output as mail,
+      you can add an command which always evaluates to 0, like "/bin/true",
+      after your primary command.
+      This will not affect your job nor create additional output.
+      For example:</para>
                <programlisting>* * * * * /a/non/zero/status/job ; /bin/true</programlisting>
            </answer>
        </qandaentry>
+
+       <qandaentry>
+           <question>
+               <para>What does "loadavg" mean anyway?</para>
+           </question>
+           <answer>
+               <para>
+      The "/proc/loadavg" file provides loadavg values.
+      These values are (in order):
+      the system load averages for the past 1, 5, and 15 minutes;
+      a count of the (active tasks/active processes);
+      the pid of last process run;
+               </para>
+               <para>
+      The active task count includes those processes marked
+      as running or uninterruptable.
+      A load average is an estimate of the average number of
+      processes running within a specified period.
+      The load averages are computed from active task count.
+      They are updated each time active task counts are taken.
+               </para>
+               <para>
+<!-- It sure would be nice for some MathML here. -->
+               <programlisting>
+      The load average formula is:
+      loadavg(d,n) = active_task_cnt - (active_task_cnt - old_loadavg)*(1/exp(d/n);
+      where:
+       d is the time interval between active task count readings, typically every 5 seconds.
+       n is the time over which the readings are averaged.
+               </programlisting>
+               </para>
+           </answer>
+       </qandaentry>
     </qandaset>
 </sect1>