Skip to content

chenrulongmaster/nginx-log-rotation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

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

About

Nginx log file housekeep/rotation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages