From 30e447f18fdfcab7a4eecb8f1c2b8f368e820852 Mon Sep 17 00:00:00 2001 From: z4yx Date: Mon, 23 Mar 2020 09:12:33 +0800 Subject: [PATCH] keep files for one month --- linuxbrew-bottles.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linuxbrew-bottles.sh b/linuxbrew-bottles.sh index 0988e14..96e1e0d 100755 --- a/linuxbrew-bottles.sh +++ b/linuxbrew-bottles.sh @@ -37,7 +37,7 @@ do if [[ -f "$remote_filelist" ]];then # clean outdated files local_filelist=/tmp/filelist.local (cd ${HOMEBREW_CACHE}; find . -type f -iname "*.tmp" -delete) - (cd ${HOMEBREW_CACHE}; find . -type f -iname "*.tar.gz") | sed 's+^\./++' > $local_filelist + (cd ${HOMEBREW_CACHE}; find . -type f -mtime 30 -iname "*.tar.gz") | sed 's+^\./++' > $local_filelist comm <(sort $remote_filelist) <(sort $local_filelist) -13 | while read file; do echo "deleting ${HOMEBREW_CACHE}/${file}" rm "${HOMEBREW_CACHE}/${file}"