how to change default cron jobs?

Status
Not open for further replies.

lyzanxia

Dabbler
Joined
Jul 16, 2011
Messages
15
Hello,

I noticed freenas runs default cron tasks, when I edited the crontab file in /etc.

Problem is they start running scheduled at 3 am, my machine starts at 6 am, so they never run.

I tried editing and saving the cron file, but after reboot its back to original :(
How to change the cron so it will stick after reboot?
(These scheduled tasks are not visible in the gui)

ps: these default tasks are daily/weeklymonthly reports, cachetool things etc..

Thanks
 
J

James

Guest
This would be a useful feature request for the GUI. Can you please create a ticket for it at support.freenas.org.
 

Lucas Rey

Contributor
Joined
Jul 25, 2011
Messages
180
I'm searching for a crontab solution on the forum without luck, so I solve myself the issue. I report here the solution so it can be usefull to other members.

Since FreeNAS 8.0 store the setting on the database, all the settings located on /etc will be restored on each reboot. To make persistent every changes the first step is setup writable the OS partition from console:

Code:
# mount -o rw /dev/ufs/FreeNASs1a /


Then go to: /conf/base/etc and edit whatever you want (crontab, rc.conf and so on) using vi or nano:

Code:
# nano /conf/base/etc/crontab


When you've finished and correctly saved all the files, reboot FreeNAS, and all the changes will be there.

With the same method you can also edit /boot/loader.conf to tuning some ZFS settings like:
set vfs.zfs.prefetch_disable=0
set vm.kmem_size=512M
set vm.kmem_size_max=530M

Hope it helps!
./Lucas
 

Durkatlon

Patron
Joined
Aug 19, 2011
Messages
414
Only thing to keep in mind is that this method will not survive an upgrade of the system to a different version of FreeNAS. So take note of these kinds of changes as you make them so you can redo them after an upgrade.
 
Status
Not open for further replies.
Top