dip

old school recipes for janitorial snafu.
git clone git://git.ricketyspace.net/dip.git
Log | Files | Refs

commit 174749ec3e49149d93bce496ba0f652d95210d73
parent e45516a8f09484509971dc46b60613d94f435271
Author: rsiddharth <s@ricketyspace.net>
Date:   Tue, 11 Sep 2018 01:01:03 +0000

usr: tball: Update tb.

Add handling to remove old tballs.

* usr/local/bin/tball (tb): Update function.

Diffstat:
usr/local/bin/tball | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/usr/local/bin/tball b/usr/local/bin/tball @@ -186,6 +186,7 @@ clean_ol_tbs() { tb() { local SRC=${1/#\~/$HOME} local BDEST=${2/#\~/$HOME} + local MAX_TB=$(parse_maxtb $3) # Maximum tballs for a BDEST. parse_src $SRC parse_bdest $BDEST @@ -200,6 +201,7 @@ tb() { should_tb $SRC $DEST [[ $? == 0 ]] && \ echo $SRC 'is good! Not tballing it' \ + && clean_ol_tbs $DEST $MAX_TB \ && return 0 # SUFFIX (current unix time) @@ -234,6 +236,9 @@ tb() { # Store suffix echo $SUFFIX >> $DEST/.suffixes + # Clean up ol' tballs. + clean_ol_tbs $DEST $MAX_TB + # Clean up clean_tmp $TMP_DIR unset DEST