From 4a0b01d7a88040ca60dbd0eaae872921a9f88ed0 Mon Sep 17 00:00:00 2001 From: schmeeve Date: Sun, 14 Jun 2026 16:37:20 -0700 Subject: [PATCH] add recursive to sync-pictures --- sync-pictures | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/sync-pictures b/sync-pictures index 56c0490..5b71581 100755 --- a/sync-pictures +++ b/sync-pictures @@ -9,6 +9,8 @@ # # Adjust SHARE and SUBPATH to match your environment. +RECURSIVE="" + for arg in "$@"; do case "$arg" in --help|-h) @@ -18,10 +20,14 @@ Usage: sync-pictures [options] Sync ~/Pictures to a NAS share and run neatcli organize on both ends. Options: - -h, --help Show this help message and exit + -r, --recursive Sync subdirectories recursively (default: top-level files only) + -h, --help Show this help message and exit EOF exit 0 ;; + --recursive|-r) + RECURSIVE=1 + ;; esac done @@ -55,11 +61,14 @@ fi # 2. One-way rsync contents of ~/Pictures → share subpath MP="${MOUNTPOINT}/${SUBPATH}" echo "[sync-pictures] Syncing ${SOURCE}/ → ${MP}/" -rsync -vu --exclude='*/' \ +RSYNC_FLAGS=(-vu --progress --stats --exclude=".DS_Store") +if [ -z "${RECURSIVE}" ]; then + RSYNC_FLAGS+=(--exclude='*/') +fi + +rsync "${RSYNC_FLAGS[@]}" \ "${SOURCE}/" \ - "${MP}/" \ - --progress --stats \ - --exclude=".DS_Store" + "${MP}/" # 3. Run neatcli organize on both source and dest if command -v neatcli &>/dev/null; then