Created
April 27, 2015 18:55
-
-
Save mikedamage/0bfa6934545a7918c0fa to your computer and use it in GitHub Desktop.
Quick and dirty time-based file removal
This file contains 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
#!/usr/bin/env zsh | |
setopt NULL_GLOB EXTENDED_GLOB | |
# Files older than this will be deleted | |
KEEP_DAYS=30 | |
files=($PWD/*(.Nmd+$KEEP_DAYS)) | |
for f in $files; do | |
rm -vf "$f" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment