开发者

Bash(Linux) Shell Script to zip the files older than 30 days

**Search for *.aud files in a directory for past 30 days and zip it; remove all those files after successful zip

I used following but it is not removing the files after zip

find . -mtime -30 | xargs tar --no-recursion -czf Audit_Mar_2011.开发者_开发知识库tgz **


#!/bin.bash
#quick and dirty:
FILES=`find . -mtime -30 | xargs`
tar --no-recursion -czf Audit_Mar_2011.tgz "${FILES}"
rm -rf "${FILES}"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜