Fcron jobs fail to run at 01:30

Hello,

I have a problem where fcron jobs are not running at a specific time overnight. They simply don’t execute at that time.

If, using fcrontab -e, I copy the same fcrontab entry and change the time to a minute from now, the fcron job runs without problem (so there’s no problem with my syntax).

However at 01:30 at night, it simply does not run. Is there something unusual about that time, like other maintenance tasks running?!

I’d use the /etc/fcron.daily directory but the job needs to run at that specific time.

My job is using syntax

30 01 * * * /usr/local/bin/<custom script name>

and the script is executable. As I said above, this isn’t a problem as I can copy the entry and schedule it for a time a few minutes later and it runs without issue.

Thank you!

The problem seems to be that the cron job doesn’t run if there isn’t a root session available. This is why, whenever I test it, it works just fine.

Does anyone know why this would occur?

I think this was an “own goal”. :man_facepalming:

The fcron job was running, however as debug was off I didn’t know this.
My script produces output to the log (using logger) but only after a function attempted to run a command as another user (for security reasons).

I’d incorrectly been running:

RAW_SPEED=$( sudo --user=speedtest /home/speedtest/speedtest-cli --no-upload --csv | cut -d',' -f7 )

but the speedtest user deliberately doesn’t have a shell set!
(I had picked up the --shell option as best-practice somewhere)

So I simply removed that and the script still works

RAW_SPEED=$( sudo --shell --user=speedtest /home/speedtest/speedtest-cli --no-upload --csv | cut -d',' -f7 )

and now correctly produces some output when run from cron.