Nginx log replacement ubuntu terminal enter CentOS input: ssh server id address-lroot then press Enter enter login password: * ****** in the window, the putty client [CentOS] shell is used to enter CentOS. The simple version is stored in the log Directory #! /Bin/bashpath & quot;/www... nginx log replacement ubuntu terminal enter CentOS input: ssh server id address-l root then press Enter enter login password: * ****** in the window, the putty client [CentOS] shell is used to enter CentOS. The simple version is stored in the log Directory #! /Bin/bash path = "/www/wdlinux/nginx/logs/" dt = $ (date + % Y % m % d) mv $ {path} access. log $ {path} access $ {dt }. log find $ {path}-mtime + 30-type f "access *. log "-exec rm-rf {}\; kill USR1 'cat/www/wdlinx/nginx/logs/ngnix. pid [ngnix. pid Directory] 'set and run crontab-e 00 10 ***/bin/bash/www/wdlinux/nginx/logs/logss at regular intervals. sh [shell Directory]
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service