Skip to content

Instantly share code, notes, and snippets.

@debuglevel
Last active December 25, 2022 18:31
Show Gist options
  • Save debuglevel/92dd29a0486354803b74d0ea7b9d3378 to your computer and use it in GitHub Desktop.
Save debuglevel/92dd29a0486354803b74d0ea7b9d3378 to your computer and use it in GitHub Desktop.
Compress old files (e.g. logs)
# Compress all
# ... files
# ... older than 30 days
# ... not already compressed
find . -mtime +30 -type f -not -name "*.xz" -exec xz {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment