我试过这个:
#!/bin/bash
for f in find /var/lib/tomcat7/logs -name 'testing.*.log' -and -ctime +2 -exec bzip2 -zv {} \;
do
aws s3 mv $f s3://ri-uat-bucket/testing/
done
答案 0 :(得分:0)
使用以下代码:
for f in `find /var/lib/tomcat7/logs -name 'testing.*.log' -ctime +2`
do
bzip2 -zv $f
aws s3 mv $f.bz2 s3://ri-uat-bucket/testing/
done