From 1b248ef48f0fc308fc4f70cfc05ed48d78938297 Mon Sep 17 00:00:00 2001 From: thib Date: Sat, 7 Sep 2002 13:12:16 +0000 Subject: [PATCH] *** empty log message *** --- doc/en/changes.sgml | 6 +- doc/en/faq.sgml | 43 ++++++++------ doc/en/fcrontab.5.sgml | 128 +++++++++++++++++++++++++++-------------- doc/en/install.sgml | 9 ++- doc/en/todo.sgml | 7 ++- 5 files changed, 125 insertions(+), 68 deletions(-) diff --git a/doc/en/changes.sgml b/doc/en/changes.sgml index f36d5b7..2ed3cf1 100644 --- a/doc/en/changes.sgml +++ b/doc/en/changes.sgml @@ -8,7 +8,7 @@ Foundation. A copy of the license is included in gfdl.sgml. --> - + Changes @@ -33,6 +33,10 @@ a command has been run. bug fix : using DESTDIR with make wasn't working with the doc. + + fcrontab sets euid=uid before running the editor. This is required by +some programs (for instance, perl). + diff --git a/doc/en/faq.sgml b/doc/en/faq.sgml index f947829..0eef0a7 100644 --- a/doc/en/faq.sgml +++ b/doc/en/faq.sgml @@ -8,7 +8,7 @@ Foundation. A copy of the license is included in gfdl.sgml. --> - + Frequently Asked Questions @@ -91,8 +91,8 @@ How can I avoid the mail? 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: - * * * * * /a/non/zero/status/job ; -/bin/true + +* * * * * /a/non/zero/status/job ; /bin/true @@ -113,11 +113,12 @@ 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. - 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. + +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. @@ -131,8 +132,7 @@ are averaged. You can use pipes with "fcrontab -l" (list the fcrontab) and "fcrontab -" (read the new fcrontab from input). For example : - echo -e "`fcrontab -l | grep -v exim`\n0 * * * -* /usr/sbin/exim -q" | fcrontab - + echo -e "`fcrontab -l | grep -v exim`\n0 * * * * /usr/sbin/exim -q" | fcrontab - can be used to add a line. Another way to do it would be to: list the fcrontab settings into a temporary file ("fcrontab -l > @@ -159,13 +159,15 @@ for instance, only once every week. every day, week, etc, at dialup connection You can use a script like : -# A ppp-up script ... # run the jobs pending, then returns : fcron -f -y -o +# A ppp-up script ... +# run the jobs pending, then returns : +fcron -f -y -o in conjunction with a fcrontab file like : -# a fcrontab file ... %random(no),weekly,stdout * * -/a/command/to/download/latest/mozilla/release %monthly,stdout * * * -/update/junkbuster/config/files +# a fcrontab file ... +%random(no),weekly,stdout * * /a/command/to/download/latest/mozilla/release +%monthly,stdout * * * /update/junkbuster/config/files You can also use fcron to run some jobs until the end of @@ -178,16 +180,21 @@ for mails every 5 minutes while connected. end of the connection ppp-up script : -# A ppp-up script ... # run fcron at the beginning of the connection : fcron -b +# A ppp-up script ... +# run fcron at the beginning of the connection : +fcron -b ppp-down script : -# A ppp-down script ... # stop fcron at the end of the connection : # -- Warning -: killall may have unwanted effect on non linux systems -- killall -TERM fcron +# A ppp-down script ... +# stop fcron at the end of the connection : +# -- Warning : killall may have unwanted effect on non linux systems -- +killall -TERM fcron the fcrontab : -# a fcrontab file ... @volatile,first(0) 5 fetchmail +# a fcrontab file ... +@volatile,first(0) 5 fetchmail diff --git a/doc/en/fcrontab.5.sgml b/doc/en/fcrontab.5.sgml index 487542b..93d65a8 100644 --- a/doc/en/fcrontab.5.sgml +++ b/doc/en/fcrontab.5.sgml @@ -8,7 +8,7 @@ Foundation. A copy of the license is included in gfdl.sgml. --> - + @@ -147,10 +147,12 @@ don't need to be run at a specific time and date. Some examples of lines based on elapsed system up time -# Get our mails every 30 minutes @ 30 getmails -all # make some security tests -every 48 hours of system up time, # force a mail to be sent to root even if -there is no output @mailto(root),forcemail 2d -/etc/security/msec/cron-sh/security.sh +# Get our mails every 30 minutes +@ 30 getmails -all + +# make some security tests every 48 hours of system up time, +# force a mail to be sent to root even if there is no output +@mailto(root),forcemail 2d /etc/security/msec/cron-sh/security.sh @@ -162,8 +164,9 @@ there is no output @mailto(root),forcemail 2d frequency of execution (this is equivalent to option &optrunfreq;) or a declaration of options; it has five time and date fields, and a shell command : - &options min hrs day-of-month month day-of-week -command + +&options min hrs day-of-month month day-of-week command + Note that the shell command may be preceded by a user name, which is equivalent to runas(user): as it is only here for backward compatibility you should use option &optrunas; (see @@ -240,14 +243,18 @@ days which are a Sunday AND a 31th, at 10:05. &optmail;, &optnolog;, &optserial;, &optlavg;, &optnice;, &optrunas; (see below). - Some examples of entries based on time and -date + Some examples of entries based on time and date -# run mycommand at 12:05, 12:35, 13:05, 13:35, 14:05 *and* 14:35 everyday & -05,35 12-14 * * * mycommand -u me -o file # get mails every hours past 20, 21, -22, and 24 minutes. 20-24~23 * * * * getmail # save our work of the day every -night at 03:45 with a low priority # unless we are sunday, mail the output to -jim and run that job # at startup if computer was down at 03:45 +# run mycommand at 12:05, 12:35, 13:05, 13:35, +# 14:05 *and* 14:35 everyday +&05,35 12-14 * * * mycommand -u me -o file + +# get mails every hours past 20, 21, 22, and 24 minutes. +20-24~23 * * * * getmail + +# save our work of the day every night at 03:45 with a low priority +# unless we are sunday, mail the output to jim and run that job +# at startup if computer was down at 03:45 &nice(10),mailto(jim),bootrun 45 03 * * *~0 "save --our work" @@ -706,34 +713,71 @@ order may not be conserved). An example of a user fcrontab -# use /bin/bash to run commands, ignoring what /etc/passwd says SHELL=/bin/bash -# mail output to thib, no matter whose fcrontab this is !mailto(thib) # define a -variable which is equivalent to " Hello thib and paul ! " # here the newline -characters are escaped by a backslash (\) # and quotes are used to force to keep -leading and trailing blanks TEXT= " Hello\ thib and\ paul ! " # we want to use -serial but not bootrun: !serial(true),b(0) # run after five minutes of execution -the first time, # then run every hours @first(5) 1h echo "Run every hours" # -run every days @ 1d echo "fcron daily" # run once between in the morning and -once in the afternoon # if systems is running at any moment of these intervals -%hours * 8-12,14-18 * * * echo "Hey boss, I'm working today !" # run once a week -during our lunch %weekly * 12-13 echo "I left my system on at least once \ at -lunch time this week." # run every Sunday and Saturday at 9:05 5 9 * * sat,sun -echo "Good morning Thibault !" # run every peer days of march at 18:00, except -on 16th 0 18 2-30/2~16 Mar * echo "It's time to go back home !" # the line above -is equivalent to & 0 18 2-30/2~16 Mar * echo "It's time to go back home !" # -reset options to default and set runfreq for lines below !reset,runfreq(7) # run -once every 7 matches (thanks to the declaration above), # so if system is -running every day at 10:00, this will be # run once a week & 0 10 * * * echo "if -you got this message last time 7 days ago,\ this computer has been running every -day at 10:00 last week.\ If you got the message 8 days ago, then the system has -been down \ one day at 10:00 since you got it, etc" # wait every hour for a 5 -minutes load average under 0.9 @lavg5(0.9) 1h echo "The system load average is -low" # wait a maximum of 5 hours every day for a fall of the load average -@lavgand,lavg(1,2.0,3.0),until(5h) 1d echo "Load average is going down" # wait -for the best moment to run a heavy job @lavgor,lavg(0.8,1.2,1.5),nice(10) 1w -echo "This is a heavy job" # run once every night between either 21:00 and 23:00 -or # between 3:00 and 6:00 %nightly,lavg(1.5,2,2) * 21-23,3-6 echo "It's time -to retrieve \ the last release of Mozilla !" +# use /bin/bash to run commands, ignoring what /etc/passwd says +SHELL=/bin/bash + +# mail output to thib, no matter whose fcrontab this is +!mailto(thib) + +# define a variable which is equivalent to " Hello thib and paul ! " +# here the newline characters are escaped by a backslash (\) +# and quotes are used to force to keep leading and trailing blanks +TEXT= " Hello\ + thib and\ + paul ! " + +# we want to use serial but not bootrun: +!serial(true),b(0) + +# run after five minutes of execution the first time, +# then run every hours +@first(5) 1h echo "Run every hours" + +# run every days +@ 1d echo "fcron daily" + +# run once between in the morning and once in the afternoon +# if systems is running at any moment of these intervals +%hours * 8-12,14-18 * * * echo "Hey boss, I'm working today !" + +# run once a week during our lunch +%weekly * 12-13 echo "I left my system on at least once \ + at lunch time this week." + +# run every Sunday and Saturday at 9:05 +5 9 * * sat,sun echo "Good morning Thibault !" + +# run every peer days of march at 18:00, except on 16th +0 18 2-30/2~16 Mar * echo "It's time to go back home !" + +# the line above is equivalent to +& 0 18 2-30/2~16 Mar * echo "It's time to go back home !" + +# reset options to default and set runfreq for lines below +!reset,runfreq(7) + +# run once every 7 matches (thanks to the declaration above), +# so if system is running every day at 10:00, this will be +# run once a week +& 0 10 * * * echo "if you got this message last time 7 days ago,\ + this computer has been running every day at 10:00 last week.\ + If you got the message 8 days ago, then the system has been down \ + one day at 10:00 since you got it, etc" + +# wait every hour for a 5 minutes load average under 0.9 +@lavg5(0.9) 1h echo "The system load average is low" + +# wait a maximum of 5 hours every day for a fall of the load average +@lavgand,lavg(1,2.0,3.0),until(5h) 1d echo "Load average is going down" + +# wait for the best moment to run a heavy job +@lavgor,lavg(0.8,1.2,1.5),nice(10) 1w echo "This is a heavy job" + +# run once every night between either 21:00 and 23:00 or +# between 3:00 and 6:00 +%nightly,lavg(1.5,2,2) * 21-23,3-6 echo "It's time to retrieve \ + the latest release of Mozilla !" + diff --git a/doc/en/install.sgml b/doc/en/install.sgml index bf8a892..606d5d0 100644 --- a/doc/en/install.sgml +++ b/doc/en/install.sgml @@ -8,20 +8,19 @@ Foundation. A copy of the license is included in gfdl.sgml. --> - + How to install fcron uncompress the archive : - bash$ tar -xzf -fcron-X.Y.Z.src.tar.gz + bash$ +tar -xzf fcron-X.Y.Z.src.tar.gz cd to the archive directory - bash$ cd -fcron-X.Y.Z + bash$ cd fcron-X.Y.Z run the configure script : diff --git a/doc/en/todo.sgml b/doc/en/todo.sgml index 30f82d9..40be85d 100644 --- a/doc/en/todo.sgml +++ b/doc/en/todo.sgml @@ -8,7 +8,7 @@ Foundation. A copy of the license is included in gfdl.sgml. --> - + Todo @@ -28,11 +28,14 @@ well. find a way to get user's job pid (not the fcron process - controling it) (use pipe() ?) + controlling it) (use pipe() ?) Use (or remove from config.h.in) MAX_USER_CON & MAX_IDLE_TIME. + + Use directory notifications (?) (portable ?) (cf. dnotify) + PAM support (included in fcron, but need more tests by people using PAM - not implemented in fcrondyn) -- 2.40.0