All Cron Jobs Fail - No Log Entries

FreeNASBob

Patron
Joined
Aug 23, 2014
Messages
226
FreeNAS-11.3-U1

I have a cron job that has been running every day at noon for years without a hitch. However, I just discovered that it stopped running April 7, which has no significance in the logs or my memory.

The cron job is a simple shell script that creates a file, and it runs fine from the shell but refuses to run from cron, even when manually run from the Web UI. There are no messages in /var/logs/messages or /var/logs/cron. It just simply doesn't do anything.

I tried deleting the cron job and creating a new one, but it didn't work either.

Then I created the following test script:

Code:
#!/bin/sh
echo test > testfile


When run from the shell it works fine. When I set up a cron job to run that script it does not work and no errors appear in any logs. The cron job is set to run as the same user as I'm logged in when running from the shell.

I tried crontab -l from the shell, but I just received crontab: no crontab for [user] even through the cron jobs are listed in the Web UI.

I'm at a loss.
 
Last edited:
Joined
Jan 4, 2014
Messages
1,644
What does service cron status show?
 

FreeNASBob

Patron
Joined
Aug 23, 2014
Messages
226
cron is running as pid 1604.

Just for good measure I tried service cron restart. No effect.
 
Joined
Jan 4, 2014
Messages
1,644
Does a kickstart service cron restart help? Check the log after the restart.
 
Last edited:

FreeNASBob

Patron
Joined
Aug 23, 2014
Messages
226
No help. Restart goes fine. No log entries are triggered by restart.
 

FreeNASBob

Patron
Joined
Aug 23, 2014
Messages
226
There's a new 11.3 update that has some cron bugs fixed. I'm applying that now.
 
Joined
Jan 4, 2014
Messages
1,644

FreeNASBob

Patron
Joined
Aug 23, 2014
Messages
226
FreeNAS-11.3-U2 does not resolve the issue

I take it back. After a reboot the issue appears fixed.
 
Last edited:
Joined
Jan 4, 2014
Messages
1,644
Strange. I'm not sure what to suggest next. Do you have many cron jobs set up in the UI? If only a few, maybe remove them all, run a test, and if successful, add them back one at a time till something breaks.
 
Joined
Jan 4, 2014
Messages
1,644
Top