mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
cron: migrate immutable jobs; #911
This commit is contained in:
parent
9ce4fc1d95
commit
af4ce2d0ae
@ -310,44 +310,6 @@
|
||||
</destination>
|
||||
</rule>
|
||||
</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>
|
||||
<enable/>
|
||||
</rrd>
|
||||
|
||||
@ -2349,10 +2349,16 @@ function configure_cron()
|
||||
'/usr/local/etc/rc.backup_dhcpleases',
|
||||
'/usr/local/etc/rc.backup_netflow',
|
||||
'/usr/local/etc/rc.backup_rrd',
|
||||
'/usr/local/etc/rc.dyndns.update',
|
||||
'/usr/local/etc/rc.update_bogons',
|
||||
'/usr/local/etc/rc.update_urltables',
|
||||
'/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',
|
||||
'newsyslog', /* old config migration for extra care */
|
||||
/* old config migration for extra care: */
|
||||
'checkreload.sh',
|
||||
'newsyslog',
|
||||
);
|
||||
|
||||
/*
|
||||
@ -2382,6 +2388,10 @@ function configure_cron()
|
||||
$autocron = array();
|
||||
|
||||
$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'])) {
|
||||
$autocron[] = generate_cron_job('/usr/local/etc/rc.backup_rrd', $minute = '0', '*/' . $config['system']['rrdbackup']);
|
||||
|
||||
@ -501,76 +501,6 @@ function upgrade_024_to_025() {
|
||||
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() {
|
||||
global $config;
|
||||
$rule_item = array();
|
||||
@ -584,7 +514,6 @@ function upgrade_028_to_029() {
|
||||
$a_filter[] = $rule_item;
|
||||
}
|
||||
|
||||
|
||||
function upgrade_029_to_030() {
|
||||
global $config;
|
||||
/* enable the rrd config setting by default */
|
||||
@ -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) {
|
||||
if (is_array($section)) {
|
||||
foreach($section as & $item) {
|
||||
@ -2570,19 +2486,6 @@ function upgrade_074_to_075() {
|
||||
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() {
|
||||
global $config;
|
||||
foreach($config['filter']['rule'] as & $rule) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user