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

49 lines
2.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
user=exu
server=he1app16
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/"
# manga
echo Kavita manga upload
rsync -urtzv --progress -e "ssh -i $sshkeypath -p $port" /home/exu/Nextcloud/Reading/manga/ ${user}@${server}:/mnt/books/kavita/manga/
# 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/
# 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/
# 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/
# download from kavita
# books
#echo Downloading books
#rsync -ur --progress -e "ssh -i $sshkeypath -p $port" ${user}@${server}:/mnt/books/kavita/books/ /home/exu/Nextcloud/Reading/Unterhaltung/
# manga
echo Kavita manga download
rsync -urtzv --progress -e "ssh -i $sshkeypath -p $port" ${user}@${server}:/mnt/books/kavita/manga/ /home/exu/Nextcloud/Reading/manga/
# Tech
#echo Downloading tech
#rsync -ur --progress -e "ssh -i $sshkeypath -p $port" ${user}@${server}:/mnt/books/kavita/tech/ /home/exu/Nextcloud/Reading/Tech/
# other
#echo Downloading other
#rsync -ur --progress -e "ssh -i $sshkeypath -p $port" ${user}@${server}:/mnt/books/kavita/other/ /home/exu/Nextcloud/Reading/other/