Changeset db38f7b


Ignore:
Timestamp:
12/17/2018 01:19:23 AM (5 years ago)
Author:
DJ Lucas <dj@…>
Branches:
elogind
Children:
54ed60b
Parents:
32dfda12
Message:

Merge from HEAD 20831.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/BOOK-elogind@20833 af4574ff-66df-0310-9fd7-8a98e5e911e0

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • general.ent

    r32dfda12 rdb38f7b  
    77<!ENTITY copyholder   "The BLFS Development Team">
    88<!ENTITY version      "&year;-&month;-&day;">
    9 <!ENTITY releasedate  "December 15th, &year;">
     9<!ENTITY releasedate  "December 17th, &year;">
    1010<!ENTITY pubdate      "&year;-&month;-&day;"> <!-- metadata req. by TLDP -->
    1111<!ENTITY blfs-version "svn">                  <!-- svn|[release #] -->
  • general/sysutils/fcron.xml

    r32dfda12 rdb38f7b  
    231231      </indexterm>
    232232
     233      <bridgehead renderas="sect4">Periodic Jobs</bridgehead>
     234
     235      <para>
     236        If you would like to setup a periodic hierarchy for the root user,
     237        first issue the following commands (as the
     238        <systemitem class="username">root</systemitem> user to create the
     239        <filename>/usr/bin/run-parts</filename> script:
     240      </para>
     241
     242<screen role="root"><userinput>cat &gt; /usr/bin/run-parts &lt;&lt; "EOF" &amp;&amp;
     243#!/bin/sh
     244# run-parts:  Runs all the scripts found in a directory.
     245# from Slackware, by Patrick J. Volkerding with ideas borrowed
     246# from the Red Hat and Debian versions of this utility.
     247
     248# keep going when something fails
     249set +e
     250
     251if [ $# -lt 1 ]; then
     252  echo "Usage: run-parts &lt;directory&gt;"
     253  exit 1
     254fi
     255
     256if [ ! -d $1 ]; then
     257  echo "Not a directory: $1"
     258  echo "Usage: run-parts &lt;directory&gt;"
     259  exit 1
     260fi
     261
     262# There are several types of files that we would like to
     263# ignore automatically, as they are likely to be backups
     264# of other scripts:
     265IGNORE_SUFFIXES="~ ^ , .bak .new .rpmsave .rpmorig .rpmnew .swp"
     266
     267# Main loop:
     268for SCRIPT in $1/* ; do
     269  # If this is not a regular file, skip it:
     270  if [ ! -f $SCRIPT ]; then
     271    continue
     272  fi
     273  # Determine if this file should be skipped by suffix:
     274  SKIP=false
     275  for SUFFIX in $IGNORE_SUFFIXES ; do
     276    if [ ! "$(basename $SCRIPT $SUFFIX)" = "$(basename $SCRIPT)" ]; then
     277      SKIP=true
     278      break
     279    fi
     280  done
     281  if [ "$SKIP" = "true" ]; then
     282    continue
     283  fi
     284  # If we've made it this far, then run the script if it's executable:
     285  if [ -x $SCRIPT ]; then
     286    $SCRIPT || echo "$SCRIPT failed."
     287  fi
     288done
     289
     290exit 0
     291EOF
     292chmod -v 755 /usr/bin/run-parts</userinput></screen>
     293
     294      <para>
     295        Next, create the directory layout for the periodic jobs (again as the
     296        <systemitem class="username">root</systemitem> user):
     297      </para>
     298
     299<screen role="root"><userinput>install -vdm754 /etc/cron.{hourly,daily,weekly,monthly}</userinput></screen>
     300
     301      <para>
     302        Finally, add the <command>run-parts</command> to the system fcrontab
     303        (while still the <systemitem class="username">root</systemitem> user):
     304      </para>
     305
     306<screen role="root"><userinput>cat &gt; /var/spool/fcron/systab.orig &lt;&lt; "EOF"
     307&amp;bootrun 01 * * * * root run-parts /etc/cron.hourly
     308&amp;bootrun 02 4 * * * root run-parts /etc/cron.daily
     309&amp;bootrun 22 4 * * 0 root run-parts /etc/cron.weekly
     310&amp;bootrun 42 4 1 * * root run-parts /etc/cron.monthly
     311EOF</userinput></screen>
     312
    233313    </sect3>
    234314
     
    251331
    252332<screen role="root" revision="systemd"><userinput>systemctl enable fcron</userinput></screen>
     333
     334      <para>Finally, again as the <systemitem class="username">root</systemitem>
     335      user, start fcron and generate the
     336      <filename>/var/spool/fcron/systab</filename> file:</para>
     337
     338<screen role="root"><userinput>/etc/rc.d/init.d/fcron start &amp;&amp;
     339fcrontab -z -u systab</userinput></screen>
    253340
    254341    </sect3>
  • introduction/welcome/changelog.xml

    r32dfda12 rdb38f7b  
    4444
    4545    <listitem>
     46      <para>December 17th, 2018</para>
     47      <itemizedlist>
     48        <listitem>
     49          <para>[dj] - Add periodic cron configuration for fcron.</para>
     50        </listitem>
     51      </itemizedlist>
     52    </listitem>
     53
     54    <listitem>
    4655      <para>December 16th, 2018</para>
    4756      <itemizedlist>
Note: See TracChangeset for help on using the changeset viewer.