Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Aurélien Vermylen
erp5
Commits
9278fcc0
Commit
9278fcc0
authored
May 05, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move rotated logs to backup directory.
parent
232ac37a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
slapos/recipe/erp5/src/slapos/recipe/erp5/__init__.py
slapos/recipe/erp5/src/slapos/recipe/erp5/__init__.py
+4
-3
slapos/recipe/erp5/src/slapos/recipe/erp5/template/logrotate_entry.in
...e/erp5/src/slapos/recipe/erp5/template/logrotate_entry.in
+1
-0
No files found.
slapos/recipe/erp5/src/slapos/recipe/erp5/__init__.py
View file @
9278fcc0
...
@@ -55,7 +55,7 @@ class Recipe(BaseSlapRecipe):
...
@@ -55,7 +55,7 @@ class Recipe(BaseSlapRecipe):
self
.
requirements
,
self
.
ws
=
self
.
egg
.
working_set
([
__name__
])
self
.
requirements
,
self
.
ws
=
self
.
egg
.
working_set
([
__name__
])
# self.cron_d is a directory, where cron jobs can be registered
# self.cron_d is a directory, where cron jobs can be registered
self
.
cron_d
=
self
.
installCrond
()
self
.
cron_d
=
self
.
installCrond
()
self
.
logrotate_d
=
self
.
installLogrotate
()
self
.
logrotate_d
,
self
.
logrotate_backup
=
self
.
installLogrotate
()
self
.
killpidfromfile
=
zc
.
buildout
.
easy_install
.
scripts
(
self
.
killpidfromfile
=
zc
.
buildout
.
easy_install
.
scripts
(
[(
'killpidfromfile'
,
__name__
+
'.killpidfromfile'
,
[(
'killpidfromfile'
,
__name__
+
'.killpidfromfile'
,
'killpidfromfile'
)],
self
.
ws
,
sys
.
executable
,
self
.
bin_directory
)[
0
]
'killpidfromfile'
)],
self
.
ws
,
sys
.
executable
,
self
.
bin_directory
)[
0
]
...
@@ -134,6 +134,7 @@ class Recipe(BaseSlapRecipe):
...
@@ -134,6 +134,7 @@ class Recipe(BaseSlapRecipe):
logrotate_d
=
os
.
path
.
abspath
(
os
.
path
.
join
(
self
.
etc_directory
,
logrotate_d
=
os
.
path
.
abspath
(
os
.
path
.
join
(
self
.
etc_directory
,
'logrotate.d'
))
'logrotate.d'
))
self
.
_createDirectory
(
logrotate_d
)
self
.
_createDirectory
(
logrotate_d
)
logrotate_backup
=
self
.
createBackupDirectory
(
'logrotate'
)
logrotate_conf
=
self
.
createConfigurationFile
(
"logrotate.conf"
,
logrotate_conf
=
self
.
createConfigurationFile
(
"logrotate.conf"
,
"include %s"
%
logrotate_d
)
"include %s"
%
logrotate_d
)
logrotate_cron
=
os
.
path
.
join
(
self
.
cron_d
,
'logrotate'
)
logrotate_cron
=
os
.
path
.
join
(
self
.
cron_d
,
'logrotate'
)
...
@@ -141,7 +142,7 @@ class Recipe(BaseSlapRecipe):
...
@@ -141,7 +142,7 @@ class Recipe(BaseSlapRecipe):
open
(
logrotate_cron
,
'w'
).
write
(
'0 0 * * * %s -s %s %s'
%
open
(
logrotate_cron
,
'w'
).
write
(
'0 0 * * * %s -s %s %s'
%
(
self
.
options
[
'logrotate_binary'
],
state_file
,
logrotate_conf
))
(
self
.
options
[
'logrotate_binary'
],
state_file
,
logrotate_conf
))
self
.
path_list
.
extend
([
logrotate_d
,
logrotate_conf
,
logrotate_cron
])
self
.
path_list
.
extend
([
logrotate_d
,
logrotate_conf
,
logrotate_cron
])
return
logrotate_d
return
logrotate_d
,
logrotate_backup
def
registerLogRotation
(
self
,
name
,
log_file_list
,
postrotate_script
):
def
registerLogRotation
(
self
,
name
,
log_file_list
,
postrotate_script
):
"""Register new log rotation requirement"""
"""Register new log rotation requirement"""
...
@@ -149,7 +150,7 @@ class Recipe(BaseSlapRecipe):
...
@@ -149,7 +150,7 @@ class Recipe(BaseSlapRecipe):
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'logrotate_entry.in'
),
'logrotate_entry.in'
),
dict
(
file_list
=
' '
.
join
([
'"'
+
q
+
'"'
for
q
in
log_file_list
]),
dict
(
file_list
=
' '
.
join
([
'"'
+
q
+
'"'
for
q
in
log_file_list
]),
postrotate
=
postrotate_script
)))
postrotate
=
postrotate_script
,
olddir
=
self
.
logrotate_backup
)))
def
linkBinary
(
self
):
def
linkBinary
(
self
):
"""Links binaries to instance's bin directory for easier exposal"""
"""Links binaries to instance's bin directory for easier exposal"""
...
...
slapos/recipe/erp5/src/slapos/recipe/erp5/template/logrotate_entry.in
View file @
9278fcc0
...
@@ -9,4 +9,5 @@
...
@@ -9,4 +9,5 @@
postrotate
postrotate
%(postrotate)s
%(postrotate)s
endscript
endscript
olddir %(olddir)s
}
}
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