From cd636fe4d7154161b6415774127cda08db8c173c Mon Sep 17 00:00:00 2001 From: ville rantanen Date: Sat, 9 Nov 2013 10:15:20 +0200 Subject: [PATCH] change clean options to partial/revision only --- aerofs/aerofs-clean | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aerofs/aerofs-clean b/aerofs/aerofs-clean index bcfe246..ee892f2 100755 --- a/aerofs/aerofs-clean +++ b/aerofs/aerofs-clean @@ -5,25 +5,29 @@ MyRoot=$( sqlite3 $HOME/.aerofs/conf "SELECT v FROM c WHERE k = 'root';" ) MyDir=$( dirname "$MyRoot" ) AEROAUX=($MyDir/.aerofs.aux*) +function cacheusage { + find "$AEROAUX/" -mindepth 1 -maxdepth 1 -exec du -sh \{\} \; +} if [ -z "$1" ] -then echo partial/revisions/conflicts: '(-f to delete all. -d to delete +3 days)' - du -h -d 1 "$AEROAUX/" +then echo partial/revisions/conflicts: '(-f to delete all. -p/-r to delete +3 days)' + cacheusage exit 0 fi -while getopts "df" OPTS; +while getopts "fpr" OPTS; do case ${OPTS} in f) find "$AEROAUX/r" -mindepth 1 -depth -exec rm -Rf \{\} \; find "$AEROAUX/p" -mindepth 1 -depth -exec rm -Rf \{\} \; - du -h -d 1 "$AEROAUX/" ;; - d) + r) find "$AEROAUX/r" -mindepth 1 -type f -mtime +3 -exec rm -Rf \{\} \; + ;; + p) find "$AEROAUX/p" -mindepth 1 -type f -mtime +3 -exec rm -Rf \{\} \; - du -h -d 1 "$AEROAUX/" ;; esac done +cacheusage