Adding sample logrotation config and cron
This will allow pool operators to rotate the logfiles automatically via cron.
This commit is contained in:
parent
6a04666ec3
commit
9ff455d0dd
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
|||||||
/public/include/config/global.inc.php
|
/public/include/config/global.inc.php
|
||||||
/public/templates/compile/*.php
|
/public/templates/compile/*.php
|
||||||
/cronjobs/logs/*.txt
|
/cronjobs/logs/*.txt
|
||||||
|
/cronjobs/logs/*.txt.*.gz
|
||||||
/public/templates/cache/*.php
|
/public/templates/cache/*.php
|
||||||
|
|||||||
6
cronjobs/etc/logrotate.conf
Normal file
6
cronjobs/etc/logrotate.conf
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
"./logs/*.txt" {
|
||||||
|
copytruncate
|
||||||
|
rotate 7
|
||||||
|
compress
|
||||||
|
daily
|
||||||
|
}
|
||||||
11
cronjobs/logrotate.sh
Executable file
11
cronjobs/logrotate.sh
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Find scripts path
|
||||||
|
if [[ -L $0 ]]; then
|
||||||
|
CRONHOME=$( dirname $( readlink $0 ) )
|
||||||
|
else
|
||||||
|
CRONHOME=$( dirname $0 )
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd $CRONHOME
|
||||||
|
logrotate etc/logrotate.conf
|
||||||
Loading…
Reference in New Issue
Block a user