bk.sh: Restructure

This commit is contained in:
dogeystamp 2022-05-21 20:28:28 -04:00
parent dd7c370a84
commit cb9cdf0d38
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38

View File

@ -1,16 +1,34 @@
#!/bin/sh #!/bin/sh
# Remote backup script # Remote backup script
# Either push files to remote or receive full backup tarballs
while getopts ":pr" o; do
case "${o}" in
p) ACTION=PUSH ;;
r) ACTION=RECV ;;
esac
done
if [ $ACTION = PUSH ]
then
rsync -avzP \ rsync -avzP \
--chown=dogeystamp:sftpr \ --chown=dogeystamp:sftpr \
--exclude=mus \ --exclude=med/mus \
--exclude=gv \ --exclude=med/gv \
--exclude=dow \ --exclude=dox/dow \
--exclude=rss \ --exclude=dox/rss \
--exclude=rem \ --exclude=dox/rem \
--exclude=proj \ --exclude=dox/proj \
--exclude=vms \ --exclude=dox/vms \
--exclude=pix/hdri \ --exclude=med/pix/hdri \
--exclude=memes/woof/quar \ --exclude=med/memes/woof/quar \
~/med ~/dox dogeystamp@lambda:/mnt/disk/uv/ ~/med ~/dox dogeystamp@lambda:/mnt/disk/uv/
fi
if [ $ACTION = RECV ]
then
rsync -avzP \
dogeystamp@lambda:~/mnt/disk_b/ ~/arc/bk/
fi