Luigi Santivetti | b77f702 | 2020-11-08 01:04:55 +0000 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # logrotate - holder |
| 4 | # |
| 5 | # Copyright 2019 Luigi Santivetti <luigi.santivetti@gmail.com> |
| 6 | |
| 7 | # Permission is hereby granted, free of charge, to any person obtaining a |
| 8 | # copy of this software and associated documentation files (the "Software"), |
| 9 | # to deal in the Software without restriction, including without limitation |
| 10 | # the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 11 | # and/or sell copies of the Software, and to permit persons to whom the |
| 12 | # Software is furnished to do so, subject to the following conditions: |
| 13 | |
| 14 | # The above copyright notice and this permission notice (including the next |
| 15 | # paragraph) shall be included in all copies or substantial portions of the |
| 16 | # Software. |
| 17 | |
| 18 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 19 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 20 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 21 | # ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| 22 | # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 23 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 24 | |
| 25 | _LOGROTATE_DKRC_SERVICE_="logrotate" |
| 26 | _LOGROTATE_DKRC_IMAGE_="${host_name}-img-${_LOGROTATE_DKRC_SERVICE_}" |
| 27 | _LOGROTATE_DKRC_CONTAINER_="${host_name}-con-${_LOGROTATE_DKRC_SERVICE_}" |
| 28 | _LOGROTATE_DKRC_CONTEXT_="${mod_docker_d}" |
| 29 | _LOGROTATE_DKRC_DOCKERFILE_="Dockerfile" |
| 30 | _LOGROTATE_TRUNCATE_="copytruncate" |
| 31 | _LOGROTATE_COMPRESS_="nocompress" |
| 32 | _LOGROTATE_ROTATE_="0" |
| 33 | _LOGROTATE_SIZE_="5M" |
| 34 | _LOGROTATE_CRON_="hourly" |
| 35 | _LOGROTATE_CROND_LEVEL_="7" |
| 36 | _LOGROTATE_LOG_D_="${mod_rootfs_d}/var/log" |
| 37 | _LOGROTATE_LOG_CON_D_="/logs" |
| 38 | _LOGROTATE_CONF_F_="$logrotate_conf_f" |
| 39 | _LOGROTATE_LOGROTATE_CONF_T_UID_="0" |
| 40 | _LOGROTATE_LOGROTATE_CONF_T_GID_="0" |
| 41 | _LOGROTATE_CONF_CON_F_="/etc/logrotate.conf" |
| 42 | _LOGROTATE_FILE_PATTERN_="${_LOGROTATE_LOG_CON_D_}/*/*.txt" |
| 43 | _LOGROTATE_APACHE_FILE_PATTERN_="${_LOGROTATE_LOG_CON_D_}/apache2/*.log" |
| 44 | _LOGROTATE_APACHE_FILE_PATTERN_+=" ${_LOGROTATE_LOG_CON_D_}/apache2/*.txt" |
| 45 | _LOGROTATE_APACHE_USER_="www-data" |
| 46 | _LOGROTATE_APACHE_UID_="33" |
| 47 | _LOGROTATE_APACHE_GID_="33" |
| 48 | _LOGROTATE_MYSQL_FILE_PATTERN_="${_LOGROTATE_LOG_CON_D_}/mysql/*.txt" |
| 49 | _LOGROTATE_MYSQL_USER_="mysql" |
| 50 | _LOGROTATE_MYSQL_UID_="999" |
| 51 | _LOGROTATE_MYSQL_GID_="999" |
| 52 | _LOGROTATE_OPENSSH_FILE_PATTERN_="${_LOGROTATE_LOG_CON_D_}/openssh/*.txt" |
| 53 | _LOGROTATE_OPENSSH_USER_="githuser" |
| 54 | _LOGROTATE_OPENSSH_UID_="1001" |
| 55 | _LOGROTATE_OPENSSH_GID_="1001" |