From 1fb1b5c3d8e833b63238847618912a6bb1a96262 Mon Sep 17 00:00:00 2001 From: exu Date: Sun, 25 Aug 2024 11:45:25 +0200 Subject: [PATCH] Add separate audiobook script --- .../scripts/in_path/sc-audiobooks-update | 25 +++++++++++++++++++ .../scripts/in_path/sc-jellyfin-update | 9 ------- 2 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 arch-config/scripts/in_path/sc-audiobooks-update diff --git a/arch-config/scripts/in_path/sc-audiobooks-update b/arch-config/scripts/in_path/sc-audiobooks-update new file mode 100644 index 00000000..18534e01 --- /dev/null +++ b/arch-config/scripts/in_path/sc-audiobooks-update @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -euo pipefail + +user=exu +server=he1app14 +port=22 +sshkeypath=$HOME/.ssh/id_ed25519 +# NOTE don't transfer to the storage box directly, leads to mangled file names +# see: https://serverfault.com/a/765951 + +# unlock ssh key +if ! ssh-add -T "${sshkeypath}.pub" &>/dev/null; then + ssh-add -q "$sshkeypath" +fi + +# NAS: audiobooks +rsync -uvrL --progress --delete "/mnt/storage/MediaLibrary/Audiobooks" /mnt/lan1nas1/ & + +# Server: audiobooks +rsync -uvr --progress --delete -e "ssh -i $sshkeypath -p $port" "/mnt/storage/MediaLibrary/Audiobooks" "${user}@${server}:/mnt/media/" + +# wait for background jobs +wait + +echo "Finished transfering data" diff --git a/arch-config/scripts/in_path/sc-jellyfin-update b/arch-config/scripts/in_path/sc-jellyfin-update index b57b8757..e92c4049 100755 --- a/arch-config/scripts/in_path/sc-jellyfin-update +++ b/arch-config/scripts/in_path/sc-jellyfin-update @@ -13,27 +13,18 @@ if ! ssh-add -T "${sshkeypath}.pub" &>/dev/null; then ssh-add -q "$sshkeypath" fi -# Server: sync other files from audiobooks -rsync -uvr --progress -e "ssh -i $sshkeypath -p $port" "${user}@${server}:/mnt/media/Audiobooks" "/mnt/storage/MediaLibrary/" - # NAS: video files rsync -uvr --progress --delete /mnt/storage/MediaLibrary/{Movies,other,Patreon,Shows} /mnt/lan1nas1/ & # NAS: music rsync -uvrL --progress --delete /home/exu/Musik /mnt/lan1nas1/ & -# NAS: audiobooks -rsync -uvrL --progress --delete "/mnt/storage/MediaLibrary/Audiobooks" /mnt/lan1nas1/ & - # Server: music rsync -uvrL --progress --delete -e "ssh -i $sshkeypath -p $port" /home/exu/Musik/ ${user}@${server}:/mnt/media/Musik/ # Server: video files rsync -uvr --progress --delete -e "ssh -i $sshkeypath -p $port" /mnt/storage/MediaLibrary/{Movies,Shows,other} ${user}@${server}:/mnt/media/ -# Server: audiobooks -rsync -uvr --progress --delete -e "ssh -i $sshkeypath -p $port" "/mnt/storage/MediaLibrary/Audiobooks" "${user}@${server}:/mnt/media/" - # wait for background jobs wait