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
07799412
Commit
07799412
authored
Apr 26, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cron: shift conditions, cron entries can now be entry
parent
8be72857
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
19 deletions
+21
-19
services.inc
src/etc/inc/services.inc
+21
-19
No files found.
src/etc/inc/services.inc
View file @
07799412
...
...
@@ -2444,28 +2444,30 @@ function configure_cron()
/* please maintain the newline at the end of file */
$crontab_contents
=
implode
(
"
\n
"
,
$crontab_contents
)
.
"
\n
"
;
$crontab_contents
.=
"#
\n
"
;
$crontab_contents
.=
$anchor
.
"
\n
"
;
$crontab_contents
.=
'# auto-generated at '
.
date
(
'F j, Y, g:i a'
)
.
"
\n
"
;
$crontab_contents
.=
"#
\n
"
;
if
(
isset
(
$config
[
'cron'
][
'item'
]))
{
$crontab_contents
.=
"#
\n
"
;
$crontab_contents
.=
$anchor
.
"
\n
"
;
$crontab_contents
.=
'# auto-generated at '
.
date
(
'F j, Y, g:i a'
)
.
"
\n
"
;
$crontab_contents
.=
"#
\n
"
;
foreach
(
array_merge
(
$config
[
'cron'
][
'item'
],
$autocron
)
as
$item
)
{
$crontab_contents
.=
"
\n
{
$item
[
'minute'
]
}
\t
"
;
$crontab_contents
.=
"
{
$item
[
'hour'
]
}
\t
"
;
$crontab_contents
.=
"
{
$item
[
'mday'
]
}
\t
"
;
$crontab_contents
.=
"
{
$item
[
'month'
]
}
\t
"
;
$crontab_contents
.=
"
{
$item
[
'wday'
]
}
\t
"
;
$crontab_contents
.=
"
{
$item
[
'who'
]
}
\t
"
;
$crontab_contents
.=
"
{
$item
[
'command'
]
}
"
;
}
$crontab_contents
.=
"
\n
#
\n
"
;
$crontab_contents
.=
"# If possible do not add items to this file manually.
\n
"
;
$crontab_contents
.=
"# If you do so, this file must be terminated with a blank line (e.g. new line)
\n
"
;
$crontab_contents
.=
"#
\n\n
"
;
$autocron
=
array_merge
(
$config
[
'cron'
][
'item'
],
$autocron
);
}
foreach
(
$autocron
as
$item
)
{
$crontab_contents
.=
"
\n
{
$item
[
'minute'
]
}
\t
"
;
$crontab_contents
.=
"
{
$item
[
'hour'
]
}
\t
"
;
$crontab_contents
.=
"
{
$item
[
'mday'
]
}
\t
"
;
$crontab_contents
.=
"
{
$item
[
'month'
]
}
\t
"
;
$crontab_contents
.=
"
{
$item
[
'wday'
]
}
\t
"
;
$crontab_contents
.=
"
{
$item
[
'who'
]
}
\t
"
;
$crontab_contents
.=
"
{
$item
[
'command'
]
}
"
;
}
$crontab_contents
.=
"
\n
#
\n
"
;
$crontab_contents
.=
"# If possible do not add items to this file manually.
\n
"
;
$crontab_contents
.=
"# If you do so, this file must be terminated with a blank line (e.g. new line)
\n
"
;
$crontab_contents
.=
"#
\n\n
"
;
file_put_contents
(
'/etc/crontab'
,
$crontab_contents
);
unset
(
$crontab_contents
);
...
...
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