Learning immediately: https://edu.csdn.net/course/play/27216/358411?utm_source=blogtoedu
1. The log generation to the root directory logs / access.log, default "main" format.
2. log cutting using a script and timing to achieve the task.
Script Content:
#/bin/bash
LOG_HOME="/opt/nginx/logs"
LOG_PATH_BAK="$(date -d yestoday %Y%m%d)".access.log
mv ${LOG_HOME}/access.log ${LOG_HOME}/${LOG_PATH_BAK}
kill USER1 `cat /opt/nginx/logs/nginx.pid`
Online Cron Generator: cron.qqe2.com