Created
December 6, 2015 14:08
-
-
Save koppor/afbac4d7dc6b4f9885fb to your computer and use it in GitHub Desktop.
Delete old builds at http://builds.jabref.org
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 | |
cd /var/www/builds.jabref.org/www/ | |
# delete all branches not touched for the last 90 days | |
# see http://stackoverflow.com/a/19873824/873282 | |
#find . -mindepth 1 -maxdepth 1 -type d -mtime +90 ! -path "./_h5ai" ! -path "./master" -exec rm {} \; | |
# delete files in the remaining directories | |
# see http://stackoverflow.com/a/13525005/873282 | |
for path in `find . -mindepth 1 -maxdepth 1 -type d ! -path "./_h5ai"`; do | |
cd $path | |
# echo $path | |
# see http://stackoverflow.com/a/4561987/873282 and http://stackoverflow.com/a/17850033/873282 | |
# 3 files in the NSIS case, 4 files in the install4j case | |
# kgV is 12 | |
for file in `find . -type f -printf '%T@ %p\n' | sort -n | tail -n+12 | cut -f2- -d" "`; do | |
rm $file | |
done | |
cd .. | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment