diff options
author | Raymaekers Luca <luca@spacehb.net> | 2025-01-21 23:05:03 +0100 |
---|---|---|
committer | Raymaekers Luca <luca@spacehb.net> | 2025-01-21 23:05:03 +0100 |
commit | a5d21a49ccdc6141790085d4bd26b667b8d5618d (patch) | |
tree | c952cf834458da4938dfca837abe6323283d2bb8 /bin/extra/muz-sync | |
parent | efcd2b7cdb03a354bd4311bac75953738ec34e4f (diff) |
checkpoint
Diffstat (limited to 'bin/extra/muz-sync')
-rwxr-xr-x | bin/extra/muz-sync | 25 |
1 files changed, 22 insertions, 3 deletions
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 |