Skip to content

Commit f37f499

Browse files
committed
multiple logs match
Signed-off-by: Liao PengFei <[email protected]> verify that the file exists Signed-off-by: Liao PengFei <[email protected]>
1 parent 56cf895 commit f37f499

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

playbook/logs/scripts/log_retention.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,12 @@ retention_log() {
7575
continue
7676
fi
7777

78+
if [ -e "/etc/logrotate.d/$dir_path_name" ];then
79+
continue
80+
fi
81+
7882
# Generate logrotate configuration
79-
logrotate_config="${file} {\n"
83+
logrotate_config="${dir_path}/*.log*[!gz] ${dir_path}/*.log {\n"
8084
logrotate_config+=" rotate ${rotate}\n"
8185
logrotate_config+=" ${period}\n"
8286

0 commit comments

Comments
 (0)