From b762ceac3e66992e22ddb43f45f21a26d68e6ee0 Mon Sep 17 00:00:00 2001 From: Sheldon Lee Date: Thu, 5 Sep 2024 13:24:38 +0800 Subject: [PATCH] Add misc script --- .config/scripts/misc/copy-music-covers.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 .config/scripts/misc/copy-music-covers.sh diff --git a/.config/scripts/misc/copy-music-covers.sh b/.config/scripts/misc/copy-music-covers.sh new file mode 100755 index 0000000..981a1a5 --- /dev/null +++ b/.config/scripts/misc/copy-music-covers.sh @@ -0,0 +1,11 @@ +#!/bin/bash +find "~/Music" -type f -iname '*cover.*' | while read file; do + destfile=$(echo "$file" | sed 's/Music/Music-transcode/') + mkdir -p "$(dirname "$destfile")" + if [ -f "$destfile" ]; then + echo "$destfile file exists" + else + cp -i "$file" "$destfile" + echo "copying to $destfile" + fi +done