Skip to content

Instantly share code, notes, and snippets.

@aamsur-mkt
Last active March 23, 2020 04:37
Show Gist options
  • Select an option

  • Save aamsur-mkt/91f68a898b9c38a465bf988b9efd1795 to your computer and use it in GitHub Desktop.

Select an option

Save aamsur-mkt/91f68a898b9c38a465bf988b9efd1795 to your computer and use it in GitHub Desktop.
Convert All Log to Tgz
# 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