apache (1) 썸네일형 리스트형 [AWS] EC2 아파치 로그를 S3 버킷으로 업로드 후 삭제 , 로그 관리 하는 방법 #!/bin/bash # AWS 자격 증명 설정 export AWS_ACCESS_KEY_ID="xxxxxxxxxxxxxx" export AWS_SECRET_ACCESS_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" export AWS_DEFAULT_REGION="xxxxxxxxxxx" # 로그 파일 경로 및 S3 경로 설정 LOG_PATH="/var/log/httpd/" S3_BUCKET="버킷명" S3_PREFIX="logs/$(date -d 'yesterday' +'%Y/%m')/" # 어제의 로그 파일을 S3로 이동 aws s3 cp "${LOG_PATH}access_log-$(date -d 'yesterday' +'%Y%m%d')" "s3://${S3_BUC.. 이전 1 다음