dip

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

commit 5c612d1e025b78840f2c6b0c39c7258656db49c0
parent 251c1f0202dc9cc34ff9a234e2e6df7436bf7451
Author: rsiddharth <s@ricketyspace.net>
Date:   Tue,  7 Aug 2018 21:50:32 +0000

usr/local: Update bin/tball (should_tb).

Add new function should_tb.

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

diff --git a/usr/local/bin/tball b/usr/local/bin/tball @@ -83,6 +83,22 @@ dir_updated() { return $(file_updated $F $DEST) } +should_tb() { + local SRC=$1 + local DEST=$2 + + # Get the number of tballs that exists + local TBALLS=$(find $DEST -type f -name '*.enchive' | wc -l) + [[ $TBALLS == 0 ]] && return 1 + + if [ -d $SRC ]; then + # Check if any files under this directory was modified <= 24hrs + return $(dir_updated $SRC $DEST) + else + return $(file_updated $SRC $DEST) + fi +} + tb() { local SRC=${1/#\~/$HOME} local BDEST=${2/#\~/$HOME}