updates for --help
This commit is contained in:
@@ -13,6 +13,22 @@
|
||||
#
|
||||
# Adjust SHARE, SUBPATH, and SOURCE to match your environment.
|
||||
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--help|-h)
|
||||
cat <<'EOF'
|
||||
Usage: sync-webgoggles [options]
|
||||
|
||||
Sync ~/webGoggles to a NAS share, with deduplication and old-session thinning.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help message and exit
|
||||
EOF
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
SHARE="//ts.nas/aura"
|
||||
SUBPATH="webGoggles"
|
||||
MOUNTPOINT="${HOME}/mnt/ts.nas/aura"
|
||||
@@ -46,7 +62,16 @@ else
|
||||
echo "[sync-webgoggles] Mounted at ${MOUNTPOINT}"
|
||||
fi
|
||||
|
||||
# 2. One-way rsync of SOURCE into the share subpath
|
||||
# 2. Run pick-most-skin on local source to find best screenshot per user
|
||||
PICK_SCRIPT="$(dirname "$0")/pick-most-skin"
|
||||
if [ -x "${PICK_SCRIPT}" ]; then
|
||||
echo "[sync-webgoggles] Running ${PICK_SCRIPT} ${SOURCE}"
|
||||
"${PICK_SCRIPT}" "${SOURCE}"
|
||||
else
|
||||
echo "[sync-webgoggles] Warning: ${PICK_SCRIPT} not found, skipping"
|
||||
fi
|
||||
|
||||
# 3. One-way rsync of SOURCE into the share subpath
|
||||
MP="${MOUNTPOINT}/${SUBPATH}"
|
||||
mkdir -p "${MP}"
|
||||
echo "[sync-webgoggles] Syncing ${SOURCE}/ → ${MP}/"
|
||||
@@ -58,7 +83,7 @@ rsync -vrau \
|
||||
--exclude=".DS_Store" \
|
||||
--progress --stats
|
||||
|
||||
# 3. Cleanup: deduplicate and thin old screenshots on destination
|
||||
# 4. Cleanup: deduplicate and thin old screenshots on destination
|
||||
cleanup_destination() {
|
||||
local dest="$1"
|
||||
local thin_days="${2:-42}" # default 6 weeks
|
||||
|
||||
Reference in New Issue
Block a user