My fcrontab file has been replaced by a new one

Hello,
I just upgraded to kernel 168. My fcrontab file has been replaced by a new one losing all custom settings. No problem, I have recovered it from the backup. Just commenting for the record.

Regards.

1 Like

Hi,

thanks for reporting back.

This is already mentioned in the release announcement of Core Update 168, please refer to this commit for the technical rationale for rebuilding the fcrontab from scratch.

Thanks, and best regards,
Peter Müller

4 Likes

Hello,

Sorry, I had not seen it.

Thank you and best regards.

2 Likes

No worries. Likewise sorry for the trouble this has now caused for you, but glad to read it could be sorted. :slight_smile:

I would recommend to not modify the systems cron table and create a separate one for any custom cron jobs.

In the past, we have been trying to edit the file during updates, but that has become quite cumbersome and therefore we decided to ship it and added that notice to the change log.

3 Likes

So how do I create a separate cron table? (or maybe this is “a separate crontab”??)

I’ve been looking at this type of thing for about an hour. My fcrontab was replaced also (not a big deal since I have a daily backup). And I wanted to do this the right way.

Is there something like a local file (like fcron.local) available?

Each user has their own fcrontab.

The way I did it was to create an additional user called fcronuser that has no login permissions.
Then I created a frcontab for that user and added that fcrontab to my include.user file so that it is backed up.

As some of my scripts need root permissions to execute, I also created a sudoers.d entry to allow the fcronuser to be able to run scripts with sudo without needing the password.

It might be possible to not need to use sudo if the additional user has the same permissions and rights as the root user but I haven’t tested that out yet and my existing process on my production system is working fine for me. I will have a look at that later and test it out on a vm setup.

That sudoers.d/fcronuser file has the following entry.

## Allow fcronuser to use sudo without a password
fcronuser       ALL=(ALL) NOPASSWD:ALL

I intend to add something to the wiki on this once I have sorted out if the sudoers bit can be eliminated by settings of permissions etc.

4 Likes

Is there’s no such thing like the /etc/cron.d/ directory, where you could place additional [f]cron jobs?
e.g.

# /etc/fcron.d/some
*/10 23,0-5 * * * root  /usr/local/sbin/some_script.sh
0 * * * *         user1 /usr/local/bin/some_other_script.sh

No there isn’t. Fcron doesn’t have that option.

1 Like

I see.
Thank you anyway! :slight_smile:

Two or three days ago I tried this also! It didn’t work for me either! It looks like our only choices are these:

[root@ipfire etc] # ls -al /etc/fc*

-rw-r----- 1 root cron    5 Feb  7 06:58 /etc/fcron.allow
-rw-r----- 1 root cron  670 Mar 11 22:04 /etc/fcron.conf
-rw-r----- 1 root cron    4 Feb  7 06:58 /etc/fcron.deny

/etc/fcron.cyclic:
total 12
drwxr-xr-x  2 root root 4096 Feb  7 08:48 .
drwxr-xr-x 54 root root 4096 Jun 12 03:51 ..
-rw-r--r--  1 root root   34 Feb  7 06:58 info.txt

/etc/fcron.daily:
total 24
drwxr-xr-x  2 root root 4096 Apr 26 08:46 .
drwxr-xr-x 54 root root 4096 Jun 12 03:51 ..
-rw-r--r--  1 root root   33 Feb  7 06:58 info.txt
...

/etc/fcron.hourly:
total 12
drwxr-xr-x  2 root root 4096 Mar  9 13:48 .
drwxr-xr-x 54 root root 4096 Jun 12 03:51 ..
-rw-r--r--  1 root root   34 Feb  7 06:58 info.txt
...

/etc/fcron.minutely:
total 12
drwxr-xr-x  2 root root 4096 Feb  7 08:48 .
drwxr-xr-x 54 root root 4096 Jun 12 03:51 ..
-rw-r--r--  1 root root   36 Feb  7 06:58 info.txt

/etc/fcron.monthly:
total 12
drwxr-xr-x  2 root root 4096 Apr 24 20:16 .
drwxr-xr-x 54 root root 4096 Jun 12 03:51 ..
-rw-r--r--  1 root root   35 Feb  7 06:58 info.txt

/etc/fcron.weekly:
total 16
drwxr-xr-x  2 root root 4096 Apr 24 20:42 .
drwxr-xr-x 54 root root 4096 Jun 12 03:51 ..
-rw-r--r--  1 root root   34 Feb  7 06:58 info.txt
...