iankelling.org
/
git
/
distro-setup
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
36f92d5
)
fix false positive conflink detection
author
Ian Kelling
<ian@iankelling.org>
Sat, 19 Oct 2019 17:45:51 +0000
(13:45 -0400)
committer
Ian Kelling
<ian@iankelling.org>
Sat, 19 Oct 2019 17:45:51 +0000
(13:45 -0400)
system-status
patch
|
blob
|
history
diff --git
a/system-status
b/system-status
index d6db7c3eb57b351c01b97c627376f55ad424e33f..c58d9cea7f6eb3efceae04e08d85c1ce386bfa22 100755
(executable)
--- a/
system-status
+++ b/
system-status
@@
-64,6
+64,8
@@
write-status() {
if [[ -e $f ]]; then
now=$(date +%s)
fsec=$(stat -c%Y $f)
if [[ -e $f ]]; then
now=$(date +%s)
fsec=$(stat -c%Y $f)
+ # the / 60 makes it 0-59 seconds less strict, +1 makes sure we
+ # dont have any false positives.
fmin=$(( (fsec - now ) / 60 + 1 ))
fminplus=$(( fmin + 60*24 ))
# Filesystem files get copied, so find any newer than the last run.
fmin=$(( (fsec - now ) / 60 + 1 ))
fminplus=$(( fmin + 60*24 ))
# Filesystem files get copied, so find any newer than the last run.
@@
-78,6
+80,7
@@
write-status() {
if grep -qxF $HOSTNAME $x; then all_dirs+=( ${x%.hosts} ); fi
done
if grep -qxF $HOSTNAME $x; then all_dirs+=( ${x%.hosts} ); fi
done
+ # just because i forget a lot, -mmin -NUM means files modified <= NUM minutes ago
if (( $(date -d "$(git log --diff-filter=ACR --format=%aD -1)" +%s) > fsec )) || \
[[ $(find ${all_dirs[@]} -mmin $fmin -type f -print -quit 2>/dev/null) ]]; then
v conflink newer git or newer filesystem files
if (( $(date -d "$(git log --diff-filter=ACR --format=%aD -1)" +%s) > fsec )) || \
[[ $(find ${all_dirs[@]} -mmin $fmin -type f -print -quit 2>/dev/null) ]]; then
v conflink newer git or newer filesystem files