-
-
Save rtrouton/960bc28798a31cbd802b1723683bec46 to your computer and use it in GitHub Desktop.
801.clean-autopkg-repo script, used to remove files older than a specified date from the AutoPkg cache
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
#!/bin/bash | |
# Remove AutoPkg-downloaded files older than a specified number of days | |
# Add username of the account used to run AutoPkg | |
autopkg_username="autopkg" | |
# Age of files to retain. For example, setting the following number | |
# will delete anything older than 20 days | |
# | |
# autopkg_cache_age="20" | |
autopkg_cache_age="20" | |
/usr/bin/find "/Users/$autopkg_username/Library/AutoPkg/Cache" -mindepth 1 -mtime +"$autopkg_cache_age" -delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment