YukonKnights
Cadet
- Joined
- Aug 1, 2016
- Messages
- 2
I have finished setting up my Freenas server, and I am making a few adjustments to ensure that whilst it is not going to be running 24/7, all required scrubs/SMART tests etc. run when it is scheduled to be on. I know that having it running 24/7 is probably best, but when it is unlikely to be used for at least 18 hours of each day, I am not prepared to just let it burn electricity.
To this end I have started by running a simple shutdown script that shuts the system down at midnight unless a scrub or SMART test is scheduled later that night (currently all set to start at 2 am), in which case the machine will stay on until midnight the following day. What I need to do now though is update the root crontab to ensure that the daily/weekly/monthly periodic tasks occur. I understand how crontabs work, and am happy mounting the root file system to ensure that changes persist after a reboot, but I have a few questions about what some of the tasks are, and how spaced out in time they need to be.
Below is a copy of the root crontab from /conf/base/etc/crontab
My first question is what do the cron jobs from line 27 onward do?
More importantly, my second question is whether the individual cron jobs have to be spaced out so far in time? For example, do the individual cron jobs on lines 34-37 have to be 15 minutes apart, or can they be 5 minutes (or less) apart?
Ideally my end goal will be to adjust all the timings on the individual cron jobs to run when I know for certain that the server will be on, but I would like them to run in as quick succession as possible.
As a final question, I have scheduled the boot pool to be scrubed every 7 days. Which crontab controls the timing of this srub, however?
Thanks for the help!
To this end I have started by running a simple shutdown script that shuts the system down at midnight unless a scrub or SMART test is scheduled later that night (currently all set to start at 2 am), in which case the machine will stay on until midnight the following day. What I need to do now though is update the root crontab to ensure that the daily/weekly/monthly periodic tasks occur. I understand how crontabs work, and am happy mounting the root file system to ensure that changes persist after a reboot, but I have a few questions about what some of the tasks are, and how spaced out in time they need to be.
Below is a copy of the root crontab from /conf/base/etc/crontab
Code:
# /etc/crontab - root's crontab for FreeBSD # # $FreeBSD: src/etc/crontab,v 1.33.2.1 2009/08/03 08:13:06 kensmith Exp $ # SHELL=/bin/sh PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin # #minute hour mday month wday who command # */5 * * * * root /usr/libexec/atrun > /dev/null 2>&1 # # Save some entropy so that /dev/random can re-seed on boot. */11 * * * * operator /usr/libexec/save-entropy > /dev/null 2>&1 # # Rotate log files only at midnight. 0 0 * * * root newsyslog > /dev/null 2>&1 # # 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 > /dev/null 2>&1 0 * * * * root /bin/sh /usr/local/sbin/save_rrds.sh > /dev/null 2>&1 5 3 * * * root /bin/sh /usr/local/bin/telemetry-cron.sh > /dev/null 2>&1 0 * * * * root /usr/local/bin/python /usr/local/bin/mfistatus.py > /dev/null 2>&1 1,31 * * * * root /usr/local/bin/python /usr/local/www/freenasUI/tools/alert.py > /dev/null 2>&1 15 3 * * * root /usr/local/bin/python /usr/local/www/freenasUI/tools/cachetool.py expire >/dev/null 2>&1 30 3 * * * root /usr/local/bin/python /usr/local/www/freenasUI/tools/cachetool.py fill >/dev/null 2>&1 45 3 * * * root /usr/local/bin/python /usr/local/www/freenasUI/middleware/notifier.py backup_db >/dev/null 2>&1 0 3 * * * root find /tmp/ -iname "sessionid*" -ctime +1d -delete > /dev/null 2>&1 30 */5 * * * root /etc/ix.rc.d/ix-kinit renew > /dev/null 2>&1
My first question is what do the cron jobs from line 27 onward do?
More importantly, my second question is whether the individual cron jobs have to be spaced out so far in time? For example, do the individual cron jobs on lines 34-37 have to be 15 minutes apart, or can they be 5 minutes (or less) apart?
Ideally my end goal will be to adjust all the timings on the individual cron jobs to run when I know for certain that the server will be on, but I would like them to run in as quick succession as possible.
As a final question, I have scheduled the boot pool to be scrubed every 7 days. Which crontab controls the timing of this srub, however?
Thanks for the help!