63 lines
3.0 KiB
Bash
Executable File
63 lines
3.0 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 --bwlimit=3M -e "ssh -i $sshkeypath -p $port" /home/exu/Nextcloud/Books/Unterhaltung/ ${user}@${server}:/mnt/books/kavita/books/
|
|
# manga
|
|
echo Kavita manga upload
|
|
rsync -urtzv --progress --bwlimit=3M -e "ssh -i $sshkeypath -p $port" /home/exu/Nextcloud/Books/Manga/ ${user}@${server}:/mnt/books/kavita/manga/
|
|
# guides
|
|
echo Kavita guides upload
|
|
rsync -urtzv --progress --delete --bwlimit=3M -e "ssh -i $sshkeypath -p $port" /home/exu/Nextcloud/Books/Guides/ ${user}@${server}:/mnt/books/kavita/guides/
|
|
# Tech
|
|
echo Kavita tech upload
|
|
rsync -urtzv --progress --delete --bwlimit=3M -e "ssh -i $sshkeypath -p $port" /home/exu/Nextcloud/Books/Tech/ ${user}@${server}:/mnt/books/kavita/tech/
|
|
# other
|
|
echo Kavita other upload
|
|
rsync -urtzv --progress --delete --bwlimit=3M -e "ssh -i $sshkeypath -p $port" /home/exu/Nextcloud/Books/other/ ${user}@${server}:/mnt/books/kavita/other/
|
|
|
|
# download from kavita
|
|
# books
|
|
#echo Downloading books
|
|
#rsync -ur --progress --bwlimit=3M -e "ssh -i $sshkeypath -p $port" ${user}@${server}:/mnt/books/kavita/books/ /home/exu/Nextcloud/Books/Unterhaltung/
|
|
# manga
|
|
echo Kavita manga download
|
|
rsync -urtzv --progress --bwlimit=3M -e "ssh -i $sshkeypath -p $port" ${user}@${server}:/mnt/books/kavita/manga/ /home/exu/Nextcloud/Books/Manga/
|
|
# Tech
|
|
#echo Downloading tech
|
|
#rsync -ur --progress --bwlimit=3M -e "ssh -i $sshkeypath -p $port" ${user}@${server}:/mnt/books/kavita/tech/ /home/exu/Nextcloud/Books/Tech/
|
|
# other
|
|
#echo Downloading other
|
|
#rsync -ur --progress --bwlimit=3M -e "ssh -i $sshkeypath -p $port" ${user}@${server}:/mnt/books/kavita/other/ /home/exu/Nextcloud/Books/other/
|
|
|
|
# transfer to kavita-nightly
|
|
# books
|
|
echo Kavita Nightly books upload
|
|
rsync -urtzv --progress --delete --bwlimit=3M -e "ssh -i $sshkeypath -p $port" /home/exu/Nextcloud/Books/Unterhaltung/ ${user}@${server}:/mnt/books/kavita-nightly/books/
|
|
# manga
|
|
echo Kavita Nightly manga upload
|
|
rsync -urtzv --progress --bwlimit=3M -e "ssh -i $sshkeypath -p $port" /home/exu/Nextcloud/Books/Manga/ ${user}@${server}:/mnt/books/kavita-nightly/manga/
|
|
# guides
|
|
echo Kavita guides upload
|
|
rsync -urtzv --progress --delete --bwlimit=3M -e "ssh -i $sshkeypath -p $port" /home/exu/Nextcloud/Books/Guides/ ${user}@${server}:/mnt/books/kavita-nightly/guides/
|
|
# Tech
|
|
echo Kavita Nightly tech upload
|
|
rsync -urtzv --progress --delete --bwlimit=3M -e "ssh -i $sshkeypath -p $port" /home/exu/Nextcloud/Books/Tech/ ${user}@${server}:/mnt/books/kavita-nightly/tech/
|
|
# other
|
|
echo Kavita Nightly other upload
|
|
rsync -urtzv --progress --delete --bwlimit=3M -e "ssh -i $sshkeypath -p $port" /home/exu/Nextcloud/Books/other/ ${user}@${server}:/mnt/books/kavita-nightly/other/
|