Informations sur la
configuration
Aucune modification n'est nécessaire dans un fichier de config.
Vous pouvez trouver des informations de configuration dans la
page de man de fcron.conf.
Les scripts fcron
sont écrits en utilisant fcrontab. Reportez-vous à la
page de manuel de fcrontab pour les paramètres
adaptés à votre situation.
Si Linux-PAM est installé, deux fichiers de
configuration PAM sont installés dans etc/pam.d. Sinon, si etc/pam.d n'est pas utilisé, l'installation
enverra deux sections de configuration vers le fichier
/etc/pam.conf. Vous devriez vous
assurer que les fichiers correspondent à vos préférences.
Modifiez-les comme il faut pour s'adapter à vos besoins.
Taches périodiques
Si vous voulez paramétrer une hiérarchie périodique pour
l'utilisateur root, lancez d'abord les commandes suivantes (en
tant qu'utilisateur root) pour
créer le script /usr/bin/run-parts :
cat > /usr/bin/run-parts << "EOF" &&
#!/bin/sh
# run-parts: Runs all the scripts found in a directory.
# from Slackware, by Patrick J. Volkerding with ideas borrowed
# from the Red Hat and Debian versions of this utility.
# keep going when something fails
set +e
if [ $# -lt 1 ]; then
echo "Usage: run-parts <directory>"
exit 1
fi
if [ ! -d $1 ]; then
echo "Not a directory: $1"
echo "Usage: run-parts <directory>"
exit 1
fi
# There are several types of files that we would like to
# ignore automatically, as they are likely to be backups
# of other scripts:
IGNORE_SUFFIXES="~ ^ , .bak .new .rpmsave .rpmorig .rpmnew .swp"
# Main loop:
for SCRIPT in $1/* ; do
# If this is not a regular file, skip it:
if [ ! -f $SCRIPT ]; then
continue
fi
# Determine if this file should be skipped by suffix:
SKIP=false
for SUFFIX in $IGNORE_SUFFIXES ; do
if [ ! "$(basename $SCRIPT $SUFFIX)" = "$(basename $SCRIPT)" ]; then
SKIP=true
break
fi
done
if [ "$SKIP" = "true" ]; then
continue
fi
# If we've made it this far, then run the script if it's executable:
if [ -x $SCRIPT ]; then
$SCRIPT || echo "$SCRIPT failed."
fi
done
exit 0
EOF
chmod -v 755 /usr/bin/run-parts
Maintenant, créez la hiérarchie des répertoires pour les taches
périodiques (de nouveau en tant qu'utilisateur root) :
install -vdm754 /etc/cron.{hourly,daily,weekly,monthly}
Enfin, ajoutez run-parts au fcrontab du
système (toujours en tant qu'utilisateur root) :
cat > /var/spool/fcron/systab.orig << "EOF"
&bootrun 01 * * * * root run-parts /etc/cron.hourly
&bootrun 02 4 * * * root run-parts /etc/cron.daily
&bootrun 22 4 * * 0 root run-parts /etc/cron.weekly
&bootrun 42 4 1 * * root run-parts /etc/cron.monthly
EOF
Script de démarrage
Installez le script d'initialisation /etc/rc.d/init.d/fcron à partir du paquet
blfs-bootscripts-20250225.
make install-fcron
Enfin, toujours en tant qu'utilisateur root, démarrez fcron et générez le fichier
/var/spool/fcron/systab :
/etc/rc.d/init.d/fcron start &&
fcrontab -z -u systab