Commit af4ce2d0 authored by Franco Fichtner's avatar Franco Fichtner

cron: migrate immutable jobs; #911

parent 9ce4fc1d
...@@ -310,44 +310,6 @@ ...@@ -310,44 +310,6 @@
</destination> </destination>
</rule> </rule>
</filter> </filter>
<cron>
<item>
<minute>*/60</minute>
<hour>*</hour>
<mday>*</mday>
<month>*</month>
<wday>*</wday>
<who>root</who>
<command>/usr/local/sbin/expiretable -v -t 3600 sshlockout</command>
</item>
<item>
<minute>1</minute>
<hour>1</hour>
<mday>*</mday>
<month>*</month>
<wday>*</wday>
<who>root</who>
<command>/usr/local/etc/rc.dyndns.update</command>
</item>
<item>
<minute>*/60</minute>
<hour>*</hour>
<mday>*</mday>
<month>*</month>
<wday>*</wday>
<who>root</who>
<command>/usr/local/sbin/expiretable -v -t 3600 virusprot</command>
</item>
<item>
<minute>30</minute>
<hour>12</hour>
<mday>*</mday>
<month>*</month>
<wday>*</wday>
<who>root</who>
<command>/usr/local/etc/rc.update_urltables</command>
</item>
</cron>
<rrd> <rrd>
<enable/> <enable/>
</rrd> </rrd>
......
...@@ -2349,10 +2349,16 @@ function configure_cron() ...@@ -2349,10 +2349,16 @@ function configure_cron()
'/usr/local/etc/rc.backup_dhcpleases', '/usr/local/etc/rc.backup_dhcpleases',
'/usr/local/etc/rc.backup_netflow', '/usr/local/etc/rc.backup_netflow',
'/usr/local/etc/rc.backup_rrd', '/usr/local/etc/rc.backup_rrd',
'/usr/local/etc/rc.dyndns.update',
'/usr/local/etc/rc.update_bogons', '/usr/local/etc/rc.update_bogons',
'/usr/local/etc/rc.update_urltables',
'/usr/local/opnsense/scripts/remote_backup.php', '/usr/local/opnsense/scripts/remote_backup.php',
'/usr/local/sbin/expiretable -v -t 3600 sshlockout',
'/usr/local/sbin/expiretable -v -t 3600 virusprot',
'adjkerntz -a', 'adjkerntz -a',
'newsyslog', /* old config migration for extra care */ /* old config migration for extra care: */
'checkreload.sh',
'newsyslog',
); );
/* /*
...@@ -2382,6 +2388,10 @@ function configure_cron() ...@@ -2382,6 +2388,10 @@ function configure_cron()
$autocron = array(); $autocron = array();
$autocron[] = generate_cron_job('adjkerntz -a', '1,31', '0-5'); $autocron[] = generate_cron_job('adjkerntz -a', '1,31', '0-5');
$autocron[] = generate_cron_job('/usr/local/sbin/expiretable -v -t 3600 sshlockout', '*/60');
$autocron[] = generate_cron_job('/usr/local/sbin/expiretable -v -t 3600 virusprot', '*/60');
$autocron[] = generate_cron_job('/usr/local/etc/rc.dyndns.update', '1', '1');
$autocron[] = generate_cron_job('/usr/local/etc/rc.update_urltables', '30', '12');
if (!empty($config['system']['rrdbackup'])) { if (!empty($config['system']['rrdbackup'])) {
$autocron[] = generate_cron_job('/usr/local/etc/rc.backup_rrd', $minute = '0', '*/' . $config['system']['rrdbackup']); $autocron[] = generate_cron_job('/usr/local/etc/rc.backup_rrd', $minute = '0', '*/' . $config['system']['rrdbackup']);
......
...@@ -501,76 +501,6 @@ function upgrade_024_to_025() { ...@@ -501,76 +501,6 @@ function upgrade_024_to_025() {
unset($config['system']['use_rrd_gateway']); unset($config['system']['use_rrd_gateway']);
} }
function upgrade_025_to_026()
{
global $config;
$cron_item = array();
$cron_item['minute'] = "0";
$cron_item['hour'] = "*";
$cron_item['mday'] = "*";
$cron_item['month'] = "*";
$cron_item['wday'] = "*";
$cron_item['who'] = "root";
$cron_item['command'] = "newsyslog";
$config['cron']['item'][] = $cron_item;
$cron_item = array();
$cron_item['minute'] = "1,31";
$cron_item['hour'] = "0-5";
$cron_item['mday'] = "*";
$cron_item['month'] = "*";
$cron_item['wday'] = "*";
$cron_item['who'] = "root";
$cron_item['command'] = "adjkerntz -a";
$config['cron']['item'][] = $cron_item;
$cron_item = array();
$cron_item['minute'] = "1";
$cron_item['hour'] = "*";
$cron_item['mday'] = "1";
$cron_item['month'] = "*";
$cron_item['wday'] = "*";
$cron_item['who'] = "root";
$cron_item['command'] = "/usr/local/etc/rc.update_bogons";
$config['cron']['item'][] = $cron_item;
$cron_item = array();
$cron_item['minute'] = "*/60";
$cron_item['hour'] = "*";
$cron_item['mday'] = "*";
$cron_item['month'] = "*";
$cron_item['wday'] = "*";
$cron_item['who'] = "root";
$cron_item['command'] = "/usr/local/sbin/expiretable -v -t 3600 sshlockout";
$config['cron']['item'][] = $cron_item;
$cron_item = array();
$cron_item['minute'] = "1";
$cron_item['hour'] = "1";
$cron_item['mday'] = "*";
$cron_item['month'] = "*";
$cron_item['wday'] = "*";
$cron_item['who'] = "root";
$cron_item['command'] = "/usr/local/etc/rc.dyndns.update";
$config['cron']['item'][] = $cron_item;
$cron_item = array();
$cron_item['minute'] = "*/60";
$cron_item['hour'] = "*";
$cron_item['mday'] = "*";
$cron_item['month'] = "*";
$cron_item['wday'] = "*";
$cron_item['who'] = "root";
$cron_item['command'] = "/usr/local/sbin/expiretable -v -t 3600 virusprot";
$config['cron']['item'][] = $cron_item;
}
function upgrade_028_to_029() { function upgrade_028_to_029() {
global $config; global $config;
$rule_item = array(); $rule_item = array();
...@@ -584,7 +514,6 @@ function upgrade_028_to_029() { ...@@ -584,7 +514,6 @@ function upgrade_028_to_029() {
$a_filter[] = $rule_item; $a_filter[] = $rule_item;
} }
function upgrade_029_to_030() { function upgrade_029_to_030() {
global $config; global $config;
/* enable the rrd config setting by default */ /* enable the rrd config setting by default */
...@@ -2504,19 +2433,6 @@ function upgrade_069_to_070() { ...@@ -2504,19 +2433,6 @@ function upgrade_069_to_070() {
} }
} }
function upgrade_070_to_071() {
global $config;
if (is_array($config['cron']['item'])) {
foreach($config['cron']['item'] as $idx => $cronitem) {
if(stristr($cronitem['command'], "checkreload.sh")) {
unset($config['cron']['item'][$idx]);
break;
}
}
}
}
function rename_field(& $section, $oldname, $newname) { function rename_field(& $section, $oldname, $newname) {
if (is_array($section)) { if (is_array($section)) {
foreach($section as & $item) { foreach($section as & $item) {
...@@ -2570,19 +2486,6 @@ function upgrade_074_to_075() { ...@@ -2570,19 +2486,6 @@ function upgrade_074_to_075() {
rename_field($config['crl'], 'name', 'descr'); rename_field($config['crl'], 'name', 'descr');
} }
function upgrade_075_to_076() {
global $config;
$cron_item = array();
$cron_item['minute'] = "30";
$cron_item['hour'] = "12";
$cron_item['mday'] = "*";
$cron_item['month'] = "*";
$cron_item['wday'] = "*";
$cron_item['who'] = "root";
$cron_item['command'] = "/usr/local/etc/rc.update_urltables";
$config['cron']['item'][] = $cron_item;
}
function upgrade_076_to_077() { function upgrade_076_to_077() {
global $config; global $config;
foreach($config['filter']['rule'] as & $rule) { foreach($config['filter']['rule'] as & $rule) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment