multistream/bin/pulldowndb
File Type: text/x-shellscript
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SOURCEDIR="$SCRIPTDIR/../"
cd "$SOURCEDIR"
source .env || exit 1
LOCALFILE="$SOURCEDIR/db.sqlite3"
REMOTEUNAME=$DEPLOYUNAME
REMOTESERVER=$DEPLOYSERVER
REMOTEPORT=$DEPLOYPORT
REMOTEFILE=$DEPLOYDIR/db.sqlite3
mv "$LOCALFILE" "$LOCALFILE.backup"
rsync -rvz -e "ssh -p $REMOTEPORT" \
${REMOTEUNAME}@$REMOTESERVER:"$REMOTEFILE" "$LOCALFILE"