Login  Register

Re: Not being able to run the Trojan rules in the update script and performance increase SOLUTION

Posted by hans2 on Mar 09, 2016; 4:04pm
URL: https://itus.accessinnov.com/Update-script-fw-upgrade-tp43p358.html

Wisiwyg wrote
Quick question on cron...

I made the change to update ntp each midnight a couple of days ago. Then today noticed that it was back to updating every 10 seconds. I made the change in the GUI, then checked the file contents of /etc/crontabs/root and it reflects the proper change to 0 0 * * *. I had checked this the first time I edited it and it read correctly.

What would be the reason it reverted to the /10 setting? Would a reboot do it? TIA
AFAIK this is controlled by the initialization script  /etc/init.d/ntpclient . It will set the cron job on boot:

...
cron_seed() {
        # local cronstuff='*/'"$INTERVALMINUTES"' * * * *'              # ITUS ($INTERVALMINUTS = 10)
        local cronstuff='0 0 * * *'                                     # run at midnight
        local reset="/etc/init.d/ntpclient restart"

        cron_clean

        crontab -l >&- 2>&-
        if [ $? -ne 0 ]; then
                crontab -l | sed -e '$a\'"$cronstuff $(ntpcommand) || $reset" | crontab -
        else
                echo "$cronstuff $(ntpcommand) || $reset" | crontab -
        fi
        [ -L /var/spool/cron/crontabs ] || /etc/init.d/cron restart >&- 2>&-
}
...

In my latest hotfix pack I've changed it to run at midnight only.
No more: Shield Pro v1, Chaos Calmer, FW 1.51 SP1