35 lines
1.4 KiB
Plaintext
35 lines
1.4 KiB
Plaintext
|
#!/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 --delete -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/
|