From a5d21a49ccdc6141790085d4bd26b667b8d5618d Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 21 Jan 2025 23:05:03 +0100 Subject: checkpoint --- bin/extra/muz-sync | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'bin/extra/muz-sync') diff --git a/bin/extra/muz-sync b/bin/extra/muz-sync index 3a5c5f1..0c2dba2 100755 --- a/bin/extra/muz-sync +++ b/bin/extra/muz-sync @@ -1,9 +1,28 @@ #!/bin/sh trap "exit 1" INT -music="$(xdg-user-dir MUSIC)" ->&2 printf "music: %s\n" "$music" +[ "$1" ] && path="$1" || path="/media/basilisk/music/sorted/" +[ "$2" ] && music="$2" || music="$(xdg-user-dir MUSIC)" +[ "$3" ] && host="$3" || host="autumn" -while ! rsync --recursive --verbose --partial --progress --ignore-existing --size-only db:/media/basilisk/music/sorted/ "$music" +>&2 printf '%s:%s -> %s\n' "$host" "$path" "$music" + +>&2 printf 'Confirm? [y/N] ' +answer="$(head -n 1)" +[ "$answer" ] || exit 1 + +if [ "$answer" != "y" ] && [ "$answer" != "Y" ]; then + exit 1 +fi + +# retry until failure +while ! rsync \ + --recursive \ + --verbose \ + --partial \ + --progress \ + --ignore-existing \ + --size-only \ + "$host":"$path" "$music" do : done -- cgit v1.2.3