Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 657 Bytes

README.md

File metadata and controls

19 lines (14 loc) · 657 Bytes

nginx-log-rotation

996.icu LICENSE

Nginx log file housekeep/rotation

  1. put the nginx_log_rotation.sh in some where, e.g. /usr/local/nginx_log_rotation.sh
  2. add system crontab task(executed every 0 a.m.):
> crontab -e
> 0 0 * * * /bin/sh /usr/local/nginx_log_rotation.sh
> :wq!

Tips:

  1. Before using it, pls change nginx_home, nginx_log_path and keep_days in this script according to your requirement/environment.
  2. Running on CentOS7.4