Can I disable cron?

Code:
>uname -a
FreeBSD mybsd.zsoft.com 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:15:25 UTC 2012     
root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

It is a home desktop box. I have no cron jobs of my own except system's:

Code:
>cat /etc/crontab
#...
#minute hour    mday    month   wday    who     command
#
*/5     *       *       *       *       root    /usr/libexec/atrun
#
# Save some entropy so that /dev/random can re-seed on boot.
*/11    *       *       *       *       operator /usr/libexec/save-entropy
#
# Rotate log files every hour, if necessary.
0       *       *       *       *       root    newsyslog
#
# Perform daily/weekly/monthly maintenance.
1       3       *       *       *       root    periodic daily
15      4       *       *       6       root    periodic weekly
30      5       1       *       *       root    periodic monthly
#
# Adjust the time zone if the CMOS clock keeps local time, as opposed to
# UTC time.  See adjkerntz(8) for details.
1,31    0-5     *       *       *       root    adjkerntz -a

Can I safely disable cron by adding
Code:
cron_enable="NO"
in /etc/rc.conf?

Sincerely!
 
mousaka said:
I would recommend to use sysutils/anacron instead of cron and then, as you proposed, disable cron in /etc/rc.conf with cron_enable="NO".

mousaka

What are advantages of anacron with respect to the system base cron and why should one use anacron when the final aim is to disable cron?
 
Some of the jobs defined in periodic() (daily, weekls, monthly) are quite useful, e.g. updating the locate database, backing up users and groups, ...
Cron runs the periodic scripts at 3 o'clock in the morning, I assume that your desktop box usually isn't powered on at this time during night. anacron runs these jobs at boot time (after a definable delay) which is more suitable for boxes with do not run 24/7.

What are the expected benefits of disabling cron? Usually default values in FreeBSD a wisely chosen. Changing them is only recommended if you fully understand the consequences.

mousaka
 
While I agree that disabling cron is a (usually) bad idea, for a system that is not online for long periods having a few scripts that perform the tuning at the boot (or better at the shutdown) could be a better compromise.
 
Thanks for all your answers. Because it is not a 24/7 box, I feel those cron jobs will never run according to its default settings in /etc/crontab. I will have a look at anacron as mousaka suggested.
 
Back
Top