fixed a bug in lftp commands; moved FPT credentials to untracked file
This commit is contained in:
parent
192aeb320c
commit
0a2ce6fab3
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@ config.ini
|
|||||||
config.dev.ini
|
config.dev.ini
|
||||||
config.prod.ini
|
config.prod.ini
|
||||||
events.ini
|
events.ini
|
||||||
|
deploy.conf
|
||||||
|
|||||||
@ -1,23 +1,20 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# -*- coding: utf8 -*-
|
# -*- 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 "
|
lftp -c "
|
||||||
open $HOST;
|
open $HOST;
|
||||||
user $USER $PASS;
|
user $USER $PASS;
|
||||||
lcd $LOCAL_BASE_DIR;
|
rm -rf $REMOTE_BASE_DIR/tmp;
|
||||||
cd $REMOTE_BASE_DIR;
|
mirror --reverse --continue --verbose $LOCAL_DIR $REMOTE_BASE_DIR/tmp;
|
||||||
rm -rf tmp/;
|
rm -rf $REMOTE_DIR-old;
|
||||||
mirror --reverse --continue output $REMOTE_BASE_DIR/tmp;
|
mv $REMOTE_DIR $REMOTE_DIR-old;
|
||||||
mv $REMOTE_BASE_DIR/tobias-radloff.de $REMOTE_BASE_DIR/tobias-radloff.de-old;
|
mv $REMOTE_BASE_DIR/tmp $REMOTE_DIR;
|
||||||
mv $REMOTE_BASE_DIR/tmp $REMOTE_BASE_DIR/tobias-radloff.de;
|
"
|
||||||
"
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user