Last active
March 23, 2020 04:37
-
-
Save aamsur-mkt/91f68a898b9c38a465bf988b9efd1795 to your computer and use it in GitHub Desktop.
Convert All Log to Tgz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # go to your folder then run this script | |
| # this script will loop by file names (*.log) in current folder, create tgz then remove source file | |
| for d in ./*.log; do tar zcvf $d.tgz $d && rm $d; done | |
| # with +30 days old filter | |
| for d in `find ./*.log -type f -mtime +30`; do tar zcvf $d.tgz $d && rm $d; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment