Nginx log files how to clean up, will become bigger and bigger, affecting the operation of Nginx server, the following small series will introduce you to the way to clean up Nginx logs in Linux, let's understand.
nginx log files require manual segmentation, create a script file clear_log.sh
File Path /usr/local/nginx/clear_log.sh
vi clear_log.sh . Enter the following content
#! /bin/bash
cp /usr/local/nginx/logs/error.log /usr/local/nginx/error-$(date -d “yesterday” +“%Y%m%d&rdquo ;).log
#Copy the original error log file first, please fill in according to your actual log path
cat /dev/null /> /usr/local/nginx/logs/error. Log
#清Error log file
cp/usr/local/nginx/logs/access.log /var/log/nginx/access/access-$(date -d “yesterday&rdquo ; +“%Y%m%d”).log
#Copy the original normal access log first
cat /dev/null 》 /usr/local/nginx/logs/access .log
#Clear the original normal access log
Create the dellog.sh file, path /usr/local/nginx
vi dellog.sh
#! /bin/sh
find /usr/nginx/logs/error -mtime +7 -type f -name /*.log
The ping command in Linux system can be used for network fault diagnosis and check
After the CentOS system is booted, it usually does not start the desktop service. If you need to sta
When Linux uses the vi editor, vi is stuck, and this happens frequently. What is the cause of vi car
In Linux system operation, in order to improve the efficiency of disk read and writ
How to install and use Glances in Linux
Linux configuration yum.conf method
How does the CentOS system remove IP from the Fail2ban blacklist
CentOS 6.0 manual upgrade to CentOS 6.2 method
Differences between Linux system MBR and GPT partitions
Linux uses the blockdev command to adjust the file read-ahead size
Linux crontab command use instance summary
How to set Linux commands as keyboard shortcuts
Steps to delete a folder with a space name in Linux
Detailed changes to the Win10 preview interface: flat icons + narrower borders + new start menu
Windows 10 build 10240 pushes again a security update KB3074683
Win7 installation failure prompt "invalid switch fmount" reason and solution
Win7 firewall prohibits other hosts from accessing the local port
Win7 IIS 7 ASP gets the system date format as a slash solution
Win10 Xiaona icon how to change
How to quickly solve the win8 wireless network limited problem