Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
af4ce2d0
Commit
af4ce2d0
authored
Apr 25, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cron: migrate immutable jobs; #911
parent
9ce4fc1d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
136 deletions
+11
-136
config.xml.sample
src/etc/config.xml.sample
+0
-38
services.inc
src/etc/inc/services.inc
+11
-1
upgrade_config.inc
src/etc/inc/upgrade_config.inc
+0
-97
No files found.
src/etc/config.xml.sample
View file @
af4ce2d0
...
...
@@ -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>
...
...
src/etc/inc/services.inc
View file @
af4ce2d0
...
...
@@ -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'
]);
...
...
src/etc/inc/upgrade_config.inc
View file @
af4ce2d0
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment