Last active
December 22, 2015 04:48
-
-
Save timkinnane/6419110 to your computer and use it in GitHub Desktop.
Remove old uploads in gravity forms. e.g. Schedule as cron job after backups.
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
# find uploads > not web files > files only > older than 6 months | |
find ~/public_html/wp-content/uploads/gravity_forms/* -not -name "*.html" -not -name "*.php" -type f -mtime +182 | |
# Find > delete | |
find ~/public_html/wp-content/uploads/gravity_forms/* -not -name "*.html" -not -name "*.php" -type f -mtime +182 -exec rm {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment