Books/2026.04-Longing/latex/rdiff.sh
2026-06-30 08:19:02 -07:00

33 lines
817 B
Bash

#!/bin/bash
# rdiff.sh - compare .tex files between Dropbox and WSL canonical copy
DB=$HOME/dropbox/longing/
WSL=/mnt/e/ldrive/GrailHeart/books/Longing/latex/
echo "=== .tex files newer in Dropbox (iPad edits) ==="
find $DB -name '*.tex' | while read dbfile; do
relpath=${dbfile#$DB}
wslfile="$WSL$relpath"
if [ -f "$wslfile" ]; then
if [ "$dbfile" -nt "$wslfile" ]; then
echo " DB newer: $relpath"
elif [ "$wslfile" -nt "$dbfile" ]; then
echo " WSL newer: $relpath"
else
echo " same: $relpath"
fi
else
echo " DB only: $relpath"
fi
done
echo ""
echo "=== .tex files only in WSL ==="
find $WSL -name '*.tex' | while read wslfile; do
relpath=${wslfile#$WSL}
dbfile="$DB$relpath"
if [ ! -f "$dbfile" ]; then
echo " WSL only: $relpath"
fi
done