0
리눅스 시스템 관리자를 위해 지정된 스토리지 임계값 및 보존 기간을 충족하는 자동화 Bash 로그 정리 스크립트를 생성하며 오류 검사 및 실행 로깅 기능을 제공합니다.
복사
Based on the log storage directory, disk usage warning threshold and log retention days I provide, generate a runnable Bash automation cleaning script for Linux. The script automatically traverses the directory to delete expired compressed log files, add disk space judgment logic, additionally clean uncompressed old logs when directory usage exceeds the threshold, also add basic error capture and execution record output, adapt to common CentOS and Ubuntu system environments.
복사
내가 제공한 로그 저장 디렉토리, 디스크 사용량 경고 임계값 및 로그 보존 일수를 바탕으로 리눅스에서 실행 가능한 Bash 자동화 정리 스크립트를 생성해 주세요. 스크립트는 디렉토리를 자동으로 순회하며 만료된 압축 로그 파일을 삭제하고 디스크 공간 판단 로직을 추가하며 디렉토리 사용량이 임계값을 초과했을 때 압축되지 않은 오래된 로그를 추가로 정리하고 기본 오류 캡처와 실행 기록 출력도 추가하며 일반적인 CentOS 및 Ubuntu 시스템 환경에 맞춰줍니다.
복사
추천





집
