From 314ad8d94c5ff33fd2eadb1027748550be0e7e4f Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sun, 10 Feb 2019 22:36:04 +0100 Subject: camelCase -> no-camel-case, backup-progress new --- check-diff | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 check-diff (limited to 'check-diff') diff --git a/check-diff b/check-diff new file mode 100755 index 0000000..8643e04 --- /dev/null +++ b/check-diff @@ -0,0 +1,28 @@ +#!/bin/sh + +a="$1" +aDat="$( + echo "${a}" | \ + tr '/' '\n' | \ + grep -m1 '^[0-9]\{4\}\(_[0-9]\{2\}\)\{2\}$' +)" +dir="$( + echo "${a}" | \ + sed "s|/${aDat}/.*$||" +)" +bDat="$( + ls -1 "${dir}" | \ + grep -v "^${aDat}\$" | \ + grep '^[0-9]\{4\}\(_[0-9]\{2\}\)\{2\}$' | \ + sort | \ + tail -n1 +)" +b="$( + echo "${a}" | \ + sed "s|/2016_12_[0-9][0-9]/|/${bDat}/|" +)" + +(diff -q "$a" "$b" 2> /dev/null > /dev/null) \ + && [ "$(stat "$a" -c'%h')" -lt 64000 ] \ + && [ "$(stat "$b" -c'%h')" -lt 64000 ] \ + && echo "'$a' equals '$b'" -- cgit v1.2.3-70-g09d2