Created
May 14, 2021 15:50
-
-
Save rtrouton/5d72da3894577da191059f1393489622 to your computer and use it in GitHub Desktop.
802.remove.autopkg.conductor.logs script, used to remove autopkg-conductor logfiles older than a specified date
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-conductor logfiles older than a specified number of days | |
# Add username of the account used to run AutoPkg | |
autopkg_username="autopkg" | |
# Age of logfiles to retain. For example, setting the following number | |
# will delete anything older than 20 days | |
# | |
# autopkg_log_age="20" | |
autopkg_log_age="20" | |
/usr/bin/find "/Users/$autopkg_username/Library/Logs" -name "autopkg-run-for*" -mindepth 1 -mtime +"$autopkg_log_age" -delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment