/
etc
/
logrotate.d
/
Upload File
HOME
/var/log/nginx/*.log { missingok rotate 7 compress delaycompress notifempty nodateext sharedscripts daily postrotate if [ -f /var/run/nginx.pid ]; then kill -USR1 `cat /var/run/nginx.pid` fi endscript } /var/log/nginx/domains/* { olddir /var/log/nginx/domains.rotated createolddir 711 root root missingok rotate 7 compress delaycompress notifempty nodateext nosharedscripts daily prerotate LASTRUNFILE="/var/cpanel/lastrun/splitlogs-flush" SECONDS=3600 if [ ! -f "$LASTRUNFILE" ] || [ "$(( $(date +"%s") - $(stat -c "%Y" "$LASTRUNFILE") ))" -gt "$SECONDS" ]; then killall -SIGHUP --quiet splitlogs # flush logs to disk if needed touch $LASTRUNFILE fi endscript postrotate if [ -f /var/run/nginx.pid ]; then kill -USR1 `cat /var/run/nginx.pid` fi if [ ! -z "$2" ]; then # v3.16.0 # Normally (i.e. not under `sharedscripts`), # the absolute path to the log file is passed as the first argument to the script and # the absolute path to the final rotated log file is passed as the second argument /usr/local/cpanel/scripts/ea-nginx-logrotate 7 else # v3.8.6 # Normally (i.e. not under `sharedscripts`), # the absolute path to the log file is passed as first argument to the script. just_rotated_path="$1.1"; # this will work when /bin/sh -> /bin/bash or /bin/zsh # just_rotated_path=${just_rotated_path/\/var\/log\/nginx\/domains\//\/var\/log\/nginx\/domains.rotated\/} # this will work when /bin/sh -> /bin/dash or /bin/bash or /bin/zsh just_rotated_path=$(echo "$just_rotated_path" | sed "s/\/var\/log\/nginx\/domains\//\/var\/log\/nginx\/domains.rotated\//") /usr/local/cpanel/scripts/ea-nginx-logrotate 7 fi endscript }