fixed a bug in lftp commands; moved FPT credentials to untracked file

This commit is contained in:
eclipse 2025-03-20 12:02:36 +01:00
parent 192aeb320c
commit 0a2ce6fab3
2 changed files with 13 additions and 15 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@ config.ini
config.dev.ini
config.prod.ini
events.ini
deploy.conf

View File

@ -1,23 +1,20 @@
#!/usr/bin/env bash
# -*- coding: utf8 -*-
# see here: https://stackoverflow.com/a/32235669
# source login credentials and paths
source ./deploy.conf
# get remote directory directly above target dir
# parameter expansion with '%' (remove suffix): cut off the rightmost occurrence of what comes after the percent sign
REMOTE_BASE_DIR=${REMOTE_DIR%/*}
#get username and password
USER="***REMOVED***" #Your username
PASS="***REMOVED***" #Your password
HOST="tobias-radloff.de" #Keep just the address
LOCAL_BASE_DIR="/home/tobias/Software/Websites/t-r.de" #Your local directory
REMOTE_BASE_DIR="/www" #FTP server directory
lftp -c "
open $HOST;
user $USER $PASS;
lcd $LOCAL_BASE_DIR;
cd $REMOTE_BASE_DIR;
rm -rf tmp/;
mirror --reverse --continue output $REMOTE_BASE_DIR/tmp;
mv $REMOTE_BASE_DIR/tobias-radloff.de $REMOTE_BASE_DIR/tobias-radloff.de-old;
mv $REMOTE_BASE_DIR/tmp $REMOTE_BASE_DIR/tobias-radloff.de;
"
rm -rf $REMOTE_BASE_DIR/tmp;
mirror --reverse --continue --verbose $LOCAL_DIR $REMOTE_BASE_DIR/tmp;
rm -rf $REMOTE_DIR-old;
mv $REMOTE_DIR $REMOTE_DIR-old;
mv $REMOTE_BASE_DIR/tmp $REMOTE_DIR;
"