Gentoo Wiki


Fcron is a periodical command scheduler which aims at replacing Vixie Cron, so it implements most of its functionalities.

But fcron does not assume that your system is running neither all the time nor regularly : you can, for instance, tell fcron to execute tasks every x hours y minutes of system up time or to do a job only once in a specified interval of time.


fcron vs. vixie-cron

fcron has some important differences compared to vixie-cron:

  1. fcron stores the crontabs in the folder /var/spool/fcron instead of /var/spool/cron/crontabs
  2. fcron uses a special binary file format for storing the crontabs in /var/spool/fcron/USERNAME, but the original plain text version is saved as /var/spool/fcron/USERNAME.orig for your reference (and for being edited with fcrontab).
  3. fcron does not feature a system crontab in exactly the same way as vixie-cron does (/etc/crontab). fcron features a crontab for a pseudo-user 'systab' for use as the system crontab. fcron also does not use the directory /etc/cron.d by default like vixie-cron does.

Setting Up fcron

Start fcron and add it to the default run level

/etc/init.d/fcron start
rc-update add fcron default

fcron uses a dedicated user and group 'fcron' for the suid/sgid programs/files instead of the user and group 'cron' that were previously used. Add user to fcron group:

gpasswd -a user fcron

It's possible to emulate vixie-cron's behavior with regards to /etc/crontab and /etc/cron.d by using a helper script called 'check_system_crontabs'. The file /etc/fcrontab (not /etc/crontab!) has been set up to run the script every 10 minutes to check whether /etc/fcrontab, /etc/crontab or files in /etc/cron.d/ have changed since the last generation of the systab and will regenerate it as necessary. Run 'check_system_crontabs' now to properly generate the initial systab:

check_system_crontabs -v -i -f

If you do NOT want to use 'check_system_crontabs', you might still want to activate the use of the well known directories /etc/cron.{hourly|daily|weekly|monthly} by generating a systab once from /etc/crontab:

fcrontab -u systab /etc/crontab

Added/Deny Users

fcron can restrict then add users by adding the following files: /etc/fcron/fcron.allow and /etc/fcron/fcron.deny.

Adding Cron Jobs

Adding cron jobs is just the same as any other cron client. You can use fcrontab but the standard crontab will work as well.

crontab -e

For root:

sudo crontab  -e
#   minute (0-59),
#   |   hour (0-23),
#   |   |   day of the month (1-31),
#   |   |   |   month of the year (1-12),
#   |   |   |   |   day of the week (0-6 with 0=Sunday).
#   |   |   |   |   |   commands

    43  08  *   *   *   backup-script

Fcron will recognize most errors (say if minute value is out of specification) and ask if you want to correct them.

See also

External links


Thanks to the ebuild writer for a good deal of this information.

Retrieved from ""

Last modified: Thu, 04 Sep 2008 04:29:00 +0000 Hits: 2,414