Created
July 13, 2018 01:09
-
-
Save simbalinux/7a61af7c327a7949a2d4d8629d67aa5f to your computer and use it in GitHub Desktop.
logrotation configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #place this file in /etc/logrotate.d/ | |
| /var/log/vhosts/*.log { | |
| su root root | |
| copytruncate | |
| rotate 30 | |
| missingok | |
| notifempty | |
| sharedscripts | |
| compress | |
| delaycompress | |
| postrotate | |
| cp -rp /var/log/vhosts/*.log.* /var/www/vhosts/core/log/archive/web0 | |
| cp -rp /var/log/vhosts/*.gz /var/www/vhosts/core/log/archive/web0 | |
| endscript | |
| } | |
| #once completed saving the above snippet in /etc/logrotate.d add below to ROOT crontab | |
| SHELL=/bin/bash | |
| PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
| 0 0 * * * logrotate -fv /etc/logrotate.d/rotate_httpd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment