From: Steven Baltakatei Sandoval Date: Thu, 28 Jan 2021 04:37:53 +0000 (+0000) Subject: feat(sysutils:bkStConflictFinder):Add Bash script X-Git-Tag: 0.4.0~2 X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/commitdiff_plain/bad48c8fd77fd9f0364e9f425bed4a96059d3328?ds=sidebyside;hp=-c feat(sysutils:bkStConflictFinder):Add Bash script --- bad48c8fd77fd9f0364e9f425bed4a96059d3328 diff --git a/sysutils/bkStConflictFinder.sh b/sysutils/bkStConflictFinder.sh new file mode 100644 index 0000000..77a11cf --- /dev/null +++ b/sysutils/bkStConflictFinder.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Desc: Identifies `sync-conflict` files in specified directory +# recursively. +# Usage: syncthingConflictFinder.sh arg1 +# Example: syncthingConflictFinder.sh "$HOME/Sync/" +# Input: arg1 [path of dir to search recursively] +# Version: 0.1.0 + +arg1="$1"; # Get argument 1 + +# Validate dir +if [ -d "$arg1" ]; then + searchDir="$arg1"; + echo "DEBUG:searchDir:$searchDir" 1>&2; +else + echo "ERROR:Not a dir:$arg1" 1>&2; exit 1; +fi; + +# List `sync-conflict` files. +find -L "$searchDir" -type f -iname "*sync-conflict*" -exec du -h {} \; 2>/dev/null; + +# List `sync-conflict` files of size 1 MB to 999 GB. +#find -L "$searchDir" -type f -iname "*sync-conflict*" -exec du -h {} \; 2>/dev/null | grep "G \|M "; + + +#==License Info== +# Author: Steven Baltakatei Sandoval (reboil.com) +# License: GPLv3+ + +#===Dependency Version Information=== +# find (GNU findutils) 4.6.0.225-235f +# Copyright (C) 2019 Free Software Foundation, Inc. +# License GPLv3+: GNU GPL version 3 or later . +# This is free software: you are free to change and redistribute it. +# There is NO WARRANTY, to the extent permitted by law. + +# Written by Eric B. Decker, James Youngman, and Kevin Dalley. +# Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS(FTS_CWDFD) CBO(level=2) + + +# grep (GNU grep) 3.3 +# Copyright (C) 2018 Free Software Foundation, Inc. +# License GPLv3+: GNU GPL version 3 or later . +# This is free software: you are free to change and redistribute it. +# There is NO WARRANTY, to the extent permitted by law. + +# Written by Mike Haertel and others; see +# .