Linux delete log file script reference #! /Bin/bashecho 'date + % Y-% m-% d' & gt ;. /rmCharlog. logfind/opt/app/ium/log/system-mtime + 1-execrm-rf {}\; find/opt/app/ium_wgh/log/system-mtime + 1-exe Linux delete log file script reference #! /Bin/bash echo 'date + % Y-% m-% d'>. /rmCharlog. log find/opt/app/ium/log/system-mtime + 1-exec rm-rf {}\; find/opt/app/ium_wgh/log/system-mtime + 1-exec rm-rf {}\; find/usr/local/apache/logs-mtime + 1-exec rm-rf {}\; echo "************************************** * *************** ">. /rmCharlog. log/*** use man find to see the following description:-mtime n Files data was last modified n * 24 hours ago. so find-mtim E 4 is to find all the files or directories modified within 96 hours. Find-mtime 4 is to find all the file files that were changed four days ago five days ago, and find-mtime-4 is the file that was changed within four days, find-mtime + 4 is the file changed four days later. For example, 10:00:00. Find-mtime 10 searches for files from 10:00:00 to 10:00:00. Find-mtime + 10 find files earlier than 10:00:00; find-mtime + 9 find files earlier than 10:00:00 */
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.