Replacing the cron scheduler

Status
Not open for further replies.

AndyFL77

Cadet
Joined
Apr 21, 2016
Messages
7
Hi,

I am running a FreeNAS server that is only turned on periodically and not always at the same time. I am worried that my scheduled tasks are not going to run at all. I was thinking of replacing the standard cron implementation with anacron or fcron.

Do I need to do it? I am assuming that FreeNAS is running a traditional cron implementation that does not track when a task was last run.

Can I replace cron on FreeNAS without screwing up the OS or the FreeNAS GUI? If so, can anyone point me at a How To guide. (My Unix experience is 20 years out of date)

Many thanks!
 

AndyFL77

Cadet
Joined
Apr 21, 2016
Messages
7
Well I never like hearing No. I've certainly never been beaten by a technical challenge.

I have managed to get Anacron working. I did this:
  1. Installed Anacron in a jail using “pkg install anacron”
  2. Tested Anacron to ensure it works.
  3. Manually copied the critical files to the main OS.
  4. Followed the installation procedure, including disabling the periodic commands in crontab (actually in /conf/base/etc/crontab) and calling anacron.
  5. Created an anacrontab file from the contents of the auto-generated crontab.
That seems to have solved my immediate problem of not having working scrubs, log cycling, and other background tasks.

My next problem is that I’ve had to hard-code the contents of anacrontab. I really want to generate this, either by rewriting ix-crontab or preferably by post-processing the generated crontab after ix-crontab runs. Sadly my script skills are poor and my Python is non-existent. It’s going to take me a while to complete this project.
 
Status
Not open for further replies.
Top