Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
logrotate
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
certo
logrotate
Commits
b77b8ca1
Commit
b77b8ca1
authored
May 25, 2019
by
Vladimir Bashkirtsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial commit
parents
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
0 deletions
+85
-0
Makefile
Makefile
+85
-0
logrotate-3.15.0.tar.xz
logrotate-3.15.0.tar.xz
+0
-0
No files found.
Makefile
0 → 100644
View file @
b77b8ca1
all
:
logrotate-conf
tar
xf logrotate-3.15.0.tar.xz
cd
logrotate-3.15.0
&&
./configure
--prefix
=
/usr
$(MAKE)
-C
logrotate-3.15.0
$(MAKE)
-C
logrotate-3.15.0
test
$(MAKE)
-C
logrotate-3.15.0
install
rm
-rf
logrotate-3.15.0
echo
"$$LOGROTATE_CONF"
>
/etc/logrotate.conf
chmod
-v
0644
/etc/logrotate.conf
mkdir
-p
/etc/logrotate.d
@echo
"$$LOGROTATE_TIMER"
>
/lib/systemd/system/logrotate.timer
@echo
"$$LOGROTATE_SERVICE"
>
/lib/systemd/system/logrotate.service
systemctl
enable
logrotate.timer
logrotate-conf
:
define
LOGROTATE_CONF
# Begin of /etc/logrotate.conf
# Rotate log files weekly
weekly
# Don't mail logs to anybody
nomail
# If the log file is empty, it will not be rotated
notifempty
# Number of backups that will be kept
# This will keep the 2 newest backups only
rotate
2
# Create new empty files after rotating old ones
# This will create empty log files, with owner
# set to root, group set to sys, and permissions 644
create
0664
root
sys
# Compress the backups with gzip
compress
# No packages own lastlog or wtmp -- rotate them here
/var/log/wtmp
{
monthly
create
0664
root
utmp
rotate
1
}
/var/log/lastlog
{
monthly
rotate
1
}
# Some packages drop log rotation info in this directory
# so we include any file in it.
include
/etc/logrotate.d
# End of /etc/logrotate.conf
endef
export
LOGROTATE_CONF
logrotate-timer
:
define
LOGROTATE_TIMER
[Unit]
Description
=
Run log rotation periodically
[Timer]
OnCalendar
=
daily
Persistent
=
true
[Install]
WantedBy
=
timers.target
endef
export
LOGROTATE_TIMER
logrotate-service
:
define
LOGROTATE_SERVICE
[Unit]
Description
=
Rotate logs
[Service]
Type
=
simple
ExecStart
=
/usr/sbin/logrotate /etc/logrotate.conf
endef
export
LOGROTATE_SERVICE
logrotate-3.15.0.tar.xz
0 → 100644
View file @
b77b8ca1
File added
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