configs/arch-config/scripts/in_path/sc-kavita-update

35 lines
1.4 KiB
Plaintext
Raw Normal View History

2023-11-23 20:03:04 +01:00
#!/usr/bin/env bash
2023-11-23 18:48:31 +01:00
set -euo pipefail
user=exu
2023-12-08 18:09:07 +01:00
server=he1app16
2023-11-23 18:48:31 +01:00
port=22
sshkeypath=$HOME/.ssh/id_ed25519
# 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
# transfer to kavita
# books
echo Kavita books upload
rsync -urtzv --progress --delete -e "ssh -i $sshkeypath -p $port" /home/exu/Nextcloud/Reading/books/ ${user}@${server}:/mnt/books/kavita/books/
# light novels
echo Kavita light novels upload
rsync -urtzv --progress --delete -e "ssh -i $sshkeypath -p $port" "/home/exu/Nextcloud/Reading/light novels/" "${user}@${server}:/mnt/books/kavita/light novels/"
2023-11-23 18:48:31 +01:00
# manga
echo Kavita manga upload
2024-05-17 22:38:47 +02:00
rsync -urtzv --progress --delete -e "ssh -i $sshkeypath -p $port" /home/exu/Nextcloud/Reading/manga/ ${user}@${server}:/mnt/books/kavita/manga/
2023-11-23 18:48:31 +01:00
# guides
echo Kavita guides upload
rsync -urtzv --progress --delete -e "ssh -i $sshkeypath -p $port" /home/exu/Nextcloud/Reading/guides/ ${user}@${server}:/mnt/books/kavita/guides/
2023-11-23 18:48:31 +01:00
# Tech
echo Kavita tech upload
rsync -urtzv --progress --delete -e "ssh -i $sshkeypath -p $port" /home/exu/Nextcloud/Reading/tech/ ${user}@${server}:/mnt/books/kavita/tech/
2023-11-23 18:48:31 +01:00
# other
echo Kavita other upload
rsync -urtzv --progress --delete -e "ssh -i $sshkeypath -p $port" /home/exu/Nextcloud/Reading/other/ ${user}@${server}:/mnt/books/kavita/other/